2 ms·
A loop is way easier to debug than a filter or a map, you just step through it. Why can't you just step through the function being called by map/filter? You se
by icebraining 13y ago
A loop is way easier to debug than a filter or a map, you just step through it.
Why can't you just step through the function being called by map/filter? You set a breakpoint on the function and examine the values when it is called.
- seanmcdirmid 13y agoSometimes you don't have a line to break on, sometimes the code that is actually mapping and filtering is very generic and used in lots of places, sometimes you simply lack out per context when the break occurs because of laziness. When control flow becomes more indirect, debugging becomes more difficult, and functional orgami is all about making control flow indirect to rather emphasize dataflow. Someday, someone might discover how to do good dataflow debuggers that could work well for time-intensive (read: stateful) programs, and in that case, I would be happy to indirect my control flow a lot more than I do. But no one has figured out how to really do that yet.
- loup-vaillant 13y agoHere is my guess: debuggers aren't the answer. We need to look somewhere else.