Hacker News new | ask | show | jobs
by tall 4427 days ago
I have been working in both clojure and javascript for a while. When I encounter bugs in javascript assuming it does not crash, it can become difficult to track down the source due to the lack of name-spacing, mutability of variables that allow for race conditions, and unintended changes upstream if you're not careful.

Where as in clojure, the scope of name spaces is generally smaller, while the errors are more cryptic, I agree. The line number that it points you to and use of the repl allows one to dissect the function in great detail and by checking the incoming data and outgoing data, the bug becomes much clear. At least in my experience.

2 comments

shrug Just different experiences I guess. I should note this isn't exactly an apples to apples comparison. I am using a lot of discipline in my JS project. I'm writing the code test-first most of the time, and I only have one global variable in the whole project.
Some JS frameworks lend to more difficult debugging.