I like the "clean feel" of Ada's syntax: it combines the elegance of Python with a bit more structure and does not suffer from Python's significant whitespace issues. The so-called "Ada comb" structure that is used for packages, subprograms, and even declare blocks makes it easy to find what you are looking for because it makes the source code more regular. The "Ada comb" is formed by the shape of the source code wit…
Giving Ada a Chance
101–110 of 261 posts
Re: Giving Ada a Chance
#102Earlier quoted context omitted.
From my experience, it still gets a lot of use in aerospace and defence companies. Outside of those industries I can't think of people even mentioning it really, but again probably biases abound. Skimming my local jobs list(SE England) I see new listings from both Airbus and BAE Systems looking for Ada developers in the past week.
Yeah but I wonder how much of that is new development or code from the 80s-80s they’re wanting to port to C or C++
However, you'd be correct to say there are an awful lot of multi-decade projects in both the companies I mentioned(and the aerospace/defence in general). For example, last year my main project was work stemming from a design that began in 1997.
Re: Giving Ada a Chance
#103Earlier quoted context omitted.
I don't think it even needs to be a range, you can index using enums
Well, "range" was not the correct term. What I meant is that you can't treat the source as sparse. You can't skip portions of it. So you can't make an array that only covers every other element of this enumeration: type Colors is (Red, Green, Blue, Black, Gray, White); It has to be a consecutive group of them, taken in order, as the specification of even this enumeration has an ordering to it as far as Ada is concern…
Re: Giving Ada a Chance
#104Earlier quoted context omitted.
type TPerson = record name: string; age: integer; end; TThrteenPersons = array[10..22] of TPerson; procedure Check(const aPerson: TPerson); var vPerson: TThrteenPersons; begin vPerson[11] := aPerson; // this is ok vPerson[1] := aPerson; // this one gives compile error end; alternatively if runtime range checking is on then vPerson[i] = aPerson will raise the exception if i is out of range
Right. I know it works with numeric indexes in Pascal. My point was that (using my previous example) in Ada it works with any discrete type, in that case characters (which are not numbers in disguise in Ada) so I can do this: Histogram : Character_Histogram; ... Histogram['A'] := Histogram['A'] + 1; (Ok, a bit more work because I didn't initialize the histogram to 0.)
Re: Giving Ada a Chance
#105Earlier quoted context omitted.
I feel this. My CS program was in Java. After a few years in industry, I believe that CS should start with either C or Scheme. C to teach you about real machines, Scheme to ignore the machine and do math (algorithms).
I get what you're saying, but learning C teaches you about the C memory model instead of "real machines". C was designed for portability across different architectures and, believe it or not, was considered high-level and abstract at one time. But I agree that learning C is valuable because I believe that learning about manual memory management is valuable.
You need to do it in Ada too :-)!
Re: Giving Ada a Chance
#106> 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…
Re: Giving Ada a Chance
#107> 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…
When I went to school the instructor talked a bit about Ada, but as far as I know there weren't any compilers available that mere students could afford. This was in the mid-90s. I remember doing a bit of comparison of the syntax between languages, and Ada's lack of anything like a switch/case statement stood out, but the instructor did talk up the idea that if you could get it to compile it would run in Ada, assuming…
Re: Giving Ada a Chance
#108Earlier quoted context omitted.
I don't know when it was added, but Ada does have a switch/case equivalent construct and I can't imagine it wasn't available early on. case X is when 1 => ...; when 2 => ...; when 3 | 4 | 100 => ... when others => ... end case;
It was always part of the language, http://archive.adaic.com/standards/83lrm/html/lrm-05-04.html...
Re: Giving Ada a Chance
#109Earlier quoted context omitted.
I feel this. My CS program was in Java. After a few years in industry, I believe that CS should start with either C or Scheme. C to teach you about real machines, Scheme to ignore the machine and do math (algorithms).
I get what you're saying, but learning C teaches you about the C memory model instead of "real machines". C was designed for portability across different architectures and, believe it or not, was considered high-level and abstract at one time. But I agree that learning C is valuable because I believe that learning about manual memory management is valuable.
Re: Giving Ada a Chance
#110This 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