3 ms·
> IME “the code is crap, we need to start again” really means “I don’t want to (or worse, can’t) read source code that isn’t mine” understood. but sometimes th
by zabzonk 4y ago
> IME “the code is crap, we need to start again” really means “I don’t want to (or worse, can’t) read source code that isn’t mine”
understood. but sometimes the code really is crap, and possibly a danger to the business.
- jt2190 4y agoI think it’s more helpful to try and quantify that though, rather that just leave a vague “sometimes” response. For example, one thing I look for is when the model can not explicitly express all of the states that we now need, and as a result the code has developed various “hacks” that try and simulate the additional states. This code tends to look like “guesses” or “assumptions”. For example, “if not red than blue” or “if no records than user is still on step one”. I tend to see developers spending hours in that kind of code, trying to confirm that the assumption is still always the correct one to make, or trying to shoehorn in another state, and it’s just a horrible time-suck. Improving the model at this point generally pays off in time saved puzzling.
- shocks 4y agoMost of the time it’s better to adapt existing code than light a match and start again. For example, I’ve seen and participated in the transition of a completely undocumented custom web framework (with an entirely Redis based ORM) to an industry standard web framework with a MySQL backed ORM. All of this happened without any customers noticing, no feature development pause, no huge “rewrite” branch requiring regular rebasing, and without the original development team responsible for the mess. That was truly a work of art.