Topic: Pascal vs. C - PLEASE READ!


Author: michaelpe@aol.com (MichaelPE)
Date: 9 Mar 1995 20:51:46 -0500
Raw View
Pascal code does tend to be much smaller than C++.  This, for me, is one
of the greatest drawbacks of the language.  I've written a simple clock
program in BC++ that takes up about 500K.  I wrote the same functionality
into a Pascal program, and it took up less than 100K.  Perhaps I'm doing
something wrong, but I don't think it possible to easily make up for the
400K difference.

C++ is more powerful and versatile... to give one example, classes
(objects) can inherit the functionality of more than one parent class.
Class functions can also "befriend" other classes, so you can call one
function from within a different class.  What's more, C++ generally gives
the programmer more control over the things that Pascal tends to coddle
you from.

Development time is somewhat longer for C++, and compile-time is MUCH
longer.

Execution speed is rather slower in Pascal, so for most graphics
applications, I would prefer C++ over Pascal any day, especially for
animation.
(The better animation programs will make heavy use of assembler.)

I've written and made a good deal of money off of programs entirely in
Pascal, both for DOS and for Windows, so I would disagree strongly with
anyone who says it is for amateurs.  To this day, I still use Pascal for
applications that do not require me to delve deeply into the CPU.  And
when I need a quickie, such as a customized installation program or a
simple utility, Pascal is usually my first choice.

I think the bottom line is, if your program doesn't suffer from the slight
loss in control and the somewhat larger loss in speed that occurs with
Pascal, write in whatever language you're most comfortable in.  Like I
said, some programs just cry out for Pascal, and you're a fool if you
ignore that fact; however, the opposite is true.  If you ignore the fact
that some applications really need the power and speed of C++, then you're
just as guilty.

(C++ is C with the added availability of, among other things, classes.
Turbo Pascal and TP for Windows has the use of objects, which are in
essence the same thing).

Mike




Author: zen77@rain.org ()
Date: 8 Mar 1995 06:03:22 GMT
Raw View
                      *** C/C++ VS PASCAL ***

Salutations,

Before beginning the actual context of my message, allow me to
preface my message by saying it is my greatest hope to get
honest answers to my questions, instead of idiotic flames. While
I may be slightly biased in my choice of languages due to
conditioning (i've heard very few positive things about C in
general, not to mention a good deal of negatives) i'm coming
here with an open mind.

After all, had I wanted to here a lot of compliments on my
current decision, I could have just posted this in the Pascal
message base.

                                                                              (End of Intro)

A bit about my background -- in my own eyes, i've achieved what
you might call an "Intermediate, almost Advanced" understanding
of the Pascal language. The only thing that holds me from that
advanced status is my naivete of Asm (something i'm definitely
working on).

Some of my largest concerns are tight code size, the fastest
possible execution of the instructions, and versatility,
and speed in coding (<- this is one of the extremely negative
things i've heard so far, "You can code the same thing in Pascal
as may be coded in C in *half the time*" one unnamed source claimed.

Since most of you are C/C++ programmers, it'll be a pleasure to
hear YOUR side of the story.

Last, here are some of the things i've heard for you to respond to...

1). C code is easily converted to other languages, such as Unix.
    (This doesn't mean much as all the utilities/games/graphic
    routines i'll wish to create are in DOS).

2). There are tons of jobs out for C programmers, but hardly any for
    Pascal. (Also doesn't concerned me, as i'm not looking for a JOB,
    EG: under some boss, as a programmer).

3). C code is faster/closer to Asm then Pascal. (This DEFINITELY
    interests me. Please respond to this point!)

4). You have far more control with C. (Also interests me greatly.
    How? Please provide an example -- until now i've gotten only
    vague answers. Also, does C provide better control over Asm
    written in C vs. written inside pascal? Does it accept 386+
    instructions?)

5). Pascal creates far tighter code then C. (In my own experience,
    i've been able to create 79k programs which did as much as
    500k+ programs that had the same features/preformed the same
    task. Is there any way to get C coded .exes even CLOSE to the
    size of pascal?)

6). Does C provide better handling of (/ & faster?) graphics routines?

7). C is the language of the pros. Pascal is for hobbyists. (WHY???)

                                                                              (End of Pointers)

Many thanks in advance for any positive responses. Replies may be as
short or long as you feel like -- after all, the longer the message,
the more of what I need to know. Please mail:

                                                        Zen77@Rain.Org

I appreciate your time.

P.S. What are some of the major differences between C & C++. Also, any
suggestions on Asm books (Internet?) for beginners? Nothing from
MicroSoft PLEASE!