4 ms·
Why do people seem to think Ada is painful? It's quite strict, but that's a blessing, not a curse. You end up making anything remotely dodgy but necessary very
by axman6 12y ago
Why do people seem to think Ada is painful? It's quite strict, but that's a blessing, not a curse. You end up making anything remotely dodgy but necessary very obvious, and in general well founded ideas are clear and concise. You can also define your program much more precisely and make sure that things never go wrong (You can't accidently treat an int and an enum)
- yaantc 12y ago> Why do people seem to think Ada is painful? I have a possible explanation on this. A lot of people only know Ada in passing, from classes. For someone fluent in another language typically derived from C, the syntax is very new and frustrating initially. People normally comfortable with coding in their preferred language become newbies again, making a lot of frustrating mistakes. And they hate Ada for it. I've seen several persons being forced into using Ada for a longer time. Geek types, including two long haired ones. They all hated it initially, but after a while they all come to appreciate and enjoy it. Two of them ended up contributing to GNAT. The cross-over time is roughly around 6 months of full time work with Ada, so more than what you get from a class. So I guess Ada is different enough to be frustrating at first, and most people don't use it long enough to come over the initial shock and appreciate the good sides of the language. They just hate it, and stay with the "Ada is bondage" meme. Too bad. For any one interested in large software system design and languages, I recommend looking at the "Rationale for the design of the Ada programming language" book. Even if you don't like the result ;) it's an interesting analysis of the challenge of doing large, safety critical system software IMHO. Just read the latest version, the intial one (though interesting) is now dated and made some wrong bets, like using synchronous tasks as the base for concurrency because there was hope that a formal model enabling proving behavior would develop around it, and that never happened.
- tankenmate 12y agoThe reason that a formal model didn't arrive is because it's impossible; the foundation of concurrency is the ability to change state and return the previous state atomically (even if it is only one bit/byte; xref cmpxchg). This necessarily makes the system non deterministic. So building a base for concurrency from synchronous tasks is impossible unless those synchronous tasks are atomic from start to end; most tasks are more than one op code long.
- pjmlp 12y agoThe C cowboy culture won over the Algol safety one.
- ArkyBeagle 12y agoI'd say it's closer to "The PC happened".
- pjmlp 12y agoNo. I never cared for C in the PC until forced to write code for those UNIX systems, starting with Xenix. Until then Turbo Pascal and Modula-2 served me pretty well.
- ArkyBeagle 12y agoThe small tribe I ran with then found Turbo Pascal wanting and there was some issue with Modula-2, like it was bytecode-interpreted. I don't regret learning 'C'. We had our own safety standards.
- pjmlp 12y agoModula-2, bytecoded?!? Where besides Lilith? C safety is a oxymoron, which is only enforcable with externals tools. I also don't regret learning C. It provided me a path to jump into C++ and use its features to close its C underpinnings into a dungeon, as much as possible.
- ArkyBeagle 12y agoI honestly don't actually recall whether the Modula-2 toolchain was interpreted. 'C' safety is anything but an oxymoron. i don't even consider it all that difficult. It's an absolute pain the neck, but nobody said this is easy :)
- 0x1C3B00DA 12y ago
- rwallace 12y agoMy 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?