3 ms·
I think you hit what the author was talking about, which is cranking out code so that it works (for whatever goal, in the case the author describes, user experi
by 1337p337 16y ago
I think you hit what the author was talking about, which is cranking out code so that it works (for whatever goal, in the case the author describes, user experience), not necessarily so that the code is good.
I learned Japanese, but when speaking it, I'm often hesitant. I used to hang out a lot with native speakers when I was younger, and there seems to be nothing middle-aged Japanese guys love more than seeing young men drink. After a few drinks, you stop second-guessing yourself, and so when speaking, words just came out, and my coworkers began laughing when, after I had spent all day stuttering and pausing, I would start spitting out fluid sentences. (A few more and I became unintelligible again, but for different reasons than hesitance; this was just as amusing to them.)
Coding is the same. Writing a small script, a prototype, or a little program for fun (or on the peak of the "Ballmer curve"), you don't think so much about structure and cleanliness, and you write the minimal amount that gets the job done, even if it's a hairy mess, and leave the editing pass for later (if ever). It's essentially the main tenet of Worse is Better camp and the Agile methodology: make it work as soon as you can.
I've worked at startups and large companies, and at both types of place, I've seen huge codebases, properly engineered and sometimes representing decades of man-hours, get scrapped before launch because they were wrong. I've also seen horrible code that ignored every good idea about building software that survived years. Personally, I have a bunch of code that is embarassing to look at, written as quick hacks, that has survived and done its job for years because it didn't try to understand the problem, just solve it.
Not that structure is bad or that engineering is wrong, but it seems to be independent of a program's survivability and its utility. In fact, Worse is Better seems to produce code that is more adaptable because its structure ignores edge cases that may turn out unimportant in the real world, so when unanticipated but important edge cases come up, the code is less rigid and can be adapted.
I think this lack of second guesses and of worrying about what doesn't matter for the problem at hand is exactly what the author is talking about. In terms of long-term maintenance, a prototype is cheap to build and easy to scrap; if it doesn't get scrapped and replaced, well...there will always be a project that junior programmers can cut their teeth on before subjecting a clean codebase to a kid fresh out of school.
- phillco 16y agoI aim for the best of both worlds - blast through the coding when you're at the top of the world; then, once it all works, go back and clean it up and make it pretty. IME, unless you're never ever going to see the code again, it's well worth the time spent. Of course, not everyone is willing to pay for #2. "It's already done, isn't it?" :(
- 1337p337 16y agoThat's what my strategy is. "Get it working, then get it working right, then get it working fast." The "get it working" part is where you start to be able to tell whether or not you've solved the right problem.
- wisty 16y agoI guess it depends on the environment. In a startup, you need results and vision. Even if it costs millions to clean up the mess, you need to get version one out the door. Technical debt is still an issue (sloppy code can cause bugs, and make it harder to iterate), but you don't need the code to be as clean as humanly possible. In a more stable environment, dirty code will almost certainly come back to haunt you, or your successor. It's not worth 1 man-year to clean up 1 man-year of work, just so you could your job done a little faster. Besider, the pointy-haired manager will push you to speed up, even if it causes more problems later.
- 1337p337 16y agoFor a major undertaking, sure. If you're a start-up, odds are that you have one product, and you can't afford for it to stagnate while it's scrapped and rewritten or while the developers layer hacks on hacks to fix bugs created by the last round of hacks. Even a start-up, though, has tons of code that is not part of the main codebase. A pile of monitoring scripts, a program that generates an arbitrarily large amount of data for a test database, the company's blog, internal mailing list software, etc. When you have fewer than 50 employees, it is okay if half of those codebases are ugly hacks.