I used to have stiff neck due to continuous sitting & gazing at computer for hours at work place. It resulted in stiff neck very frequently. All I did was applying balm & taking pain killers.
Finally got slip disc at C5-C6 & C6-C7 neck spine. It was so worst that a shooting pain used to originate from back & run through my index finger & thumb.
I took medications mostly steroids but it didnt help. Best was taking therapy sessions from a Chiroprator. This form of practice is not very famous in India but is the one which actually address the core issues & helps relieve pain & loosen the stiffness in neck muscles.
Include calsium in your diet & walk regularly. Do neck exercise even when sitting in front of computer. Take break & walk for 2-3 minutes every 45 minutes of sitting in front of computer. It will not only help relieve strain from spine but also on your precious eyes.