Thursday, February 28, 2013

Code Complete - Target Audience For Code


Twice today I read quotes or paraphrases of a statement from the book Code Complete by Steve McConnell, "Write Programs for People First, Computers Second".

I certainly understand that, I've been doing maintenance programming for the past 20 years, so I know what it means to be the human/programmer audience for code.  I know how hard it is to read bad code and how hard it is.  I'm also fully aware that a lot of code that is hard for people to read is often buggy so though the computer understands it, the computer doesn't end up doing what the people would prefer it was doing.

And I know what it's like to work with a guy who refuses to write easy-to-read code angrily telling anyone who gives him feedback, "I don't care! If someone is too stupid to understand this, then that's not my problem!"

It's not that I don't know what it means…

However, thinking about the statement itself…

If the computer isn't your first target "audience" for the code you write, why are you writing it?  You might as well not write code if it isn't primarily for the computer to execute.

That database code?  If the computer is only your second choice as a target, how about hiring some file clerks and giving them the instructions?

That graphics program you're writing, if the computer isn't your main audience, how about going and buying some top quality pencils, brushes and paints and go out in the fresh air instead of sitting on your butt in front of the computer?

So, really, if the computer isn't your primary target, you should write the code at all.

That said, of course, once you're committing to writing code to solve the problem, by all means write it so the next poor schmuck can read it and understand it (bearing in mind, that next poor schmuck might very well be you in a short while…)

Monday, February 25, 2013

Biting Cold Sunday in the Financial District

Yesterday we had lunch in Hell's Kitchen with my cousin, Mike, and the three of us took the subway down to Lower Manhattan to walk around, explore and take photos.  It's not a place we regularly find ourselves, so that was part of the reason to go there...

It was bitterly cold with a biting wind, making it hard to keep our hands out of our pockets to take photos and due to that we didn't stay out too long.  It was also hard dodging joggers taking up much of the sidewalk along the riverfront.

We found the Irish Hunger Memorial that none of us had heard of, but found it interesting.  A bit of ancient Ireland right in Manhattan...

Along the park it was hard walking around and taking