Spend too long searching for either, and you risk ending up with that bane of good programming: the clever solution. It's so clever that the other members of the team have to sit and puzzle over it like a crossword before they understand how it works. Even then, they dare not touch it, ever, for fear it might fly apart.
In many cases, the solution is too clever even for its own good. In their 1974 book, "The Elements of Programming Style," Brian Kernighan and P.J. Plauger wrote, "Everyone knows that debugging is twice as hard as writing a program in the first place. So if you're as clever as you can be when you write it, how will you ever debug it?" For that matter, how will anyone else?
In a sense, concentrating on finding the most "elegant" solution to a programming problem is another kind of premature optimization. Solving the problem should be the primary goal.
So be wary of programmers who seem more interested in feathering their own caps than in writing code that's easy to read, maintain, and debug. Good code might not be that simple. Good code might not be that elegant. The best code works, works well, and is bug-free. Why ask for more?
- Read the Off the Record blog for stories from IT pros -- and share your own tech tale
- 10 hard truths developers must learn to accept
- Programmer personality types: 13 profiles in code
- 11 programming trends to watch
- 12 programming mistakes to avoid
- 7 programming languages on the rise
- 10 programming languages that could shake up IT
- Hello, world: Programming languages quiz
- Programming IQ test: Round 1
- Programming IQ test: Round 2
- From PHP to Perl: What's hot, what's not in scripting languages
- 13 essential programming tools for the mobile Web
- Open source programming tools on the rise
- Download: InfoWorld HTML5 Deep Dive
- 11 hard truths about HTML5
This article, "7 programming myths -- busted!," originally appeared at InfoWorld.com. Follow the latest news in programming and mobile technology at InfoWorld.com. For the latest business technology news, follow InfoWorld.com on Twitter.