I am about to complete the last year of my College . I started programming in the hope of becoming a great Software engineer . However ,something went wrong somewhere . I find myself doing the same things again and again. I revise things thoroughly everytime I do them. But still ,time and again , I have to revise them.
For example:
I have recently done some algorithm say "preorder traversal of a BinaryTree" , I tend to forget it soon(after a week or so). I remember recursive algorithms more than iterative.
How to remember programs/algorithms ?
Should I use some other strategy to remember algorithms and stuff ?
What programmers usually eat to keep their brain and eyes healthy ?
I have gained weight , eyesight got weaker and feel lazy all the time.
Most of the time , I am working but still my productivity is too low.
I need some serious advice. I want to become a good engineer but might end up in some other profession because of such things.
Sorry I can't really help with the memory thing, I'm 25 yrs old and I still get greater then and less then mixed up (but oddly enough never the I\O stream operators). As for your other questions though:
How to remember programs/algorithms?
By documenting your code and literally NEVER DELETING ANYTHING!!! Even if it's some oddly specific custom header file that you wrote for one oddly specific client and you haven't looked at in years, throw it in a tarball and stash it away somewhere. Data storage is cheap, data recovery is not. Also work on writing modular code so that you won't have to remember, just copy paste and if you're really that interested read the comments you wrote in it.
I have gained weight , eyesight got weaker and feel lazy all the time.
Congratulations OP you're becoming an adult! As you get older your metabolism slows down, that's just a fact of life. Before my little one was in the picture I had some success getting my energy level back up by Kickboxing. If you're like me and the thought of running in place on some machine while staring at the wall feels like a sentence of death by monotony then I suggest any of the meditative combat sports. The stretching also did wonders to relieve my carpal tunnel. I never got into it but rock climbing also looked like fun, but that one will be limited based on where you live.
I have gained weight , eyesight got weaker and feel lazy all the time.
Most of the time , I am working but still my productivity is too low.
Honestly, becoming disciplined with eating habits and exercise can really boost your energy level, as well as your overall happiness. Try going to sleep earlier and waking up earlier, eat lots of fruit and nutritious food and try to find some form of exercise that you enjoy.
I'm 25 yrs old and I still get greater then and less then mixed up
When I was in Elementary schools I had to do math "problems" where we would fill in a blank to a problem like: 2+6 ___ 9-3. We had to make a true statement by filling in the blank with a >, < or = sign. I had the same problem of mixing up greater then and less than signs until my teacher taught me the memory device "the shark opens its mouth to the bigger number" to remember that > is a greater than symbol. To this day I'm still thankful to her, it's saved me countless Google searches during my programming career.