3 ms·
Now, I'm not familiar with Java, but I don't get what's supposed to be bad about a deep stack trace. Sure, in the old days, we had one giant function that did
by jakobegger 10y ago
Now, I'm not familiar with Java, but I don't get what's supposed to be bad about a deep stack trace.
Sure, in the old days, we had one giant function that did all the work, and we had a shallow stack.
But if your code is composed of simple methods that do just one thing, you'll end up with very deep stack traces.
Every modern framework has deep stack traces.
Yes, you need to invest some time in the beginning to understand how the different parts work together, but once you do, you'll see the beauty and clarity when all the abstractions are in the right places, and doing what you want requires just a handful of carefully sprinkled lines of business logic, with the framework doing much of the heavy lifting for you...
- Arelius 10y agoAre you implying that a long call stack is better than a long function? At least you don't have to have a debugger to read the long function.
- matthewmacleod 10y agoLong call stacks are better than long functions, yes. If a function runs on for more than a few lines, it feels like it rapidly becomes more difficult to reason about it. More mental overhead is required and more moving parts are in scope. Long stack traces might mean you have to read more whole debugging, but it also means there is less code to debug for a given failure - assuming modularity!