Link to home
Start Free TrialLog in
Avatar of lewis_loo
lewis_loo

asked on

diffent between Pascal and C++

What is the different between Pascal and C++?
Avatar of moin072898
moin072898

What is the different between different language?
ASKER CERTIFIED SOLUTION
Avatar of Motaz
Motaz

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
The most significant difference is that standard Pascal is not object-oriented.  That is, it has no features for creating and manipulating objects.  C++ programs on the other hand can be object oriented (although they do not have to be.)

Other than the object oriented differences and the fact that they have substancially different syntax's, the two languages are relatively similar, in that they have comprible features.   Thus most non-object oriented programs can be converted from one to the other by changing the syntax and doing a minimal amount of recoding.   This would not be true with substancially different languages, like basic, for example.
Not only is standard Pascal not OO, it doesn't even have any way to use more than one compilation unit! Try porting Pascal code from, say, Unix to Borland, to see the amount of compiler-specific extensions needed.

Pascal was designed as a language for teaching purposes, and for that it is very well suited. C, and later C++, was designed as a general purpose programming language. Therefore, it is more powerful and less restrictive. This is good if you know what you're doing - they don't try to "save you from yourself".

See "Why Pascal is Not My Favorite Programming Language" by one of the creators of C, Brian W. Kernighan, at http://www.sequel.net/~pj/htmls/whypascal.html .
Standart Pascal is not an OOP the same well as C is not an OOP. Turbo Pascal is an OOP same way as C++ is. C/C++ is a lot more powerful language than Pascal, but Pascal's easier to program. The syntax is a bit different, but that is not the biggest problem. As Yonat says C/C++ is created so it is less restricitve as long as you know what ya doin'... and Pascal is create so you don't mess things up. But if you don't know what ya doing in C/C++ you might mess things up as you've never had ;->

Cheers,
Viktor
Yonat I see that page ( Why pascal....) it was written in 1981 !! before Turbo pascal and Object pascal. There was potential change in pascal language during the years from 1981 until 1998. Pascal now is C competitor ( represented by Delphi !).

Motaz
There were no changes to *standard* Pascal since 1981. There are (and were back then) many vendor-specific extensions to Pascal. Borland (Inprise) extensions are in no way standard. In fact, they are VERY different then those of DEC, Intel, SCO, Apple and others.

C++, on the other hand, is standartized. And even before it was standartized, its implementatins were much more uniform than those of Pascal, not to mention Object Pascal.

If you're only going to use only *one* Pascal compiler, it is possible to compare its specific Pascal dialect with C and C++. Is that the case, lewis_loo? Which compiler is it?
Yonat, I think you don't use Turbo pascal at all in your life. You can do any thing with it. Moreover Pascal language is user friendly not like C.

By the way I don't hate C, Turbo C++ is the most strong language  I see before, I use it for 2 years and I like it very mush. But I brefere Turbo Pascal and Delphi.

Motaz

Motaz
I have used Turbo Pascal (later renamed to Borland Pacal, later renamed to Delphi), VAX Pascal, Apple's Object Pascal, SCO Pascal, and Intel Pascal. They're all different. Each has its strengths and weaknesses.

I like Delphi alot. However, comparing Pascal *in general* with C++, is not like comparing a specific development environment from a specific vendor.

>>>>> Pascal language is user friendly not like C <<<<<

True. For beginners, Pacal is easier than C, and definitely easier than C++. However, Python, VBScript and other languages are even easier. So, if the question is "which language should be the first to learn", I am not sure Pascal is the right answer.
Okay, I agree with all your opinions. :)

Motaz.
Okay, I agree with all your opinions. :)

Motaz.
Okay, I agree with all your opinions. :)

Motaz.