News for hackers. Stuff that matters.
Re:Introduction to Ada by ardit33 on Thursday September 03, 2020 @12:23AM (#24360780)
It was my first language i learned in school... in Radford ( Virginia), before my university switched to Java. ADA was/is popular with defense contractors, so a lot of schools in VA teach it.

It is very safe language, being both static typed, and strong typed. It was originally a procedural language, but later they added some OO to it. (to folks that don't know what a imperative language is, think of a language where all methods are like Java Static methods, and you store data in some global space).

It can get a bit wordy to program with it, but I also like the lack of '{' bracket use everywhere that C like syntax has. With some modifications, ADA can be transformed into a great/fun language.

Anyway, due to its small echosystem and adoption, I think it will remain a 'defense/aeronautic industry' only type of language.

This is a simple program, and I think it is fairly elegant, but a bit wordy:

  with Ada.Text_IO; use Ada.Text_IO;
  with Ada.Integer_Text_IO; use Ada.Integer_Text_IO;

  procedure Check_Positive is
     N : Integer;
  begin
     Put ("Enter an integer value: ");  -- Put a String
     Get (N);  --  Read in an integer value
     if N > 0 then
        Put (N);  --  Put an Integer
        Put_Line (" is a positive number");
     end if;
  end Check_Positive;
Re:Introduction to Ada by Lucretia9 on Thursday September 03, 2020 @03:32AM (#24361634)
People need to stop using "wordy" when they mean "readable."
Re:Introduction to Ada by bluGill on Thursday September 03, 2020 @08:27AM (#24363311)
Readable is a matter of education. As a C++ programmer I've learned what {} means, and so that is more readable than begin/end which happens to not be the block symbol in any language I know well. Considering all the languages I know I've concluded that block symbols are important enough to be worth learning as a separate symbol (Looking at python where it is white space). Of course I can learn begin/end, but it isn't worth typing those extra letters of the word when something that common can be done in one.

Note too that {} graphically indicate the open/close in a way that begin/end is another reason not to like begin/end.

Re:Introduction to Ada by Lucretia9 on Thursday September 03, 2020 @02:29PM (#24367133)
I've done plenty of C and C++, so I know what {} means, it's just that braces are harder to see, especially when there's a lot of them.
Re:Introduction to Ada by nulldata on Thursday September 03, 2020 @03:51AM (#24361736)
That's not necessarily the same thing though. Verbosity can obscure the information you're trying to gather from the code you're reading. A "can't see the forest for the trees"-kind deal.
Re:Introduction to Ada by johnisgood on Thursday September 03, 2020 @04:33AM (#24361956)
I cannot see the source code for the documentation. This happens to me in so many cases. I work with a couple of codebases that have 90% documentation, 10% code. In Ada, code IS the documentation that also can be formally verified. It is wonderful.
Re:Introduction to Ada by NationalPark on Thursday September 03, 2020 @09:19AM (#24363741)
I think I've heard "the code is self-documenting" a hundred times in my career and it hasn't been true once.
Re:Introduction to Ada by Lucretia9 on Thursday September 03, 2020 @02:31PM (#24367162)
Yup, look at any driver in the Linux kernel.
Re:Introduction to Ada by tlear on Thursday September 03, 2020 @01:31AM (#24361022)
It looks similar to Pascal? I learned to program in Pascal as a kid always had a soft spot for it
Re:Introduction to Ada by linuxlizard on Thursday September 03, 2020 @10:02AM (#24364129)
Pascal is one of Ada's parents, definitely. I did Pascal then transitioned to Ada quite easily in university.
Re:Introduction to Ada by ojosilva on Thursday September 03, 2020 @04:31AM (#24361947)
Oh, double-hyphen for comments! So maybe that's where SQL got it's comment style from? I'm not sure which SQL spec defined it and what is its overall availability, but it's defined in DB2 and Oracle SQL languages so I'd say it predates the SQL-1992 standard. I think it's also available in MySQL SQL and pgSQL, with a required space between the dashes and the comment text.
Re:Introduction to Ada by mosteo on Thursday September 03, 2020 @06:07AM (#24362496)
Definitely, early PLSQL is inspired by Ada. See here: https://www.orafaq.com/wiki/Ada