This is normal for a lot of people, but it is not ideal, and there are things you can do to improve the situation. While I agree that seeing a doctor can be helpful, there may be other simpler and cheaper steps you can take to improve the situation.
First you need to answer these questions:
All of these things are known to negatively affect your sleep quality if you don’t control them, and they can have the effect of leaving you feeling drowsy and sleepy in the morning, even if you don’t perceive a problem with any of your current habits.
Get the answers to these questions for yourself. Tackling them one by one will help you fix the problem. Some may even be fun and improve your life as a whole.
If fixing these things doesn’t help, you will still benefit from having these answers to give to your doctor. Doctors typically don’t have time to go over your personal history and consider all these factors during a 15-minute appointment. If you have these answers at the start, you will be giving yourself the best chance of fixing it.
Original Answer on Quora
Q&A: I'm a programmer who writes code at night. Now I either can't fall asleep or have problems waking in the morning. Is this normal? I'm 17.
Hi, in general what you are describing is not a good sign. These occurrences are your body telling you that things need to change, and there can be serious long term consequences to not giving the proper attention to your body’s sleep needs. Do what you can to change your programming schedule. Studies have shown even small amounts of light (like that from a computer screen, or even on/off lights on appliances), at night, can have a real negative impact on your sleep quality. Read this article  for more information on how this works.
The sooner you can get to a more regular sleep schedule, while protecting the quality and quantity of your sleep hours (aka - sleep hygiene), the sooner you can have the better state of mind and body you want during the day.
Nutrition is also a key factor in getting better sleep that is often under-estimated. Be mindful of the quality of food you consume, limit sugary drinks or alcohol, etc. This will also help you get better quality sleep and feel better during the day, whatever time you choose to go to bed.
 Q&A: Why Is Blue Light before Bedtime Bad for Sleep?
Original Answer on Quora
James L Poole
I am a holistic health therapist: Emmett Technique practitioner, aromatherapist, nutritional therapist, and Reiki healer. This is my blog about natural healing. For more frequent updates, please check my Facebook group page.