Daily Archives: April 5, 2004

“Do not read just code, learn algorithms”, OK, But . . .

I just read yesterday’s Take Outs (by Ken Tegels) which pointed me towards Frans Bouma’s blog which boldly states “Do not read just code, learn algorithms”. I completely agree that good algorithm design is a valuable skill to have, and its not a that applies only to software engineers.

Surgeons invent new life saving techniques every day and document them as a precise algorithm for others to follow. But would you want a surgeon that had never touched a scalpel and doesn’t appreciate its form an handling touch your body? What about the body of one of your children?

Frans, I think you might be missing the point on why people look at code. They aren’t necessarily looking to distill a design from it (although doing a code walk can sometimes help link islands of information together), instead they are looking for form. One classic benefit that I got from reading copious amounts of other peoples code was declaring variables just in time (as opposed to just instansiating just in time).

The reason is that when it comes to refactor the code (you know, behaviour preserving modifications), tool support works best with just intime declaration (think of the Extract Method scenario).

Learning is an iterative process, the act of implementing your design in code (and seeing others implment your design in code) makes you a better designer the next time around – this is where ivory tower architects get into trouble.

In short, good designers don’t buy a one way ticket when going from design to code. Sorry for the mixed metaphors . . . .


Wisdom: Teach Yourself Programming in Ten Years

Jim Vrckovski just posted a link to this article. I had read this article previously but had lost the link to it (not again, I’m putting it in my blog, which in turn will result in it being stored in Outlook, which will result in it being indexed by LookOut). In short the article is a must read – so do it now.

If you are taking up .NET, I think that you can expect to learn most of the syntax for your language within a week, and with a little bit of help (shameless plug) get across the major framework pieces on your first real project. I’ve been doing stuff with .NET for over four years now and I am still learning new stuff – not necessarily stuff that most of us would use everyday, but the kind of stuff that makes you glad you took the time to dig through documentation and crack open assemblies with ILDASM or Reflector.

One of my current hobbies is making the VS.NET designer bend to my will.