Thursday, June 02, 2005

Coding Frustrations

Repeat after me... "Whitespace is our friend."

Yes, folks, when writing code, whitespace is the best thing you can do to make your code readable. This all goes back to maintainability and not killing the people trying to modify your code in the future. Because while you undoubtedly know that code inside out, I don't. Heck, I don't even know my own code inside out. More than once I've been looking at a script I've written and had to go back and check to make sure that I'm actually the original writer of that code. Then I ask myself what I was thinking when I wrote it. Which typically leads to a desire to refactor my code, leaving me in an endless spiral of rewriting code until I stop asking myself what I was thinking and start asking what the code was REALLY supposed to do when I started.

Ok, it's not that bad. Really. I typically know what the code is supposed to do because....

Basically it comes down to this - a function should do one thing, and only one thing. It should be properly named "dostuff()" is not a good option. It'd be great if it didn't include the original specs as commenting. Although that can be somewhat helpful if those comments are updated when necessary and continued throughout the code. Otherwise, people like me tend to get lost. Give me a map - I might actually use it. Give me half a map - not real useful.

And this weekend, I am SO rewriting the darned code. If we were properly using script libraries and subroutines, my work would be done in an hour or less today. Instead I have to weed through 8 pages of code trying to figure out which parts are relevant to me, and which parts involved subroutines embedded in subroutines in a maze that will take hours to sort out.

In unrelated news...in the next few weeks it looks like I'll be meeting someone who interests the heck out of me at this point. Am I excited - yep. Am I scared... heck yeah. LOL. At some point I turned into a big chicken, and I'm a little nervous about this whole thing. At least I have my first toastmasters speech coming up in 2 weeks. Something else to be nervous about to take my mind off of other things.

Hmm, I'm done babbling now.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home