3 ms·
> People found it frustrating how much work it'd take to get their programs to even compile Makes sense if they're students working on small projects. Ada is e
by MaxBarraclough 6y ago
> People found it frustrating how much work it'd take to get their programs to even compile
Makes sense if they're students working on small projects. Ada is explicitly designed to make large programs readable, and willingly trades off on writeability when the two come into conflict. It isn't going to shine if you're writing small 'single shot' applications, that isn't what Ada is for.
(Ada also commits to using many English language words where languages like C use symbols. SQL does this too. I'm not sold on the idea that this improves readability. Of course, there's far more to Ada than the skin-deep matter of its wordy syntax.)
This is similar to the readability/writeability tradeoff of moving from JavaScript (more writeable) to TypeScript (more readable and more refactorable). See the current discussion thread at [0].
Interesting reading (for some of us at least): the original Ada design rationale document, from 1986 [1].
[0] https://news.ycombinator.com/item?id=26314756 https://news.ycombinator.com/item?id=26314756
[1] https://apps.dtic.mil/dtic/tr/fulltext/u2/a187106.pdf https://apps.dtic.mil/dtic/tr/fulltext/u2/a187106.pdf
- Blikkentrekker 6y ago> (Ada also commits to using many English language words where languages like C use symbols. SQL does this too. I'm not sold on the idea that this improves readability. Of course, there's far more to Ada than the skin-deep matter of its wordy syntax.) Wasn't the hypothesis behind COBOL that this would allow managers to gain a certain level of understanding of the code? I find that it made COBOL code notoriously unreadable.
- andi999 6y agoC is actually middle ground, if you consider APL.
- rsj_hn 6y agoI really think a semantic facelift would do wonders for ADA, and shouldn't make much of a difference for readability. I know a lot of people are turned off by this.
- KMag 6y ago> I really think a semantic facelift would I think you mean a syntactic facelift, without changing semantics. You mean making the syntax look more like TypeScript, Kotlin, or something, right?
- rsj_hn 6y agoYes! Thanks for the correction!
- MaxBarraclough 6y agoI suspect overhauling the syntax is the kind of change that the committee would see as rather dramatic and with limited payoff. Introducing an optional alternative syntax alongside the existing one, would likely be seen as opening the door to syntactic inconsistencies, more likely to harm readability than to enhance it. The Python community has a relevant saying: There should be one -- and preferably only one -- obvious way to do it. [0] I don't think it's a serious problem that Ada uses and then rather than &&, and uses or else rather than ||. It's the kind of thing you can get used to with time. [0] https://www.python.org/dev/peps/pep-0020/ https://www.python.org/dev/peps/pep-0020/
- Lucretia9 6y agoand then and or then are shortcut operations, not the same as && and ||, those are and and or.
- MaxBarraclough 6y agoIn C and C++, the && and || operators both short-circuit. For eager semantics in C/C++ you could make do with the bitwise operators & and |, keeping in mind that they're bitwise and not logical. You could do something like (!!first_int) | (!!second_int). You'd be better off forcing eager evaluation by saving the results to local variables, and then use the short-circuit logical operators. Ada's and and or operators have no direct equivalents in C or C++. https://en.wikipedia.org/wiki/Short-circuit_evaluation#Support_in_common_programming_and_scripting_languages https://en.wikipedia.org/wiki/Short-circuit_evaluation#Suppo...