3 ms·
It's really not clear that the spaghetti code approach is better time-wise over anything but the immediate short term. In my experience, any advantages fall awa
by tikhonj 11y ago
It's really not clear that the spaghetti code approach is better time-wise over anything but the immediate short term. In my experience, any advantages fall away once you get out of hackathon territory—a matter of weeks, not months.
At a point, even if absolute correctness is not important, you just spend so much less time debugging your old code and it takes so much less effort to add new features (ie less need to rewrite or extend old code to support the new) that you end up producing more overall.
The problem is that these improvements are non-local. Yes, over a month, you might get more done per day if you slow down and write less hacky code—but it won't help you get your thing out today. In the short term, it feels like you're always more productive being hacky because, day to day, you get specific things done faster… but, over the long term (or even the medium term!), you're actually less productive. The human mind is not great at accounting for time and effort.
This is exacerbated significantly by tight deadlines and constant pressure. And the sort of companies that have those problems also tend to overwork their engineers, which has exactly the same sort of non-local consequences. (If you work 80 hours this week, you will get more done than you would have. And the same is true next week, and the week after—but your base productivity is falling so, after a few months, you will be less productive in absolute terms!¹)
These local improvements are very tempting—and sometimes they're actually justified! There are definitely scripts and programs that only matter in the immediate short term, and you shouldn't worry about making them elegant. But people apply this far to widely. If your program will matter in the medium term—if you're going to be iterating on it over multiple weeks—it's probably worth maintaining a bit of discipline throughout and writing more elegant, maintainable and readable code.
¹ I remember seeing a pretty compelling study about how long work weeks affect absolute productivity, but I can't find it at the moment.
- crdb 11y agoOh, I agree with you entirely. Let me reword/summarize my comment: there's r-strategists and K-strategists. It's usually better in most relationships to be with K-strategists. Where I disagree with Djisktra is in the idea of a world without r-strategists; not because it's not desirable, but because it's highly unlikely.
- sanderjd 11y agoFor anyone else who gets here and, like me, isn't familiar with this terminology, it appears to be ecological terminology for differentiating between species that select for quantity versus quality[0]. [0]: http://en.wikipedia.org/wiki/R/K_selection_theory http://en.wikipedia.org/wiki/R/K_selection_theory