C vs. Pascal - My opinion.

This is a subject a lot has been written about. You will no doubt find a lot of heated debates on the net once you start searching.

The question asked is: Which is better or more suited to a particular task ?

The answer ? There is no answer !

Both languages are in fact rather close and related to each other. Both languages are equaly suited to any application in principle.

I have often found myself translating C code into Pascal for my projects. Just recently for example I translated the sample C source for the Philips MIFARE contactless smartcard reader chip into Pascal for the Z380. The interesting part of this is just how closely the code structure translates. Sure, there are a couple of differences. One thing might have to be substituted with another on occasion. Point is: Both languages at the end of the day can do much the same.

Looking at the original C source code for the MIFARE chip - it is well documented but the code still looks messy. It requires mental gymnastics to follow. Nevermind having to wade through several header files. The translated result looks clean and is easy to read. Even with the comments removed one can easily see what the code does. This is a very compelling argument in Pascal's favour.

C has been hampered in its development by standards. Yes - standards are good - but they can stop development. This did not happen with Pascal. Well, yes there is a standard. The Pascal defined and developed by Borland. First as Turbo Pascal, then as Delphi. But it is different. If Borland sees a need to add something to the compiler - they simply do it.

Often you will find comparisons between Pascal and C. The Pascal being the initial standard set by Wirth. This is not a fair comparison and will make C look good. I personaly have never seen a Wirth Pascal compiler.

Bottom line is:

Choose the tool you are at ease with and it will serve you well. The C vs Pascal debate is a waste of time.

As a programmer who has grown up with C and Pascal I still do a lot of work in C (when I have too). My personal choice is Pascal. Source code is more readable and the compiler looks after my more silly mistakes. Of course, practically all my Embedded Pascal projects have some (or a lot) of assembler stuff so Embedded Pascal was written from the ground up to cooperate with assembler. Here it is even better than most C compilers.

One could go and discuss the relative merits of every language item. If you are really bored you could do that. In real life it simply does not matter much.

After having designed over 200 embedded systems such as scientific intrumentation, avionics, broadcast control and monitoring systems, revenue collection and ticketing systems, intercom systems and more stuff I can't even remember anymore, nevermind a healthy dose of PC based application development, I have come to the conclusion that a good compiler is a compiler that gets your software developed in as little time as possible provided the result is good (This last little item can make it tough for Basic !).

In all my 20 odd years working as developer and designer I have worked with many programmers and with many languages, even the oddball "Forth" (remember it ?). Pascal seems to get to the bottomline first. Every time !

Just my 2 cents worth....


Back to the Embedded Pascal Page