Live data from Hacker News

Giving Ada a Chance

ajxs.me

61–70 of 261 posts

Re: Giving Ada a Chance

#61
post #39

> I can’t help but think that complicated programming paradigms would seem more intuitive to beginners if taught through Ada instead of C and its derivative languages, as is common in computer science and engineering faculties worldwide. At my university, the first courses you took in CS used Ada. I think it was a really good choice but I was in the minority I guess because after my year they switched to either using…

> 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

[1] https://apps.dtic.mil/dtic/tr/fulltext/u2/a187106.pdf

Re: Giving Ada a Chance

#62
I really like Ada's ranged types (VHDL has them also - it inherited them from Ada). You can say:

    type OperatingTemp is range 33 .. 90;
And then declare variables of that type and they will be range checked - an exception will be thrown if the variable goes out of that range. Wish more languages had this feature.

Re: Giving Ada a Chance

#63
post #39

> I can’t help but think that complicated programming paradigms would seem more intuitive to beginners if taught through Ada instead of C and its derivative languages, as is common in computer science and engineering faculties worldwide. At my university, the first courses you took in CS used Ada. I think it was a really good choice but I was in the minority I guess because after my year they switched to either using…

> after my year they switched to either using Java or Python

They do this because of intense negative feedback from students who don't like having to learn languages for which there is no job market.

Re: Giving Ada a Chance

#64
post #55
post #3

This was a good read. I instantly recognized the title of the textbook that is mentioned in the blogpost? I own it! Having a background in C, I went back and forth with Ada for years, without really jumping all in. In the last couple years in particular, with the growing popularity of Rust, I started to renew my interest. I'm reminded of a popular reddit thread on r/Ada-- someone called Rust a "toy language", which p…

> I just wonder why Ada didn't get the credit it deserved as being absolutely bulletproof It's not. All languages make trade-offs in the performance-convenience-safety-etc space, and Ada's choice is not "100% safety". It lacks memory safety and has holes in its type system: https://www.enyo.de/fw/notes/ada-type-safety.html

I wouldn't say Ada lacks memory safety. It doesn't go for 100%-in-all-cases but neither does Rust. The main differences are that it doesn't do memory safety by default (which is significant), and also treats memory safety with less granularity.

Aside from simply making manual memory management less frequent (with things like variably sized arrays), it has memory pools and subpools to handle more large-scale memory safety issues. Essentially you can define the scope for all allocations of a type.

It's an interesting tradeoff, though unfortunately I haven't seen much discussion about it.

Re: Giving Ada a Chance

#65
post #39

> I can’t help but think that complicated programming paradigms would seem more intuitive to beginners if taught through Ada instead of C and its derivative languages, as is common in computer science and engineering faculties worldwide. At my university, the first courses you took in CS used Ada. I think it was a really good choice but I was in the minority I guess because after my year they switched to either using…

I help beginner python students. Python might be a nice easy scripting language for bashing out NUMPY scripts, but I'm beginning to suspect it is terrible for teaching. The "what type is this variable, and will this function automatically convert it for me" game is not very fun at all for beginners.

Re: Giving Ada a Chance

#66

I have so many languages on the "give it a chance" list that I don't know where to start.

If it helps make up your mind at all, I was much the same the way until I ended up trying Ada. After a night bashing my head against the compiler... well now every time I see a new language pop up I quickly check a few of the features I've become too attached to from Ada and usually* leave in disappointment.

You can decide for yourself if this is an endorsement or a warning. Or both.

*Exceptions obviously exist for very different niches or paradigms.

Re: Giving Ada a Chance

#67
post #39

> I can’t help but think that complicated programming paradigms would seem more intuitive to beginners if taught through Ada instead of C and its derivative languages, as is common in computer science and engineering faculties worldwide. At my university, the first courses you took in CS used Ada. I think it was a really good choice but I was in the minority I guess because after my year they switched to either using…

I am not sure if this is still the case today, but Computer Engineering in EE Department used to teach Pascal / Ada / C as the first programming language. With the expectation that making a program to compile correctly is hard. Before you move off to something like Perl / Java / Python.

While in CS they tends to start to Python or Java. And you start learning all the OO, Procedure or whatever paradigm before going into Web or other area of development with PHP. Where you get some results earlier.

I used to think EE way of teaching sucks. Old fashioned, not following the industry trend. Boring. Teaching you about OSI Models while CS students were already having some fun with the higher level Web Development.

Now I tend to think EE's way is far better.

Re: Giving Ada a Chance

#68

I really like Ada's ranged types (VHDL has them also - it inherited them from Ada). You can say: type OperatingTemp is range 33 .. 90; And then declare variables of that type and they will be range checked - an exception will be thrown if the variable goes out of that range. Wish more languages had this feature.

In JavaScript it is possible to define getter and setter method of an object. So this behaviour can be emulated by adding a validation in the setter method.

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...

In Java too, don’t know about other languages though...

Re: Giving Ada a Chance

#69

I really like Ada's ranged types (VHDL has them also - it inherited them from Ada). You can say: type OperatingTemp is range 33 .. 90; And then declare variables of that type and they will be range checked - an exception will be thrown if the variable goes out of that range. Wish more languages had this feature.

Ranged types are directly from Pascal. You can also use them to specify the valid indexes for an array (so a given array might be zero-based, or one-based, or 1900-based, or even -32768-based). A very positive feature, I agree.

Re: Giving Ada a Chance

#70
post #22

A nitpick, but why is Ada in all caps in the title? It isn't in the article, nor is the name an acronym.

Probably an autocorrect; the language is less commonly used than the Americans with disabilities act.

This drives me crazy: whenever I type 'emacs' on my iPad, I get 'emasculated' (and the iPad keeps insisting on it even when I try to correct the word).
Post reply on HN