Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

why I like Pascal

Name: Anonymous 2007-01-25 0:59

Probably almost nobody here has first-hand experience with Pascal, unless they're Delphi coders. So I'll start with some history. Actually, more history than merits, because the history explains why the language is still worth a second look.

Pascal was made in 1970, and came into vogue at around the same time as C. It was invented by Niklaus Wirth, who had served on the ALGOL 68 committee and proposed then a language design, ALGOL W, that was simpler than the one ultimately standardized. ALGOL W's design developed a few years later into the original Pascal standard, which had a few compilers and intepreters in the 1970s.

By the early 1980s, Pascal had become reasonably well-known, but demands for new features led to a new version of the language, Object Pascal, which added, among other things, OOP support. However, this was an unofficial standard, and not as rigorously defined. The compiler standard that became most famous was Borland Turbo Pascal. It was very cheap for software at that time, $50. By the late 1980s, most individuals writing programs for the IBM PC(shareware and freeware developers, and small companies) used Turbo Pascal, because:

-It was cheap
-It was fast to compile(besides being a well-optimized implementation, Pascal code is easier to parse than C)
-It had good performance
-It wasn't as difficult as assembly, and it had libraries besides.

Schools had, by that time, long since popularized the idea of Pascal as a "learning language." Although Niklaus Wirth had not initially envisioned a learning language, but rather one that was easy to learn, one followed from the other.

So why did Pascal suddenly disappear in the 1990s, if it had so much going for it?

There are two answers. The first one is Unix. The second is Microsoft. Unix was built in tandem with C; C is therefore a very good language for the low-level systems work that Unix needed. Microsoft followed in this vein when they built Windows. As a result, libraries and APIs accumulated that were all built in C. Interoperability considerations made other languages less attractive.

C++ started to gain momentum in the 1990s, as well. Even though it's by most accounts an abomination unto mankind(with a 900+ page tome to define the language - not even the libraries), it maintained backwards compatability with C code. So C and C++ ended up taking over the language market by default with the support of two major operating systems. (Apple used Object Pascal for its systems in the 80s; then it switched to C++ in the 90s. Ever notice how unstable the later classic Macs were, compared with the old ones?)

Borland still makes Pascal products(their last big success being Delphi, which had both an IDE and a GUI designer), and several open-source compiler projects have come together, but as a whole the language recieves little attention beyond a few outdated jibes at deficiencies of its early incarnations. Few people know of or have investigated today's Pascals, even though prior history has shown strong preferences for the language in both academic and commercial situations.

So, having gotten that out of the way, I like Pascal because I find it easier than C, and certainly easier than C++. Easier to read and to debug; it doesn't rely as heavily on the usage of pointers, and the typing rules seem a little simpler to follow. It has a few "nifty benefits" like bounds-checked arrays, and the linking system doesn't use a seperate header file(you still have to, at a minimum, define prototypes for forward-referencing cases, but it's in the same file as the implementation).

In the "Programming Shootout" benchmark series, the Free Pascal compiler (short: FPC) scores near to C++, usually trading away higher speed for a lower memory consumption. FPC has a "smart linker" feature which optimizes binary size by stripping out any unused functions from eg. large libraries. These size-related features give FPC better startup times than anything else. C libraries are also usable with header wrapping, which an automated assistance tool, h2pas, exists for - sometimes it can even do a 100% correct job! (not to be expected, of course) And of course the compile times are still proportionately faster than those of C/C++ compilers.

Although I will admit that I wouldn't use Pascal in every situation(mainly because higher level = better in my book), I think it is one of the best options around for getting high performance and stability in a minimum of development time - which is what really matters.


Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List