3 ms·
Interesting... Not knowing this background, I always assumed spaghetti code referred to the opposite in modern code: too many nested blocks. I'm always super a
by jszymborski 10y ago
Interesting... Not knowing this background, I always assumed spaghetti code referred to the opposite in modern code: too many nested blocks.
I'm always super afraid of growing mounds of logic, and my refactoring usually abstracts a lot of that logic out.
If you use a good IDE like IDEA/Jetbrains, you can ease the pain of those "one-line functions" with "click to navigate" function/variable names
- yoz-y 10y agoFor me spaghetti code is called so because when you start pulling on one string of the code you end up spilling everything. A 5-layered for/if statement does not have this property but using abstractions everywhere does.
- smonff 10y ago> For me spaghetti code is called so because when you start pulling on one string of the code you end up spilling everything. A 5-layered for/if statement does not have this property but using abstractions everywhere does. So in theory a well unit-tested spaghetti-code would make you more relaxed because it would assert that spaghetti A interacts with spaghetti B in the C way.
- yoz-y 10y ago> So in theory a well unit-tested spaghetti-code would make you more relaxed because it would assert that spaghetti A interacts with spaghetti B in the C way. I don't follow. In my experience well-unit-tested and spaghetti code are mutually exclusive as the spaghetti code does not have separation of concerns. A note on my opinion on abstractions to clarify: I do not think that abstraction is inherently bad, just that starting with the idea that every component has to be generic, each class must have an abstract interface and that code should never ever see into another classes implementation tends to force developers to make so much mental yoga that they end up tying the components together without realising it.