πŸ’¬ Reply by yogthos

2024-11-20 πŸ”„ programmerhumor ┃ RE: eldavi

I’ve noticed that debugging tends to be more important in imperative languages than functional ones. With imperative style, you have a lot of implicit state that you need to know to figure out what actually happened. So, you end up having to go through the steps of building that state up before you can start figuring out what went wrong. On the other hand, the state is passed around explicitly with the functional paradigm, and you can typically figure out the problem by looking at the exact spot where the error occurred.
My typical debugging workflow with Clojure is to just read the stack trace, go to the last function in it, and then see what it’s doing wrong. Very rarely do I find the need to start digging deeper. I think another aspect of it is having an interactive development workflow. When you’re running code as you’re developing it, you see problems pop up as you go and you can fix them before you move to the next step. This way you don’t end up in situations where you wrote a whole bunch of code that you haven’t run, and now you’re not sure if it all works the way you expected.

yogthos

eldavi

πŸ”„ programmerhumor

πŸ’¬ Replies

2024-11-20 eldavi ┃ edited ┃ 1πŸ’¬

With imperative style, you have a lot of implicit state that you need to know to figure out what actually happened. So, you end up having to go through the steps of building that state up […]

────

View parent post

View first post in thread

View thread

────

πŸ“‘ Local feed

πŸ•οΈ Communities

πŸ”₯ Hashtags

πŸ”Ž Search posts

πŸ”‘ Sign in

πŸ“Š Status

πŸ›Ÿ Help