Thursday, April 21, 2011

Strategies for Successful Coding

If you want to study Computer Science, Electrical Engineering (Technology), IT, Computer Engineering, BCIS, computer networking, etc., you are going to have to program. A lot. In fact, programming a lot is the only way to get better. That applies to everything! In order to get better at anything, you have to practice! If I want to get better at tennis, baseball, ping pong, swimming, riding a bike, tying shoes, etc., I have to practice. The same applies to coding.

However, while coding, your brain assumes a certain state of mind. Nothing to be alarmed of or weary of. Your brain assumes another state of mind while driving, playing games, etc. The "programming" state of mind is unique though. Not everyone likes coding. There are some EE students I know that absolutely despise coding. Maybe it's boring, hard, not applicable to their studies, or what have you. I personally don't mind coding, especially when my script works well and does what it's supposed to (and gets me an A). Anyway, your mind will become fatigued while programming for an exorbitant amount of time. The process becomes worse if you are tired, stressed, or distracted. When I code, I function best on a nice buzz, while sitting on either my work computer or my laptop. When I say buzz, I mean caffeine buzz, mind you. I've actually never tried coding while slightly inebriated, but that's beside the point. I CANNOT program on my home desktop computer. Oh sure it has all the system requirements and a nice screen, comfy amount of desk space, etc., but the thing that ruins it for me are all the distractions. Seriously my desktop machine is a pretty good rig - it can run any type of game out there and has a 1920X1080 display, so I am always tempted to play a game, browse the internet, open up that new tab, check my email, Steam chat with a friend, fire up Portal 2...
But with my laptop, I don't have too many distractions - which is why I am oh so much more productive on my laptop. What I'm trying to say is:
Rule 1: Limit your distractions
It's ok to play music or occasionally facebook chat with someone in the background, but personally I work best when the option for distraction isn't even there. The smaller screen and resolution also keeps me concentrated on one screen at a time. Also - there are no games installed onto my laptop. It may be capable of playing games, but I choose not to install any since that would just present an opportunity for distraction. Admittedly though, my laptop isn't any good for gaming. Sometimes though, a distraction may be just what you need - bringing me to rule 2:
Rule 2: Take breaks
I can't program for 3,4,5 hours at a time - especially when I'm tired. Just last night I was trying to fix a TCP communications algorithm dealing with RSA encryption, and I had absolutely no idea what I was doing -- because it was 6 in the morning. I had been trying to fix this for about an hour now. I also had a project due that day (today). So I ended up taking a 1 hour nap, and upon waking up, found a solution within 10 minutes. Sometimes taking a break from programming is all you need to clear your thoughts and take a fresh perspective on a problem. The same applies to other critical thinking homework assignments - perhaps in your math classes, physics, etc.
Rule 3: Utilize your resources. I know this one is probably pretty obvious but I think it's worth mentioning. If you have a friend taking the same programming or math class as you, don't be afraid to ask them for help or to study together. Your friends in your degree are your most valuable asset, because they are taking the same exact classes you are. Make friends with people in your classes and you can troubleshoot with each other and help each other out.

Anyway that's 3 - that's good enough for a list. Besides I'm getting fatigued from writing this blog entry - time for a break ;)