Some people are not very good at organizing their free time so that they get enough sleep the night before. This will hurt your career as a programmer. If you want to improve your performance, drugs will be nowhere near as effective as sleep.
If you have a social or medical situation that making it so that you can't sleep, do whatever you can to fix that problem. I advise you to try to make it your top priority. Get professional help if you need it.
If you are in a situation where you can't sleep because your work/commute time is eating into your sleep time, quit. You are damaging your health and also your ability to grow as a programmer. It is not worth it in any way.
Nothing else I have done has been so important to my life and career as the above.