Writing code is like writing literature. Sometimes you have to write big to write small.
OK, if you’re a rock star, you might be able to think big and write small, but I can’t manage that feat. I often need a day of hunting down nasty copy-and-paste bugs before I realize, hey, all this stuff is redundant. I can write a function that makes this duplication unnecessary.
I can’t count the number of times I’ve tried to write concise, elegant code from the start, only to find that I’ve been writing small by thinking small. Getting lost in the details is a great way to write optimized code that works like a charm — but doesn’t actually do anything of value.
Once I thought that design patterns might be the answer to my programming struggles. Then I discovered that my accuracy rate in picking the right pattern for any given programming problem was really poor. More often, it’s led me to implement overly complex solutions for simple problems.
For a long time, I thought it might be my lack of a computer science degree. But I haven’t found a programming style or development framework that fixes the problem. Maybe there just isn’t an efficient way for me to get my thoughts into the computer. The only way I know to do it is to write a big, sloppy mess at the start. Then I’ll slowly, carefully, edit it down to its bare essentials.
Mozart might be able to write a symphony in a single sitting without penning a stray note. Not me.