comp.lang.ada
 help / color / mirror / Atom feed
From: Hadrien Grasland <hadrien.grasland@gmail.com>
Subject: Re: C# new features (v.7)
Date: Sat, 17 Dec 2016 03:36:39 -0800 (PST)
Date: 2016-12-17T03:36:39-08:00	[thread overview]
Message-ID: <e2312c20-f537-4a29-a526-e90b8987c75e@googlegroups.com> (raw)
In-Reply-To: <877f6y3lzo.fsf@nightsong.com>

Le samedi 17 décembre 2016 11:09:49 UTC+1, Paul Rubin a écrit :
> Luke A. Guest writes:
> > Yup. Need to get younger people excited but seems only a few of us
> > actually see this.
> 
> Younger programmers (those who didn't grow up dealing with old slow
> machines with little memory) generally use lower performance but more
> convenient languages rather than C, Ada, etc.  They're protected from
> integer overflow by bignums, memory errors by bounds checking,
> alloc/free errors by garbage collection, etc.  Lots of very good
> developers shipping successful products have never programmed in
> anything but Javascript or Python or Ruby.

When I try to "sell" Ada to people used other languages, the main benefit that I usually invoke is that in Ada, you can leave much more of the debugging work to your toolchain. That the language, by design, makes it harder to write erronerous code, and easier for a computer program to detect it, That argument is usually well received, as no one likes manual debugging, which is why there is a clear trend towards more automated static and dynamic analysis tools these days.

Javascript, Python and Ruby developers go through a lot of debugging pain because the interface of libraries written in this program is severely underspecified. For example, there is nothing in the actual code telling you or the compiler/interpreter that a function is designed to take strings as input, and will blow up somewhere deep in the implementation if passed an integer. The developer writing the function has no way to know what we will get as input, and the one calling the function has no way to know what it expects as output. It is all based on fragile conventions between developers, that are at best documented through code comments or external documentation, which will become out of date on the first refactoring. Every attempt in programming language history to handle type mismatches automatically without developer help, as in PHP and Javascript, has been an unmitigated disaster.

C++ templates have exactly the same problem, for exactly the same reason: the interface to them is implicit, not explicit, and most importantly the corresponding interface requirements are implementation-defined. No C++ compiler is able to produce a good template debugging error message simply because the required information to do so wasn't written in the code by the developer. The only point where a C++ compiler knows that template instantiation fails is where the implementation conflicts with the type parameter that was passed to the interface.

Everyone has a dream that one day, someone will devise a programming language that enforces the use of explicit, well-specified interface, that can be easily checked by compilers and analyzers in order to detect and report tons of developer errors automatically. It just so happens that today, Ada is the closest aproximation of this dream in existence.


  parent reply	other threads:[~2016-12-17 11:36 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-14 13:29 C# new features (v.7) gautier_niouzes
2016-12-14 16:59 ` Nasser M. Abbasi
2016-12-14 19:28   ` Shark8
2016-12-14 19:52   ` Wesley Pan
2016-12-14 23:01     ` Randy Brukardt
2016-12-16 10:03       ` Luke A. Guest
2016-12-16 20:19         ` Randy Brukardt
2016-12-15 14:19     ` Alejandro R. Mosteo
2016-12-16  8:34     ` Luke A. Guest
2016-12-17 10:09       ` Paul Rubin
2016-12-17 10:51         ` Hadrien Grasland
2016-12-17 11:36         ` Hadrien Grasland [this message]
2016-12-17 17:13         ` Nasser M. Abbasi
2016-12-17 17:52           ` Björn Lundin
2016-12-17 20:45           ` Dennis Lee Bieber
2016-12-17 21:56           ` Robert A Duff
2016-12-17 22:56             ` Simon Clubley
2017-02-05  0:37       ` Scott Loyd
2017-02-05  1:07         ` Luke A. Guest
2017-02-05 10:41         ` Lucretia
2017-02-05 16:12           ` Scott Loyd
2017-02-05 17:25             ` Lucretia
2016-12-16  7:49   ` Hadrien Grasland
2016-12-14 19:28 ` Shark8
2016-12-15  0:13   ` gautier_niouzes
2016-12-16  7:52     ` Hadrien Grasland
2016-12-16 10:08     ` Luke A. Guest
2016-12-16 13:04       ` Dennis Lee Bieber
2016-12-15 12:49   ` Alejandro R. Mosteo
2016-12-16  7:55     ` Hadrien Grasland
2016-12-16 12:43       ` Alejandro R. Mosteo
2016-12-16 20:14         ` Hadrien Grasland
2016-12-17  0:01           ` Alejandro R. Mosteo
2016-12-16  7:47 ` Hadrien Grasland
2017-01-31  1:29 ` brian catlin
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox