[comp.lang.misc] Modern languages? Modula-2 vs. C

rwl@uvacs.CS.VIRGINIA.EDU (Ray Lubinsky) (05/22/88)

In article <2096@ur-tut.UUCP>, pmjc@ur-tut (Pam Arnold) writes:
> For many situations, Modula-2 is NOT an improvement over C. I am not
> claiming that it is an all-in-all 'better' language. It does, however,
> require the programmer to use the language 'as is', whereas the C
> preprocessor allows - some might say encourages - the programmer to
> virtually remake the language. The original point I was responding to
> had to do with the difficulties in creating and enforcing style rules
> in C environments; the relative merits of C *AS A LANGUAGE* are not
> at issue here.
> 
> One advantage I will claim for Modula-2 (and for Pascal as well): I haven't
> seen any other languages in which algorithms may be expressed with such
> clarity - a terrific plus where maintenance is concerned.

I guess I should have been more clear (though at this point I'm loathe to
defend any 3GL).  The Modula-2 code I've seen does NOT make programs any more
readable to my eyes (e.g., the visual noise of upper case keywords).  And one
is certainly free to have an irregular indentation style, unmeaningful
identifier names, illogical use of import/export, etc. just like in C.

The C preprocessor can be abused, this is true.  But in the hands of a skilled
programmer it can be used to simplify sections of code by replacing a long
expression with a something more mnemonic without the cost of a function call.
A more cleanly-laid-out easier-to-read program can result with careful use of
the preprocessor.

Re: the clarity of Modula-2/Pascal vs. C (or many other languages) -- it seems
to me that the clarity of a piece of code is bounded by one's familiarity with
the notation of a language.  Modula-2 might be easier to understand by a novice
(I too was Pascal born and bred), but once one understands C syntax then one
can perceive the algorithm being implemented.  Of course, in either language
it doesn't take too many uncommented lines before you've pretty much lost any
reader's attention.

I guess what I'm saying is that we can do nothing BUT compare Modula-2 and C
"as a language" because they are equivalent in their ability to support coding
standards or software engineering or what-have-you.  I would just say that our
tastes run differently.  If I should really make a bigger concession to
Modula-2, I'd like to know why that's all.

-- 
| Ray Lubinsky,                    UUCP:      ...!uunet!virginia!uvacs!rwl    |
| Department of                    BITNET:    rwl8y@virginia                  |
| Computer Science,                CSNET:     rwl@cs.virginia.edu  -OR-       |
| University of Virginia                      rwl%uvacs@uvaarpa.virginia.edu  |