:: [DNG] Wordiness of code.
Góra strony
Delete this message
Reply to this message
Autor: Hendrik Boom
Data:  
Dla: dng
Stare tematy: Re: [DNG] Politics of IT in the U.S. government
Temat: [DNG] Wordiness of code.
On Fri, Aug 05, 2016 at 07:42:40AM +0200, Didier Kryn wrote:
> Le 05/08/2016 01:59, Hendrik Boom a écrit :
> >That's exactly why I like Modula 3. You use structured code where
> >that's good. You use objects and inheritance where that's good.
> >You use interaes and modules where that's good. And all those are
> >separate concepts that can be used independently. If you want an
> >object to be an opaque module, you make a module and put the objec in
> >it. And so forth. Except for its Pascal-like wordiness, it's great.
>
>     Wordiness is not bad. You write your program once and read it many
> times. A wordy language is easier to read than a cryptic one; instructions
> are more self explanatory and often relieve you from inserting tons of
> comments. No illusion: a wordy source will not produce a bigger binary.


There are limits, when the size of the keywords starts to make the
content harder to find. There's a reason common words in natural
languages are short. There's no real advantage in having a keyword
PROCEDURE (yes, all in caps) when PROC would do. There's no real
advantage at having to elaborately declare a short procedure that's
only passed as a parameter in one place instead of just usong an
inline lambda expression. There's no real advantage in having to use
BEGIN and END instead of { and }.

But its semantics is clean. It doesn't steal a bit from every machine
word for the convenience of the garbage collector.

It's one of the few languages that catches most of your errors at
compile time. But it's not overly restrictive. You can pun
integers and pointers if you really need to, but you have to
explicitly accept responsibility for the results by declaring your
module UNSAFE.

The others I've used in this class are Algol 68 and OCaml. But they
don't have the UNSAFE loophole.

OCaml, on the other hand, easily becomes *too* compact.

-- hendrik.