3 ms·
Very impressive work. I feel like these kind of helpful error messages will become the norm within 10 years, and people will look back at coredumps, C++ excepti
by rudolf0 11y ago
Very impressive work. I feel like these kind of helpful error messages will become the norm within 10 years, and people will look back at coredumps, C++ exceptions, and even Ruby/Python exceptions as confusing and archaic.
- vezzy-fnord 11y agoCore dumps are at a completely different layer, so they don't really belong in this comparison. Unless we phase out the traditional conception of an OS process in 10 years, which is extremely doubtful.
- rudolf0 11y agoThey are a different layer, but they're the only effective way of debugging most C programs.
- AnimalMuppet 11y agoHorse feathers. Running a debugger, logging, and printf are all much more effective than core dumps. A core dump may be the most effective way to debug a program that dumped core when crashing in a way that you can't reproduce, but that's because it's the only way to debug a program that dumped core when crashing in a way that you can't reproduce.
- rudolf0 11y agoDebugging a C application which has already crashed without debugging/logging is what I meant. Assuming you don't add any specific debugging or exception handling code, in dynamic languages you're guaranteed to get at least a vaguely helpful exception message, and you will get one (for varying definitions of "helpful") sometimes in C++, too, if it did not segfault. You do not get that in C by default. Sorry for the lack of clarity, my statement was incorrect as written.
- AnimalMuppet 11y agoIf you meant that and didn't state it perfectly, then I was too harsh. A mistaken idea may deserve a sharp reply; an incorrectly stated point does not.
- xamuel 11y agoIn dynamic languages you get an instant burst of maybe-helpful text. (Instant gratification) With C coredumps, you get a snapshot of the entire system at the moment it crashed. You can literally walk through everything that wasn't corrupted beyond reading. If the system is, for example, a multiplayer game, you can literally navigate the entire gameworld like a frozen snapshot. This can be very helpful for finding well-hidden bugs. We're professional developers. It is worth the tiny bit of learning curve in order to get more productivity out of our tools!
- burrows 11y agoTalking out of your ass.
- rudolf0 11y agoYou're right, my statement makes no sense given the way I wrote it. Sorry. I clarified in my other reply that I meant "out-of-the-box" debugging and error messages, like what Elm is providing here at compile time.
- arielb1 11y agoThese are compiler errors, not runtime errors. Reporting a traceback to the user is of course bad (through not as bad as some error messages).