Thursday, May 22, 2008

Reading other people's code is good

Reading other people's code is the needle lost in the hay buried deep in this article entitled "Language Dabbling Considered Wasteful". Forget the dreadful title that makes my eyes roll back in my head. It's still too close to Dijkstra's famous paper. But, I digress. This is not a pointless rant on over abused trivia.

If you want to become a better programmer, read code and understand it. There's no way around it. Read code, experiment with it, and figure out if you like it or not. Bad code can teach just as much. It's no fun to read, but it shows how not to do things. The danger with bad code is being picking up incorrect habits. Get into the practice of reading code and not the Javadocs. If you're learning a new language you will see the idioms and be able to apply them. Plus, you will know how to find how things work underneath the covers if you run into a super thorny issue.

Yeah, give me the source any day. I love reading code and it's how I learn. Once I get past the basics, I start reading and understanding others code. I will say it again, there are no shortcuts.

1 comment:

Unknown said...

Hi Blaine,

I'd say it's not buried too deep in the post though: it's the only bolded sentence in the whole thing, and reinforced in the update.

Where it did get buried was the pseudo-discussion following the post, where people who didn't read past the first paragraph and/or cannot understand written English completely missed the point of the post and attacked various straw men of their own creation. One who particularly pissed me off was a guy saying I was arguing against for single-language programming, despite SEVERAL instances where I push multiple languages. Argh.

It's good to see someone picked on the read code part.

And I used to cover a lot of Iron Maiden songs a few years back ;) hehe. Hallowed Be Thy Name is my favorite.

cheers,
gustavo