3 ms·
I don't see how any language that depends on manual handing of error return codes can ever be considered "reliable". It's far, far too easy to leak memory and o
by cageface 15y ago
I don't see how any language that depends on manual handing of error return codes can ever be considered "reliable". It's far, far too easy to leak memory and other resources. As other posters have noted, the only reason a lot of popular C programs are reliable is that they've been groomed with a fine-toothed comb.
The only low-level language that has any innate claim to reliability is C++ with proper use of the RAII idiom.
- eru 15y ago> The only low-level language that has any innate claim to reliability is C++ with proper use of the RAII idiom. Or rather a very carefully chosen subset of C++. See http://yosefk.com/c++fqa/exceptions.html#fqa-17.3 http://yosefk.com/c++fqa/exceptions.html#fqa-17.3 for some of the problems. By the way, what about ADA?
- tomjen3 15y agoAda is typically less well known and not used a lot, but if you want reliable code, it is pretty nice. Be aware that it is a b&d language.
- eru 15y agoI usually use Haskell at work, which is even more b&d in a sense and it's pretty reliable. But you can not call Haskell low-level.
- deleted 15y ago[deleted]
- absconditus 15y agoPL/SQL is similar to Ada in many ways.
- cageface 15y agoI have to admit a total ignorance of ADA. In domains where it's appropriate it may be a good choice. It's certainly a niche language compared to C/C++ though. I think some of Yosef's advice on C++ is out of date WRT to the C++11 standard too. shared_ptr is now the recommended smart pointer, for instance.
- marshray 15y agoIt's like finding an old circus tightrope walker who has performed for 30 years without a net and saying: My goodness look at that, how can those tightropes be so reliable?
- Roboprog 15y agoFirst, you have to decide if you are building a batch program, or an interactive program. Then, you make your own I/O and memory wrappers with an appropriate error handling strategy: exit(), or longjmp(), etc. In addition, for a batch process, you might have isolated blocks of logic that use setjmp/longjmp to log and skip over blocks of crappy input. The point is that, as mentioned elsewhere, C is "build your own system" level -- VERY LOW (level). The overhead of wrapping primitives with strategies for your app is minimal, once you know it's an issue.