4 ms·
So how do you avoid getting nerd-sniped when something really is just bad? There's an analogue of the Bullshit Asymmetry Principle here; any of us could slap ou
by lmm 5y ago
So how do you avoid getting nerd-sniped when something really is just bad? There's an analogue of the Bullshit Asymmetry Principle here; any of us could slap out some code in half an hour (no doubt many of us have, myself included) and then any of us could spend days or weeks trying to understand why we did it that way. Taking the time to understand bad software is, like up-front planning, one of those things that sounds worthy and wise, but I suspect it's actually a poor use of time on the whole.
- mannykannot 5y ago> So how do you avoid getting nerd-sniped when something really is just bad? This is not logic, where existence of a counterexample invalidates the general argument. One reason for looking at even genuinely bad code is that it may express domain knowledge that you are currently unaware of. Jon Bentley told the story of a Bell Labs researcher who found that his fast and correct algorithm for something or other had been "fixed" and "improved" so much that it was no longer efficient (a few comments may have helped here - though not necessarily - but that is a discussion for another time.)
- awkward 5y agoThe same way you avoid getting sucked into anything - go in knowing how much time and effort you're willing to expend and cut your losses when you hit the limit.
- michaelrpeskin 5y agoSometimes, it helps to just put in the comments why you did something that you know is not optimal. Often you'll write "bad" code just because it makes sense. I had to update something last week where the requirements changed dramatically from when they were written. It's nobody's fault. When the requirements were written, we did really understand the problem. After the customer got the code in their hand, they wanted to extend it in a way that wasn't obvious to us or them. I could have done a multi-month refactoring to make it clean and pretty, but that didn't make any business sense, so I did some surgical changes. To avoid someone coming back next year and thinking WTF, I added this to the comment (most of the details left out for anonymity) //...Not how I would design it from scratch, but a nice evolutionary change. Now next year when someone else looks at it (or even next-year me), we won't waste time thinking if we should refactor it, because it's obvious that we already looked at the pros and cons and decided not to.
- darepublic 5y agoIf it's not you someone else may indeed want to refactor. They would like a crack at the designing from scratch