Article View: comp.sys.ibm.pc.misc
Article #3396Re: Turbo Pascal vs. C
From: Dave Gillett
Date: Sun, 23 Sep 1990 21:07
Date: Sun, 23 Sep 1990 21:07
58 lines
3554 bytes
3554 bytes
In <5953@plains.NoDak.edu> bakke@plains.NoDak.edu (Jeffrey P. Bakke) writes:
>If your writing a Database program or Inventory
>Control, or something along those lines, Pascal is definitely easier to
>learn and to debug. On the other hand if you plan to be writing Hardware
>interfaced programs (Hard Drive, High Speed Video, Serial Port Control, etc)
>C would probably be a better choice. Although it is harder to learn and
>even harder still to become proficient at (many ways to do 1 thing) C is
>also infinitely more flexible and powerful when it comes to low-level
>applications.
Pure myth. (a) C and Turbo Pascal are of roughly equal power and flexibility,
and anything you can write in C could be written in Turbo Pascal. (b) Even if
their differences in this regard were significant, they'd still be far from
"infinite".
> If you need your programs to execute faster, C would also
>be the better choice. Good C code, with a good optimizing compiler is
>second only to assembly in execution speed (and infinitely easier to code).
Hmmm... Infinite again. Most of the things an experienced programmer does in
"good C code" to suggest optimizations to the compiler can also be done in
Turbo Pascal. It's true that the best C compilers do more optimization than
the best Pascal compilers, but Forth gives assembly a good run for its money
and so I doubt see is second.
>C is also more flexible as far as being able to allocate large quantities
>of memory and work with multiple memory models. Pascal is limited to
>64K maximum data allocations (unless you spend time with messy alternates)
>and it is hard to interface Pascal with other languages. C is easier
>to interface with other Object code.
Well, it's true that TP objects can only be up to 64K, (that's a TP
limitation and not inherent in Pascal as such); it effectively only runs in
"large" model. This is sufficient for the vast majority of programming tasks;
as with the comment above about "harder to master", multiple memory models
can be as much curse as blessing. ("messy alternates" indeed)
It's true that Turbo Pascal doesn't have built-in support for function
pointers. It also requires you to go to a bit of effort to convince the
compiler that your code will use the interface expected by the code you're
linking too. In C it's easier to link it, and *much* easier to get it
wrong.
>Anyway, you need to look at what your programming requirements are. You
>can't simply look at two languages and ask a generalized question about
>which is better. Supposedly, you should be able to write any necessary
>code or function in any language you choose but some languages may make it
>much harder to implement your requirements.
>Ok, in my opinion C is more flexible and powerful than Pascal, but Pascal
>is much more user-friendly and easier to use....
Now that I can agree with. C wouldn't be my first choice for most things,
but it's an acceptible second choice for almost everything.
Dave
Technical Details
Message-ID:
<410@saxony.pa.reuter.COM>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!saxony!dgilReferences:
<F*=-d162@cs.psu.edu> <1990Sep20.164153.28641@portia.Stanford.EDU> <5953@plains.NoDak.edu>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!saxony!dgil From: dgil@pa.reuter.COM (Dave Gillett) Newsgroups: comp.sys.ibm.pc.misc Subject: Re: Turbo Pascal vs. C Message-ID: <410@saxony.pa.reuter.COM> Date: 23 Sep 90 21:07:00 GMT References: <F*=-d162@cs.psu.edu> <1990Sep20.164153.28641@portia.Stanford.EDU> <5953@plains.NoDak.edu> Distribution: comp Organization: Reuter:file Inc (A Reuter Company) Palo Alto, CA Lines: 58