Sunday, July 12, 2009

I did not write this, I took it from a comment on Reddit.

Make yourself do it every day (with occasional days off; sometimes you have to let your brain chemistry balance itself out), have several projects to switch between when you get burned out, and don't program when you should be sleeping.


That's the easy stuff. Here's the real secret:

You know that feeling when your brain hurts because something is "too hard to implement" and/or there's "too much drudgery" to get through? Overcoming that is probably the most important part of becoming a strong programmer.

Many martial arts involve a kind of conditioning which basically involves getting the crap kicked out of you, generally known as "iron body". This is partially for pain tolerance, but the name "iron body" is apt, because it also causes small chips and fractures in the bones, which heal to make the bones stronger and denser.

It is a simple fact with programming that at one point or another, most problems worth solving will hurt your head to think about. It may be the expanse of implementation details you can imagine stretching to the horizon, the abstractness of the problem, the difficulty of wrapping your mind around a particular equation, etc.

You have a choice: reject this idea, and waste a lot of time trying to find the perfect project which will be all fun all the time. You will become frustrated as you give up on every project you start. Or you can accept this simple fact and train yourself to have "iron mind":


  1. Tolerate a little mind pain and work through it. It will be unpleasant, but you should get over it pretty quickly. You can do fun/easy parts too, but try to get an hour or two of unpleasantness in every day.


  2. GOTO 1.


Two main things will happen. The first is that you will learn to deal with mental strain so that it doesn't bother you so much. The second is that you will learn how to divide up and fit problems into your mind so that they don't hurt to think about. The latter part is, I think, really key, because it is not merely a coping mechanism, but a problem solving skill. As time goes on, the definition of "unpleasant" will change; so long as you keep making yourself work through whatever "unpleasant" means, you will keep growing.

At least, this is how it has been for me.

Also: caffeine. Oh, and water. Caffeine without enough water will just make you feel shitty. If you drink tea, you're guaranteed to get enough water. Stay away from caffeine pills.

SDL on Windows.

So I got SDL setup with codeblocks on Windows. It only took a few minutes, and I begin reworking through the sdl tutorials I was working through under Ubuntu. For a small project I can try to get something that can be checked out of SVN and built under Windows and Ubuntu.

With all my work on automating builds, I wonder how you go about automating a dual O/S build. How are tests handled? I would think you would have a main-line build machine (or virtual) for each O/S you plan to distribute for. I may investigate this further at a later time.

Ogre 3D and Code::Blocks

I installed code::blocks on Windows allong with Mingw. I then installed Ogre 3d sdk and tried to get the examples to compile. I'm getting a strange include error that I haven't been able to find any information on. I'm stopping with Ogre for now. I am interested in updating my ubuntu install of code::blocks to the latest release now.

I'm going to try and get some SDL examples compiling on windows & ubuntu. I've been reading "Physics for Game Programmers" and working through things. I haven't been making much time for this though. Neither have I been able to play games much. 

I will report back my luck with SDL and the Physics progress.