🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.modula2
Article #2550

Re: Report on defect in M2 vs C (Was Modula-2, Modula-3, C or C++)

#2550
From: Viet-Trung Luu
Date: Thu, 28 Sep 1995 03:12
72 lines
5122 bytes
On 26 Sep 1995, Paul A Vixie wrote:

> From this paragraph I will guess that you are imputing Modula-3's capabilities
> by remembering Modula-2's and then fudging a bit.  If you look at Modula-3's
> type system you will find it far more consistent than C's.  As for conciseness,
> well, "typedef int (*foo)(int, int)" may be concise but it's not what I'd call
> a model of clarity.  Modula-3's chief objective -- which it achieves nicely --
> is that code written in it (including arbitrarily complex data structures)
> tends to look like what it does/is.  (Not to mention that Modula-3 code that
> compiles will tend to work -- whereas C will compile many kinds of line noise
> and generate pseudorandom object code for you.)

Well, I can't admit that I know the Modula languages all too well, I 
still prefer C's syntax. That's not to say that C is perfect -- it's far 
from that. It's inconsistent in many places, and its operator precedence 
leaves *a lot* to be desired (note how C programmers use parentheses 
defensively...).

I don't know that Modula-3's code looks like what it's supposed to do 
anymore than C code does. What *I* like about C is that once you've 
learned the language, you can read/write/understand code quite quickly.

That said, some of C's "features" (?!?) must be at least partially 
eliminated in a more modern language. Pointer arithmetic is nice and 
elegant, but unfortunately does not lend itself to the detection of 
boundary (in arrays) violations or garbage collection. Of course, garbage 
collection is a *must* for any modern language (C++ fails badly in that 
regard).

I've found that the detection of errors (giving errors or warnings -- it 
doesn't really matter since I feel that good code should never result in 
warnings) varies from compiler to compiler. g++ gives uncomprehensible 
and unuseful errors or warnings, when it gives them at all. On the other 
hand, Borland C++ gave very useful warnings and errors. (One problem of 
C/C++ is that it makes detection of errors difficult, I admit.)

> The operative question is not yet "which language is better" but rather, "what
> attributes make a language better or worse than another?"  To professional
> programmers who work on huge projects as part of distributed teams full of non-
> wizards, a language that looks like what it does, has very strict compile-time
> rules, has some run-time rules and has explicit module interdependencies, will
> seem like a better language than one which gives programmers a lot of power and
> flexibility.  Garage band programmers will tend to prefer the power and flex.

I agree. However, I'm not convinced that Modula-3's syntax is best. 
Often, it's trivial things. E.g., why not an operator ++ for increments? 
Do all those BEGINs and ENDs really help in understanding code, or would 
{ and } suffice?

Undoubtedly, Modula-3 is a *better* language, especially for large 
projects. However, I think that you can make a language that's equally 
good with syntax that many programmers would prefer. Also, what about the 
limitations of Modula-3 (virtual -- i.e., late-bound -- methods only)?

Note: Some actually need power and flex. That's why C (or its variations) 
is the language of choice for systems programming. However, when building 
applications... such power (e.g., "I can point that pointer to 
anywhere!") is unnecessary and troublesome.

> The error which underlies the very existence of this debate is that there is
> some kind of perfect Platonic form of the computer language, which some real
> languages reflect more perfectly than others.  Plato was brilliant for his time
> but reality is not expressable in terms of arbitrary visions of perfection, and
> furthermore, one programmer's ideal is often another's hell.

I definitely agree with that! :-) However, what I'm saying is that it 
should be possible to have a good, robust language that does big projects 
well without being too verbose. Modula-3 isn't bad -- don't get me wrong. 
My criticism of Modula-3 is probably 50% personal preference (at least 
50%, rather). On the other hand, you could always go with Ada...

- Trung
Technical Details
Message-ID: <Pine.SUN.3.91.950927225244.5434B-100000@lagrange.uwaterloo.ca>
Path: arc1-ca.pugleaf.net!lagrange.uwaterloo.ca!vluu
References: <438nkr$bd@classic.eng.octel.com> <4395o4$3mv2@news-s01.ny.us.ibm.net> <DAGENAIS.95Sep22100113@gutrune.vlsi.polymtl.ca> <DFI1rr.LyC@undergrad.math.uwaterloo.ca> <Pine.SUN.3.91.950926031537.27808B-100000@napier.uwaterloo.ca> <VIXIE.95Sep26092506@wisdom.vix.com>

Show Full Headers
Complete Article Headers
Newsgroups: comp.lang.modula2,comp.lang.modula3,comp.lang.c,comp.lang.c++,comp.lang.ada
Path: arc1-ca.pugleaf.net!lagrange.uwaterloo.ca!vluu
From: Viet-Trung Luu <vluu@lagrange.uwaterloo.ca>
Subject: Re: Report on defect in M2 vs C (Was Modula-2, Modula-3, C or C++) 
Sender: news@undergrad.math.uwaterloo.ca (news spool owner)
Message-ID: <Pine.SUN.3.91.950927225244.5434B-100000@lagrange.uwaterloo.ca>
In-Reply-To: <VIXIE.95Sep26092506@wisdom.vix.com> 
Date: Thu, 28 Sep 1995 03:12:17 GMT
Content-Type: TEXT/PLAIN; charset=US-ASCII
References: <438nkr$bd@classic.eng.octel.com>
 <4395o4$3mv2@news-s01.ny.us.ibm.net>
 <DAGENAIS.95Sep22100113@gutrune.vlsi.polymtl.ca>
 <DFI1rr.LyC@undergrad.math.uwaterloo.ca>
 <Pine.SUN.3.91.950926031537.27808B-100000@napier.uwaterloo.ca> <VIXIE.95Sep26092506@wisdom.vix.com> 
Nntp-Posting-Host: lagrange.uwaterloo.ca
Mime-Version: 1.0
Organization: University of Waterloo