4 ms·
I find declarative and functional (D/F) code is often difficult to debug. It's generally easier to break imperative code into fractal-like steps, sub-steps, sub
by tabtab 6y ago
I find declarative and functional (D/F) code is often difficult to debug. It's generally easier to break imperative code into fractal-like steps, sub-steps, sub-sub-steps etc. D/F just can't be dissected fractal-ish like that nearly as easy. It's just a magic property of imperative code that's hard to replicate in other paradigms. It's why imperative still dominates after 50+ years of D/F attempts.
Someone once said that D/F makes it easier to express what you intend, but imperative makes it easier to figure out what's actually happening. One improves writing, the other improves reading (or at least debugging).
- michaelmrose 6y agoOne can still break a larger function into smaller ones and use a debugger to see intermediate values.
- ssivark 6y agoOn the other hand, imperative code sometimes makes it very difficult to compare what is happening with what you want to happen (problem specification).