[comp.sys.amiga] More on disgusting Modula-2...

rkl@mva.cs.liv.ac.uk (09/14/88)

In article <3417@crash.cts.com>, haitex@pnet01.cts.com (Wade Bickel) writes:

>         What is wrong with using a simple function to concat your two
> strings ?

Well, if you have over 100 string concatenations in your program (as I often
do in my major Pascal programs), then I'd far rather use + than concat.

>  There are many string manipulation functions provided in Benchmark
> Modula-2, and it is easy enough to deal with these things without them anyway.

In standard Pascal, there's no such things as dynamic strings, let alone the
+ operator to concatenate two strings. In fact, you quickly grow to hate
standard Pascal because of this and you want to strangle Nicklaus Wirth.

>         The problem with using the "+" operator to concatenate strings is that
> it generates sloppy code, which is why it is not a part of modern languages.

Now this has to be ABSOLUTE TWADDLE ! What do you mean by 'sloppy code' ?
As far as the compiler is concerned, the + operator is no different to the
concat function when it comes to strings. I think it makes your Pascal source
code MORE READABLE if you use the + operator.
 
> It was one of many things included in PASCAL to make teaching programming
> easier, but has no place in professional code.

Again, a very dodgy argument. I'm sure there are plenty of commercial programs
in Pascal that have used extended features such as the + string operator
e.g. anything written in VAX Pascal, Turbo Pascal 4 or Mac Turbo Pascal.

>  What happens when you concatenate two strings and the destination is too
> short to hold the result?

Ho hum. There are, on decent Pascal compilers, options to enable/disable range
checking. Hence you can either :
1) Enable range checking. This will generate a run-time error when the string
   is too long.
2) Disable range checking. This will truncate the string to its maximum length
   allowed if it is too long.

> How much run-time code do you want to include to handle programmer sloppyness?

See above. Enabling range checking adds about 2K to the average program length.

>         Surely Niklaus Wirth would not have removed such things from the
> Modula-2 definition without good reason.

Yes - he wanted to annoy Pascal programmers who want to move to Modula-2.

>         PASCAL is especially unsuited to the Amiga

The reason it is unsuited to the Amiga is because Borland haven't done
Turbo Pascal on it yet ! You'll soon understand what I mean if you try to
use MetaComCo Pascal - yuck !

>         Maybe you should take a look at Amiga Basic.

Maybe you should get a spelling checker.

Richard K. Lloyd,       **** This is a MicroVAX II running VAX/VMS V4.7 ****
Computer Science Dept., * JANET     : RKL@UK.AC.LIV.CS.MVA or              *
Liverpool University,   *             RKL@000010500211.FTP.MAIL            *
Merseyside, England,    * Internet  : RKL%mva.cs.liv.ac.uk@cunyvm.cuny.edu *
Great Britain.          ****************************************************

"What's the world's fastest microcomputer ? A Mac II at 5000 pounds ?
A 25Mhz Compaq 386 at 5500 pounds ? No, it's an Archimedes at 800 pounds !"

peter@sugar.uu.net (Peter da Silva) (09/17/88)

In article <2113@mva.cs.liv.ac.uk>, rkl@mva.cs.liv.ac.uk writes:
> In article <3417@crash.cts.com>, haitex@pnet01.cts.com (Wade Bickel) writes:
> >         What is wrong with using a simple function to concat your two
> > strings ?

> Well, if you have over 100 string concatenations in your program (as I often
> do in my major Pascal programs), then I'd far rather use + than concat.

Me, I much prefer using sprintf(). It's got '+' and concat() beaten hollow.
Anyone have a good reason for Wirth making it impossible to write sprintf()
in Modula-2?

But back to the subject... 100 string concatenations in a large program (using
what, a few thousand lines of code) isn't much overhead. You're sounding like
the people who argue that 'C' is better than Pascal because '{}' is shorter
than 'begin..end' ('C' has many advantages over Pascal, and I *do* think this
is one of them, but it's not a major one).

I'd much rather be using Modula myself, if it had a few things added:

	Static initialisation of large constants.
	Variable argument lists.
	A standard I/O library that included a decent selection of
		printf() type functions.
	Ability to use standard object files and compilation techniques.
		(yes, I know this would weaken its function parameter
		 checking... but it'd still be stronger than 'C's, which
		 would be a win for me).
-- 
		Peter da Silva  `-_-'  peter@sugar.uu.net
		 Have you hugged  U  your wolf today?

pds@quintus.uucp (Peter Schachte) (09/20/88)

In article <2645@sugar.uu.net> peter@sugar.uu.net (Peter da Silva) writes:
>I'd much rather be using Modula myself, if it had a few things added:
>	Static initialisation of large constants.
>	Variable argument lists.
>	A standard I/O library that included a decent selection of functions.
>	Ability to use standard object files and compilation techniques.
Three more:
	Macros (real macros, like C++, not just a preprocessor)
	overloadable function names (like C++)
	More people using it (more PD code written in it, like C).

C++ actually looks pretty good.  It's hampered by backward
compatibility with C, but it has a lot to recommend it.  Sure would be
nice if someone ported G++ to the Amiga....
-Peter Schachte
pds@quintus.uucp
..!sun!quintus!pds