News for hackers. Stuff that matters.
Re:Introduction to Ada by stolen_biscuit on Wednesday September 02, 2020 @11:52PM (#24360669)
Ada is one of those languages that I always wish I had a reason to program in
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
Re:Introduction to Ada by grawprog on Thursday September 03, 2020 @12:16AM (#24360754)
It's always had a strange super elite, if you use ada you must mean serious business kind of vibe to it.

I guess it's mostly the applications its used in, but the language itself has this strict rigidity to it.

It's like the marines or special forces of programming languages or something.

Re:Introduction to Ada by non-entity on Thursday September 03, 2020 @01:39AM (#24361067)
Outside the unpopular syntax, I've wondered if the goverment / DoD association has scared people away.
Re:Introduction to Ada by synack on Thursday September 03, 2020 @12:23AM (#24360781)
If you need an excuse, the Make With Ada competition is ongoing.

https://www.eejournal.com/industry_news/adacores-fifth-annua...

Re:Introduction to Ada by bitwize on Thursday September 03, 2020 @05:33AM (#24362308)
Ada is basically boomer Rust. You don't need a specific reason to use it -- just jump in! My first Ada programs were crappy reimplementations of Unix utilities, just to see how the language felt when doing common tasks.
Re:Introduction to Ada by pjmlp on Thursday September 03, 2020 @09:31AM (#24363838)
During the late 90's there was an effort of redoing a Linux userspace in Ada, unfortunately the effort died out without much progress.
Re:Introduction to Ada by non-entity on Thursday September 03, 2020 @01:12AM (#24360965)
Man there are so many of those languages for me. A lot of mainstream languages seem to mass-add features, but the two I'd like to see people look at are Ada's type system and Erlang-like native bitstring handling.
Re:Introduction to Ada by johnisgood on Thursday September 03, 2020 @04:34AM (#24361966)
And OTP!