C vs Pascal

Recently, due to a job change, I became re-immersed in Pascal after a long absence. Prior to this I'd spent a long time in C, though of the two languages I'd actually learned Pascal first. (But after FORTRAN, which was the norm at the time in school. In fact, I didn't learn C until after college, and after I'd learned FORTH. Prior to college I'd first learned assembly language, followed by BASIC; FORTRAN, in college, was third.) In some ways Pascal was like coming home. But, in probably more ways, it was more like "What is this shit?" I do prefer C, and it's not imprinting, the 'baby duck syndrome'.

Oh, the Pascal I'm using now is a practical Pascal, not the original teaching language I first learned, which is deficient in many ways.

While there is a very fine wikipedia page comparing these two languages, this is my personal opinion of these two third-generation languages. I like third-generation languages. Because of my interest in performance and state, necessary for high scale and fault tolerant computing, their general lack of higher-level abstraction means that you can pretty much always tell what a program is doing, and how long and what resources it is going to need while doing it; the general flow of control is not hidden. (To me, high-abstraction languages are a lot like handing tasks off to graduate assistants. I may be thinking that he'll get right on it, whereas he might think that the waves are bitchin' gnarly right now, and he'll do my task maybe tomorrow. Sometime. Sure, to avoid this I can be very specific in my task assignments and specifications, but often it's easier to just do it myself than to fully specify all the necessary parameters. The same, I find, can be true of computer languages.)

I'm going to ignore both languages' Object modeling. (And thus C++ and its ilk.) Just the straight procedural languages, which is where I have always been, and in fact still am, working. (Use of object models can conflict with both high-scale and fault tolerance, making them more difficult or even impossible.)

I'm going to ignore most purely syntactic differences, such as ":=" and "!=" vs "=" and "<>", or whether types or names come first in declarations, and Pascal's terminating period. Po-tay-toe, po-tah-toe. I'm also going to ignore attributes of specific compiler/IDE products, such as convenience, speed, or quality of generated code. These can all change, and often are extremely important, but have nothing to do with the qualities of the language itself.

NB: Both C and Pascal have learned from each other over the years, and some of what once might have been clear advantages of one language over the other are no more, in any significant way. These languages are now more alike than different.

Advantage: C

Advantage: Pascal

Conclusion

C, no contest. (And this is not because I learned it first. As mentioned above, I learned Pascal first!)

There's a reason that C is the language in which most (if not all, now) newer languages are implemented, at least at first. Its data and control structures align very well to how almost all machines actually work at the low level, so C lives up to one description of it as a "high-level assembly language." With C you are very close to the machine, and can extract the ultimate in performance. Yes, it comes at a cost, but if you're mapping an abstraction to machine level, for whatever reason, that cost must be paid, by somebody. C allows you to get very close to the machine, if that's what you want, yet at the same time it allows you to easily construct very high levels of abstraction, all without hiding from you what's going on. The choices are up to you, and that freedom is C's ultimate strength.

Extra Credit

... if you noticed that C's advantage of a lack of sub-functions contradicts Pascal's advantage of a presence of sub-functions! It's the whole gift vs curse thing. Sometimes life is like that...

Return to Site Home