4 ms·
Fix your language implementation: a debugger should have access to a closure's captured state.
by wingo 17y ago
Fix your language implementation: a debugger should have access to a closure's captured state.
- tjic 17y agoI hate this sort of rebuttal. A: If you drive your car backwards you get better mileage. B: Well, I tried that, but my field of view is pretty crappy in the mirror, and the controls are non intuitive. A: Well, your shitty car design isn't my problem. Look, whenever you're trying to change someone's behavior, you are engage in marketing. This is an important skill in the startup world. If you told your customer "our solution is better" and he responds "your solution sets my house on fire", you DO NOT WIN POINTS by telling him that he should get a better house. You just lost the sale. Not only that, you made yourself look like an ass. If you want to sell closures, and the fact that pretty much all debuggers don't make using closures easy, this is not the rest of the world's problem - it is a legitimate reason for folks NOT TO USE CLOSURES. You either have to solve it, work around it, or realize that you're not going to sell the "use closures" meme.
- biotech 17y ago> Fix your language implementation.... This is a perfectly valid response if this was LTU or comp.compilers, but here on hacker news only a small percentage of us are actually in a position to "fix our language implementation". Know your audience! If you are talking to language users (not makers), this comment just... well, >> made yourself look like an ass.
- loup-vaillant 17y ago> If you are talking to language users (not makers)[…] In a sense, each time we write a function or an object, we are language makers. Too bad we don't considers ourselves as such, because makers actually bend the languages to their needs, rather than the other way around. Users limit themselves to a limited, defined, approved set of techniques (like function and object definitions). I think any programmer worth it's salt should try and consider himself a bit of a maker. Not to play the Sorcerer's Apprentice, but at the very least to have the idea to call an actual Sorcerer for help.
- brehaut 17y agoThat is a straw man argument with a splash of FUD. Point the first: You are making the implication (intentional or otherwise) that closures are backward and that objects are the correct way to structure a program. In any language I have used that has supported closures, they are not backwards. Indeed, the languages that support both closures and objects, closures are a well supported and idiomatic tool that is often used (for reference: C# 3+, Python, JavaScript, F#) Point the second: "...the fact that pretty much all debuggers don't make using closures easy...". Every language I have used that supports closures supports debugging closures with the exact same ease as any other function. If you can pause your program and introspect a function, you can also introspect a closure. If your are claiming that you can't introspect it from a repl, well you can't introspect any other function from the repl without additional debugging tools or instrumenting the code either.
- wingo 17y agoAnyone here who knows what a closure is can fix their language implementation. It is really not that complicated. I have no idea why you are talking about cars. It is totally irrelevant. Andy, GNU Guile maintainer. [Edit: downmods? I thought this was hacker news?]