HACKER Q&A
📣 atmikemikeb

Why are there no scriptable JavaScript debuggers?


When I do js I wish I could conditionally stop at exceptions using something like gdb scripting.

Also general scripting for getting to specific points in a session without manually clicking through caught exceptions and breakpoints.

Why has no one done this for JavaScript? I can't find one that does.


  👤 austin-cheney Accepted Answer ✓
Just write cleaner code and there is less to debug. Ideally, you should output no console messaging until you are intentionally debugging something specific and no error messages unless you have a defect.

I understand developers now cannot put two words on a screen without 10mb of react boilerplate and otherwise have no idea how to manage state or sessions. God forbid developers do without the layers of insanity. When you peel back the nonsense state management is ridiculously simple. Session management is less simple, but just as simple to troubleshoot.

What helps me to keep things clean is having a universal rule erroring on use of console.log. If logging must be present, such as logging to the shell intentionally for the end user then push that into a deliberate logging utility.

Use WebSockets where you can because fixed sockets are inherently session oriented and substantially reduce overhead in session management on the server.