3 ms·
My experience with Ada was that it didn't actually make it any easier to make my code correct, because mixing up an int and an enum when you shouldn't is a triv
by rwallace 12y ago
My experience with Ada was that it didn't actually make it any easier to make my code correct, because mixing up an int and an enum when you shouldn't is a trivial problem that's easy to fix in C (never mind that the majority of enums are actually labels for ints); the errors that were hard to figure out and costly to fix were the conceptual ones that were independent of language. Ada just made everything clumsier, more verbose and less readable for no benefit. I suspect on a larger project it would start significantly detracting from correctness by discouraging refactoring.
- 0x1C3B00DA 12y agoJohn Carmack seems to think differently http://www.youtube.com/watch?v=00Q9-ftiPVQ#t=15m30s http://www.youtube.com/watch?v=00Q9-ftiPVQ#t=15m30s https://twitter.com/ID_AA_Carmack/status/342326443193282560 https://twitter.com/ID_AA_Carmack/status/342326443193282560
- rwallace 12y agoAnd yet when it came down to it, he chose to write all his code in C or C++. Actions speak louder than words.
- axman6 12y agoFrom memory, he made those comments after he'd been working for a long time in C/C++. He's since seen that language like Haskell and Ada which enforce much stricter requirements have a huge benefit to developers; the inital extra work to learn the language pays off when you get used to spotting even more bugs before you write them because you've been punched in the head by the error messages in the past. You begin to think about code not just from a "how doI get this done?" standpoint, but a "how do I get this done properly, safely and clearly, and make sure the compiler will catch me WHEN I make mistakes". Fixing bugs at development time is vastly less expensive than in testing or after release, so the extra errots can easily be justified.
- renox 12y agoOK, so how do you explain all these vulnerabilities caused by buffer overflow which happen in C but which would be much harder to produce in Ada?
- rwallace 12y agoThe sharpest edge of that language meeting bad design and sloppy or inadequate code review. Bad design is a problem in any language, safety critical projects need and typically have much better code review that would have caught the likes of Heartbleed, and every language has its particular sharp edges, e.g. the first launch of Ariane 5 would have successfully reached orbit had the code been written in C. (Yes, it would also have successfully reached orbit had that part of the code been adequately checked - see my above point about code reviews.)
- renox 12y agoOr more realistically, your experience is on small projects, with only you coding so it is worthless, try opening a large C codebase and fixing all its flaws: good luck. Ada and its better strict typing is a pain for small projects which is why students don't like it but it really shines on large project (no, it doesn't fix all the issue but it helps). IMHO what should be done is to take Ada's semantic/strictness and wrap it around a less verbose syntax (1) because if the beginners hate the syntax then the language, no matter how good it is will NEVER take off (and even if it starts taking off it will fall down quickly: see Lisp). 1: yes, I know this was done on purpose but the lack of adoption of Ada EVEN AFTER there was free compilers available show that (IMHO) it was a mistake.
- 0x1C3B00DA 12y agoAs far as I see the Ada Doom project is able to do more in less lines of code despite it being verbose (see https://github.com/AdaDoom3/AdaDoom3/blob/master/FOSDEM%20Presentation.pdf https://github.com/AdaDoom3/AdaDoom3/blob/master/FOSDEM%20Pr...). For readability, clearly your argument is subjective. Its like saying English doesn't make any sense because it is nothing like Chinese which everyone knows