Log in

View Full Version : The beauty of the Pascal language



Bijo
05-28-2007, 16:55
For those programmers around here.


I was thinking about the downfall of Pascal, and the mainstream activity of C (and C++). Obviously C and C++ have good support, libraries and so on, but if we purely look at the design of the language...

In the past I learnt Pascal, and later had a go at C, and then C++ (though there were many languages I had a play with at least). And now, after all these years that I finally reread stuff on Pascal, and compare the design, the syntax, with that of C++'s (or C's), I am amazed to see how, well... "ugly" C's is, if that's the proper word.

Pascal's syntax is so elegant, clear, and more natural than C-likes'. It is also more difficult to make mistakes in it than it is to in C-likes' languages. It looks more structured and generally more pleasant to the eye -- though it might be subjective -- and I bet even people who absolutely know NOTHING of programming can make sense out of it when they see sample code, especially due to it being more descriptive with words instead of cryptic and symbolic signs.

Then there was Delphi at some point. It went down. People now generally either use C, C++, C#, Java, or of course those even higher languages and such.

It's a shame Pascal got pushed away, as I think it's not only a good language for teaching, but programming in general. Not that I'm an expert, but surely Pascal can be used for many good a thing as well just as C (and later when Pascal got more developed it could be the dominant mainstream language today)?



What is it really? Was/Is C (and later C++) really more powerful than Pascal? Why did Delphi get pushed away -- better corporate backing? In those older days, was it some kind of masochistic or "cool" thing for programmers to use C and/or C++?

Looking at the game industry, would or could Pascal have been a good language today?

Looking at systems programming, would or could Pascal have been a good language today?

Was Pascal's low-level access less good compared to C's?

Are there any other things noteworthy about the comparison between Pascal and C, C++?

Husar
05-28-2007, 21:34
I don't know any of the Cs but like you, I liked the descriptive style of Pascal, to some degree, it's even easier to type, because there is no need to type special signs all the time. Currently we use Java at uni(had Pascal at school and that helped a lot when learning the basics of Java).

About the low-level access etc I don't know either since we never used such things until now.:shrug:

doc_bean
05-29-2007, 14:46
Pascal was the first language I learned, it's a very good starting point, but it misses the sheer flexibility and performance of C++.

Xiahou
05-30-2007, 10:27
Pascal was the first language I leaned, it's a very good starting point, but it misses the sheer flexibility and performance of C++.
I took Pascal in highschool- before that, I had very limited BASIC experience. Learning Pascal in HS was a good jumpstart on the 3 semesters of C++ that I took at college.

Of course, I don't use any of that anymore... My major was in DataComm/Networking. I think they just made us take programming to try to make us feel for you programmers. :laugh4:

TosaInu
05-30-2007, 10:57
My first encounter with programming language was Basic in highschool. If that wasn't 'educative' enough, we had to retype several lines of gibberish and behold something happens. Add PC's to that which had no HD to store the file, a nifty timed powerfailure and voila.

I learned nothing from it, except for an ill advised aversion of PC's.

I liked Pascal and appreciated C++ even more.

I don't know at all whether it would be possible, but I regret the re-invention of wheels, renaming, waste of resources, stress and confusion. That's evolution though, I doubt we can channel that.

DukeofSerbia
05-30-2007, 13:28
I learned in elementary school Basic.

In Gymnasium I learned Pascal. I liked him in the beginning [and I was very skilled], but later it became boring and learned just for tests. :whip:

Don Corleone
05-30-2007, 15:24
I'm not a software engineer, but I have some experience with Pascal and C from my university days. Now, if I need to code something up, I almost always use C.

Pascal is very structured, and you're right, it's harder to make mistakes, but it has such strong syntax. That's because it's a teaching language, based on C. C is a mid-level language... it stands somewhere between the pure abstraction of high-level languages such as Pascal and BASIC and the low-level languages (assembly code).

Pascal doesn't offer very much in the way of flexibility. Again, I'm an electronics guy, not a software guy, but AFAIK, you cannot define your own data structures in Pascal (or if you can, it's a rather tedious process).

Sure, Pascal is great in terms of how well defined everything is. But compare how many lines of code it takes you to write a function in Pascal. Then look at how many lines you can do the same function in C. No comparison.

Bijo
06-04-2007, 21:22
Pascal is very structured, and you're right, it's harder to make mistakes, but it has such strong syntax. That's because it's a teaching language, based on C. C is a mid-level language... it stands somewhere between the pure abstraction of high-level languages such as Pascal and BASIC and the low-level languages (assembly code).


Pascal based on C? I thought it was based on ALGOL, and that C came shortly after Pascal.