in reply to Code Structures

A former coworker of mine gave me some invaluable advice with regards to coding when he said "I try not to do anything weird". That has helped me grow a lot as a programmer. After all, code is read more than it is written for the most part, right?

When working as part of a team, you will be tasked with contributing to parts of the code which you are not familiar with. If you are a hobbyist who likes to decipher obfuscations, then maybe you prefer coworkers who can brilliantly transform a simple conditional into an elegant looking line of hieroglyphics.

Now that I depend on reading and writing code for my livelihood, I prefer the simplest code structure that Gets the Job Done. Maintainability is key, and even though I work with smart people, I appreciate five lines of code with two lines of comments when perhaps the same task could be accomplished with one line of code and no comments.

To paraphrase another former coworker who talked about issues he encountered when trying to implement a solution using map(), "Back in my day, we used foreach(), and we liked it!"

Replies are listed 'Best First'.
Re^2: Code Structures
by mrborisguy (Hermit) on May 21, 2005 at 18:28 UTC

    I think this is why it IS important to know more ways to do something! Sometimes, one way of solving a problem quickly becomes a mess, when a different way would have been succinct, simple, and understandable. That's why it's important to learn different ways to do things. (In my opinion)

    -Bryan