3 ms·
There's no such thing as a language with no exceptions. There are only languages where exceptions need to be hand-rolled in an ad-hoc fashion. This ad-hoc app
by otabdeveloper2 8y ago
There's no such thing as a language with no exceptions.
There are only languages where exceptions need to be hand-rolled in an ad-hoc fashion.
This ad-hoc approach does not work. It gives you tiny benefit of not needing to learn a language feature. Meanwhile, ad-hoc exceptions mean that you lose all sense of modularity in your program. Real programs are composed of dozens of modules at various levels of abstraction, communicating together over multiple processes and threads. Ad-hoc exceptions in a real program in practice means 'just crash the whole thing, yolo'.
That does not work for serious programs.
- speedplane 8y ago> There are only languages where exceptions need to be hand-rolled in an ad-hoc fashion. This ad-hoc approach does not work. C has no exceptions. It seems to be quite successful.
- jcelerier 8y agoWell no, every time you have a chain of functions in your call stack that all do if(f(blah) != E_OK) { return E_WHATEVER; } (which is veeeery common in C) you are reimplementing exceptions by hand (and with less performance in the no-error case since you still pay for the branches, while a C++ code with exceptions would just be a sequence of function calls without branches in that case)
- speedplane 8y agoI wouldn't disagree with you. The OP said that programming languages w/o exceptions aren't successful. C doesn't use exceptions, it has it's own way of dealing with similar issues, and yet it's quite successful.