Brought to you by the writeup-sometimes-does-mean-reply foundation.
The original teaching language called Pascal may suck bigtime for real-world programming, but I don't think that it is in use for that any more. You are more likely to come across a language that is called Pascal, but is actually an extended version or child language of Pascal, such as Object Pascal, Delphi or Kylix. And most likely you'll agree that it doesn't suck.
The Pascal programming language specification was formed in the days before the 1990s, when a complete class and function library was not yet so important to a new language's success. In some cases, function names chosen in the late 1960s or early 1970s are overly general by today's standards, for instance Copy for string slicing or Open to open a file handle. These are usually kept for backward compatibility, and superseded by more descriptively named functions such as StrMid or FileOpen. In most cases, functions are more intuitively named than their C counterparts.
Copy
Open
StrMid
FileOpen
The layout and maximum length of a string is not cast in stone either. Ever since the move to 32-bit operating systems (i.e. the mid 1990s), Delphi as a modern Pascal has had strings with a 4-byte length indicator, i.e. up to 2Gb in string length. Pascal strings are easier to work with in almost every respect than the counterpart in C of manually-managed pointers to character arrays
ssd's reasons, which draw heavily on Kernighan's Why Pascal is Not my Favorite Programming Language (see the writeups there) are also not relevant anymore. See also when to use a semicolon in Pascal.
As for SSD's list of issues, Delphi addresses numbers 1 partly through optional and array parameters, and 2, 3, 5 (via a hard typecast), 8, 9, 10, 11, and 12. The ones that look to me like differences to how a programmer who understands only C might narrowly view the world, but are not problems in Pascal, are 3 (the type aliases part), 4, 6, 7.
No, pascal has much more serious problems. As others have noted, Borland's Turbo Pascal fixed a lot of problems with pascal. Most of these complaints are more relevant to UCSD pascal and BSD pascal. Let me repeat myself, since Strawberry Frog didn't read the previous comment the first time. These complaints refer to the original pascal made available by UCSD, BSD, and others. Even late versions of Turbo Pascal, prior to Delphi fixed some of these, and no, Delphi is Delphi, NOT pascal. It's a different language. That's like saying that complaints about C are wrong because C++ fixes them. No. As to moving this to the the node on Kernighan's paper, that would be wrong too, as this is NOT a summary of his complaints, but my own list, in my own priority order, with a few of his (that I agree with) added.
Here's the flaws I remember and some fragments from Brian Kernighan's paper Why Pascal is Not my Favorite Programming Language which is well worth reading, and better organized than this rant.
The strongest measure of a language is, of course, can you write a compiler for it in itself. I think it is telling that most pascal compilers are written in C.
Kernighan's biggest complaint about pascal is that there is no way to extend it--including separately compilable or externally linkable object code. His next biggest complaint is that all attempts to fix these problems were non-standard and therefore unportable. Delphi fits into this latter catagory. As to Turbo Pascal fixing most of these, last I checked, it hadn't, and if it fixes any of 1, 3, 4, 7, 8, 10, or 12 above, it has mangled it beyond it being pascal (which would be a good thing admittedly).
printable version chaos
Everything2 Help