Path: utzoo!attcan!uunet!mcvax!ukc!mupsy!liv-cs!rkl From: rkl@mva.cs.liv.ac.uk Newsgroups: comp.sys.amiga Subject: More on disgusting Modula-2... Message-ID: <2113@mva.cs.liv.ac.uk> Date: 14 Sep 88 10:35:13 GMT References: <3417@crash.cts.com> Lines: 67 Organisation: Computer Science CSMVAX, Liverpool University 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 !"