Giving Ada a Chance
111–120 of 261 posts
Re: Giving Ada a Chance
#112I love Ada, unfortunately it’s real world use seems to be relegated to old legacy code. I’d like to use it a little more on the side, but I also need to keep my priorities focused on realism, which sadly means ignoring Ada and learning something like C++ which seems unapproachable from any angle. Ada also seems to have a weirdly negative rep in many circles it seems. I recall looking around for an Ada compiler for a…
Oh, my github must be ancient then!
> Ada also seems to have a weirdly negative rep in many circles it seems. I recall looking around for an Ada compiler for a moderately popular platform and came across and old thread where people didn’t give any options but instead just joking about how the OP was interested in such a terrible language. Maybe it’s the Pascal/Algol type syntax?
That stems from the hatred from the people working at the DoD at the time who'd never even seen the language.
Re: Giving Ada a Chance
#113Earlier 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++
Re: Giving Ada a Chance
#114Re: Giving Ada a Chance
#115This is one of the best lines I've read in awhile, gave me a good chuckle. Thanks for that.
Re: Giving Ada a Chance
#116I tend to like Ada, but it is a tiring language to read with the all caps. Also, it 'feels' like it has a gatekeeper group and really doesn't come up in any mobile conversation. I still believe someone will do something akin to a syntax substitution and come up with a well liked language. Also, modern Fortran is not that bad of a language much like the modern parts of C++.
Re: Giving Ada a Chance
#117Earlier 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.
>C was designed for portability across different architectures Absolute bullshit. This is a claim that has been going on for far too long, the whole "portable assembler" myth. IEEE694-1985 is a portable assembler, hell read "Using a high level language as a cross assembler" ( DOI: 10.1145/954269.954277 ), for that matter.
>and, believe it or not, was considered high-level and abstract at one time. The "gotcha!"-factor was increasingly ignored when I was learning about computer languages, but I had an advantage in having my first language be Turbo Pascal and self-taught using the manual and compiler.
> But I agree that learning C is valuable because I believe that learning about manual memory management is valuable. That's doable much easier in Ada, Forth, or BLISS. C is becoming more and more of a liability, to the point I would say that it has no real value in any professional setting, and an incredibly limited one in the academic.
Re: Giving Ada a Chance
#118I 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 v…
Re: Giving Ada a Chance
#119I 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…
"Declare" blocks are a PITA. I don't mean the declaration part in the subprogram example you quoted (that's fine), but having to use explicit "declare" blocks to create new variables in the scope of a loop or a conditional. You can't just declare variables after the introducing keyword (then, loop, ...), possibly between it and a "begin" that would be fused to be come a part of the loop/conditional syntax. You have to use a separate "declare" block, with its "begin" and its own "end;", and then you still have to have the "end loop;"/"end if;" of the loop/conditional itself.
Illustration.
A normal conditional:
---------
if A = 5 then
B := 7;
C := A + 1;
end if;---------
What you'd think you could at least do (it would already be a bit heavy, but by Ada standard verbosity it would be a good and smooth fit):
---------
if A = 5 then
declare
D : natural;
begin B := 7;
D := 1;
C := A + D;
end if;---------
What you actually need to do:
---------
if A = 5 then
declare
D : natural;
begin
B := 7;
D := 1;
C := A + D;
end;
end if;---------
So you waste one indentation level more each time you add one such declare block. Talking about combs, this get hairy quickly even when you have simply a few nested loops/conditionals.
Also, the "end;" of the "declare" block is not an "end declare;" or "end block;" like you have "end if;" and "end loop;". So that make it a bit harder again to know where you are when you are closing your blocks/loops/conditional.
Then you can add a label, but that make it even heavier (and good luck finding a clever name for the block label each time). Not sure there exists a good solution to place the (opening) label. And the closing label comes at the same place a closing keyword, which may be considered a bit confusing.
---------
if A = 5 then
myblock:
declare
D : natural;
begin
B := 7;
D := 1;
C := A + D;
end myblock;
end if;---------
or
---------
if A = 5 then
myblock: declare
D : natural;
begin
B := 7;
D := 1;
C := A + D;
end myblock;
end if;---------
or
---------
if A = 5 then
myblock:
declare
D : natural;
begin
B := 7;
D := 1;
C := A + D;
end myblock;
end if;---------
The last one, which wastes not only 1, but 2 indentations levels(!), and even worse, creates an indentation gap in the end, happens to be the recommended style...
Re: Giving Ada a Chance
#120I 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.
I agree. I learned Ada in university (my professor was on the Ada committee) and used it for an embedded development course. The language was really good (many fewer foot guns than C or C++; clearly Ada was holistically designed), but I recall having issues with the tooling and the ecosystem, and the community was super defensive and hostile. If something wasn't working for your use case and the community didn't have…