Hacker News new | ask | show | jobs
by foobarian 62 days ago
Not JS but I like having explicit return var assignments because it's easier to break on and inspect. I don't know why tools don't make this easier.
1 comments

Ah, yes, I've had that problem. With some debuggers I can place a breakpoint after the return, but it won't tell me the value on the stack to return. I can look up the stack and hope at some point I'll be able to get a handle on it (assignment to a variable, passed in as an argument, etc) but sometimes I can't.

I probably won't adopt this as a convention, just because most of the time when I have access to a debugger I'll also have access to the source code and handle it myself. But I'm going to keep it in mind, and perhaps get fed up at some point and decide to adopt the idea. Thanks.