by alexpotato · 2y ago · 0 comments
The line was essentially a collection of:
restart instance_N &; restart instance_N+1&;
etcI always assumed that the way you got to 70+ was:
- write the first restart for instance N=1
- add another restart
- keep doing this till you get to about 5-8 restart commands
- AT THIS POINT someone should say "Hey, we should make this a script or something else" BUT CRUCIALLY that didn't happen
- you keep adding restarts till you get to 20+
- Now, doing anything to that giant line other than adding a new restart feels too dangerous so you decide to just keep adding restarts.
Moral of the story: the ball of mud usually doesn't just appear out of nowhere. It appears b/c there were multiple steps were someone didn't say "hey, maybe we should..." (or they said it and no one listened).
It was quite complete and very smart, with lots of OOP patterns and wrappers abound. But it was not only impossible to understand, it was almost impossible to debug too, because of the amount of indirection.
Big balls of mud often also appear because people actually say “hey maybe we should…” but but still manage to miss the mark.
As much as I would love to give some insightful comment here, I can’t. To paraphrase a post I saw here about Casey Muratori: sometimes the only advice you can give to someone is to “get good”. Putting in the 10000 hours and getting actual feedback rather than pretending that the bullshit you wrote is good because the previous one was understandable by a non-techie.
I've seen this SO MANY times too.
Nothing like having 8 files open to debug what turns out to be a one line change due to all of the object inheritance.