Ada, SPARK [Was: Re: tolf and detab (language succinctness)]

Bruno Medeiros brunodomedeiros+spam at com.gmail
Fri Oct 29 07:54:06 PDT 2010


On 06/10/2010 22:48, bearophile wrote:
> Bruno Medeiros:
>
>> [About ADA] That "begin" "end<name of block>" syntax is awful. I already think just "begin" "end" syntax is bad, but also having to repeat the name of block/function/procedure/loop at the "end", that's awful.<
>
> If you take a look at my dlibs1, probably more than 60_000 lines of D1 code, you may see that all closing braces of templates, functions, classes, and structs have a comment like:
>
> } // end FooBar!()
>
> Ada makes sure that comment at the end doesn't get out of sync with the true function mame :-)
>
> I agree it's not DRY, but when you aren't using a good IDE that comment helps you understand where you are in the code.
>

Well, I rarely use languages without good IDE's, so... :P

But still, even with IDEs aside, I see little use in that kind of 
information comment. But I try to keep my functions short, both in 
lines, and depth of nested blocks. And as for aggregate types, of those 
that have large amount of code, I prefer that there are only a few of 
them per source file. So this makes it rare that I'm not able to see the 
whole block in one page.


That dlibs1 of yours, is it publicly available somewhere? "Let me see 
your micro..."


> Ada is not designed to write Web applications, it's useful where you need very reliable software, high integrity systems. And in such situations it's very hard to beat it with other languages as C/C++/Java/C#. In such situations a language that helps you avoid bugs is better than a very handy language like Ruby. C language was not designed to write reliable systems, and it shows. D2 language distances itself from C, trying to be (useful to write code) more reliable than C, it uses some of the ideas of Ada (but D2 misses still a basic Ada feature important for highly reliable software systems: optional integral overflows, that in Ada are active on default).
>

I'm not an expert on high-reliability/critical systems, but I had the 
impression that the majority of it was written in C (even if with 
restricting code guidelines). Or that at least, much more critical 
software is written in C than in Ada. Is that not the case?


-- 
Bruno Medeiros - Software Engineer


More information about the Digitalmars-d mailing list