Pascal (thing)

"Wirth made a language acclaimed in theory, but useless in practice. He appropriately named it after the guy who came up with "Pascal's Wager". --anonymous

Note that the following refers to the original Pascal language. Several Pascal derivatives have arisen that are much more complex, and actually have compelling language features beyond what C++ offers. I have not used these; See delphi, or strawberryfrog's excellent writeups on Object Pascal.

Pascal is basically C, except everywhere C has a symbol, Pascal has a word. Also, strings are a built-in type. That's about it. The two languages are so similar that you can literally translate mechanically between them. I mean, I'm sure that somewhere, somehow, there's a couple of things that Pascal does for you that are nice, but from what i've seen i seriously doubt they could be worth the extra typing of the unbelievably wordy syntax. And personally i suspect that the things it does for you are going to turn out to be the kinds of things that are really much more convenient as optional, replaceable libraries (or packages or whatever) added as add-ons written within the context of the language, rather than things hard-wired into the language itself.

I do not know Pascal, but i have had to deal with Pascal a decent amount, since i am a mac os programmer and all of apple's documentation gives all sample code in Pascal. While this sounds odd at first, it's actually pretty reasonable-- Pascal is very, very readable.

Giving sample code in C seems like a good idea, but think about it; not everyone is going to know C, not everyone using apple's API will be doing so in C, not everyone is going to look at and understand C. But pascal, you don't need to know it; because it's mostly just english, you can understand everything the code does just by looking at it, even if you've never used the language before. Giving sample code in a pseudocode-like language is a pretty logical thing to do if you're trying to demonstrate something which exists independently of any one language, and Pascal was at one time often the language chosen for that purpose. (These days people doing that sometimes tend to use python instead).

While i probably should not be commenting on something i haven't used, out of what i've seen of Pascal, i have not seen a single reason to desire using the language for any reason. Pascal seems to me to be nothing more seriously than exactly the thing it was designed to be: A teaching language.

"pascal" is, by the way, a reserved word in C. A function can be declared as a pascal function (pascal void something() {}) and it will act when compiled in a way consistent with Pascal functions. I'm not totally certain what exactly this does, and cannot locate any documentation on it. Being declared Pascal has certain implications in terms of the internal structure of the compiled function, and in terms of how the variables being passed to the function are treated. There was a time when you often saw functions declared as pascal in things like libraries-- not every programming language can call C functions within a library, but quite a few more can call pascal functions within a library.

StrawberryFrog: Thank you.I was not attempting to say that "everywhere c has a symbol, pascal has a word" is an inherently bad thing; only that it is true, and that i for one prefer otherwise.
I think you're probably right about the pascal keyword, however keep in mind that it can also be used to link _out_ as well as in-- i.e. to pascal and pascal-linkable languages.