|
|
Programmers Don't Like to Code
Andrew Leonard interviewing Scott Rosenberg:
cough Wow. If Rosenberg isn’t butchering Constantine’s quote, it lends credence that even software’s great practitioners lack the ability to introspect and cogently report on their own profession. No wonder we’re all confused. Rosenberg is wrong. Programmers don’t like coding, they like problem solving. If programmers liked to code, we’d all be writing in machine language to this day. You can write that stuff all day and get precious little of the real problem solved. If programmers liked to code, they wouldn’t value a language by its libraries. If programmers liked to code, every last one of us would be overjoyed to write our own HTTP client. Instead, programmers get pissed when they have to write code. “I just want to update this field in this file, why do I have to write an XML parser?” They will abandon languages/platforms wholesale that lack the features they need (either built-in or as libraries). From an outsider’s vantage, I can see why they’d think we like coding. We solve problems by coding, and we’re all happy and enthused while typing away or talking code. But they’re confusing the action and the intention. It’s not pulling the trigger that makes me happy, it’s hitting the target. The action approaches incidental. Another reason outsiders think we like to code is that we’re always talking about rewriting things. Even coders themselves fall into the delusion we rewrite because it’s “more fun than reading other people’s code”. While there are times we want to ground-up rewrite due to architectural considerations (new runtime, new language, major new functionality) in my experience the common case for wanting to rewrite is to understand. Spolsky gets it right that “It’s harder to read code than to write it”, but unfortunately reaches for the tired “people (programmers) are stupid/lazy/undiciplined” argument as an explanation. (I chafe in principle against this class of argument since it almost always obscures deeper underlying factors.) He grazes the desire-to-understand intent behind rewriting by trotting out the two-page function example with the hypothetical programmer’s “I don’t know what half of these API calls are for” quotation, but leaves it to die in the snow for his shinier superficial negative explanation. Programmers desire to rewrite because they know that after starting with a clean sheet of paper and building it all again, at the end they’ll understand the whole. Programmers write code to learn. Software has this double-edged sword where you can’t just wave your hands instead of implementing a particular function. It all has to be crystal. Programmers know this. They know when they’re done, they’ll have a complete understanding. It’s a noble desire. Bad source bases irritate programmers because it shakes their foundation of understanding necessary to solve the problem. I reject the explanation that programmers capriciously want to rewrite code for the fun of it. The programmers-write-code-to-learn idea is behind Brooks’ “build one to throw one away”. Brooks’ idea was seminal but raw, today we’ve nuanced it down to spikes and iterative development. The second and final deep reason behind the desire to rewrite is elegance. Like rewrite-to-understand, this reason is also founded in understanding. Once you understand a problem and have its solution, it’s only natural to want to cleave off the unnecessary, trimming the solution to its stark and obvious. Throwing a bone to Spolsky, I’ll concede rewriting-for-elegence is a slippery slope toward code narcissism. Summing up: programmers don’t like to code, we like to solve problems. Coding is not problem solving, but software problem solving usually involves some coding. Even when we talk about rewriting something, the objective is not to code, it’s usually to get a better understanding of the problem for solving in the best possible manner. A much better argument is that since programmers like problem solving, they invent problems where there aren’t any. But that’s another post. Update Feb 5: Rosenberg responds, Walker frames Constantine’s quote and I dredge up bubble-land in my follow-up. Sunday, February 04, 2007
|
Contact Me Topics RSS Feed Linkblog
Bill Bumgarner Brent Simmons Daniel Jalkut Dave Dribin Eric Albert Eric Rescorla Eric Sink Greg Miller Gus Mueller Jeremy Zawodny John Gruber Mark Dalrymple Michael Tsai Peter Ammon Raymond Chen Ryan Wilcox Scott Stevenson Steven Frank The Daily WTF we hates software Wil Shipley |
Copyright © 1997-2010 Jonathan 'Wolf' Rentzsch. All rights reserved.
Questions? Comments? Contact Me.