[comp.sys.mac.programmer] Pascal vs. C

David Mayer <MAYER-A@RICEVM1.BITNET> (05/09/90)

Hi gang!

I'm new to Netnews, so I hope this hasn't been discussed
previously.

I'm a psychologist, not a programmer.  But I have done a good
bit of programming, and would like to learn to program
Macintosh applications.  I know a little Pascal and no C, but
I suspect that I should learn one of these languages.

I usually need custom applications which can present graphical
stimuli (hopefully originally composed in a separate graphics
package I already know), record subjects' inputs and make
reaction time measurements.  The graphics I need don't have to
be Rodger Rabbit-perfect animations, but I do need to vary
certain aspects dynamically.  (I'm going to try to simulate
some control panel displays and gauges).  And the reaction
time measures must be reliable.

Are there any suggestions regarding which language(s) I should
learn.  Or any good books I ought to read?  I can't find any
information regarding the relative strengths and weaknesses of
these two languages?  Does this mean I'm asking the wrong
questions??

I would appreciate any ideas or suggestions.  Thanks,

     David Mayer         Psychology Department
     Grad Student Slug         Rice University
     -----------------------------------------
     MAYER-A@RICEVM1                    BITNET
     MAYER-A@RICEVM1.RICE.EDU         InterNet

marc@Apple.COM (Mark Dawson) (05/09/90)

In article <1690MAYER-A@RICEVM1> MAYER-A@RICEVM1.BITNET (David Mayer) writes:
>Hi gang!
>
>I'm new to Netnews, so I hope this hasn't been discussed
>previously.
>
>I'm a psychologist, not a programmer.  But I have done a good
>bit of programming, and would like to learn to program
>Macintosh applications.  I know a little Pascal and no C, but
>I suspect that I should learn one of these languages.
>
>I usually need custom applications which can present graphical
>stimuli (hopefully originally composed in a separate graphics
>package I already know), record subjects' inputs and make
>reaction time measurements.  The graphics I need don't have to
>be Rodger Rabbit-perfect animations, but I do need to vary
>certain aspects dynamically.  (I'm going to try to simulate
>some control panel displays and gauges).  And the reaction
>time measures must be reliable.
>
>Are there any suggestions regarding which language(s) I should
>learn.  Or any good books I ought to read?  I can't find any
>information regarding the relative strengths and weaknesses of
>these two languages?  Does this mean I'm asking the wrong
>questions??
>
>I would appreciate any ideas or suggestions.  Thanks,
>
Well, to start off with, it somewhat boils down to a "religious" issue--i.e.
strongly held personal opionions (though not in the same ballpark as Lisp
programmers--they won't even admit to knowing how to spell "Pascal").

I personally use C,C++, and assembly.  Pascal is an easier language to learn 
(I believe it was developed as a teaching language).  Many extensions have
been made to make it more usefull as a professional programming language. 
C was developed as a systems programming langauge, giving more support in
accessing bits and manipulation of bits in memory.

I believe that C allows you to write more elegant and compact code, BUT it 
also allows you to write code that is very gross and obtuse (its not unusual to
take hours to track down a wrongly dereference pointer).  If you're dealing
with a lot of records within records, Pascal has the lead in readability (the
WITH statement's really powerfull).

So...I think C is a more powerfull language than Pascal, allowing you to do
more in less code.  This power comes at a cost, though.  C lets you get away
with about anything, which means that sometimes it allows you to screw 
yourself royal.  If you're more familiar with Pascal than C, I would only
recommend switching to C if you're going to be doing a lot of manipulation
of memory.

Mark


-- 
---------------------------------
Mark Dawson                Service Diagnostic Engineering
AppleLink: Dawson.M

Apple says what it says; I say what I say.  We're different
---------------------------------

philip@Kermit.Stanford.EDU (Philip Machanick) (05/10/90)

In article <40837@apple.Apple.COM>, marc@Apple.COM (Mark Dawson) writes:
> In article <1690MAYER-A@RICEVM1> MAYER-A@RICEVM1.BITNET (David Mayer) writes:
> >I'm a psychologist, not a programmer.  But I have done a good
> >bit of programming, and would like to learn to program
> >Macintosh applications.  I know a little Pascal and no C, but
> >I suspect that I should learn one of these languages.
[...]
> >I would appreciate any ideas or suggestions.  Thanks,
> >
> Well, to start off with, it somewhat boils down to a "religious" issue--i.e.
> strongly held personal opionions (though not in the same ballpark as Lisp
> programmers--they won't even admit to knowing how to spell "Pascal").
> 
> I personally use C,C++, and assembly.  Pascal is an easier language to learn 
> (I believe it was developed as a teaching language).  Many extensions have
> been made to make it more usefull as a professional programming language. 
> C was developed as a systems programming langauge, giving more support in
> accessing bits and manipulation of bits in memory.
> 
> I believe that C allows you to write more elegant and compact code, BUT it 
> also allows you to write code that is very gross and obtuse (its not
unusual to
> take hours to track down a wrongly dereference pointer).  If you're dealing
> with a lot of records within records, Pascal has the lead in readability (the
> WITH statement's really powerfull).
> 
> So...I think C is a more powerfull language than Pascal, allowing you to do
> more in less code.  This power comes at a cost, though.  C lets you get away
> with about anything, which means that sometimes it allows you to screw 
> yourself royal.  If you're more familiar with Pascal than C, I would only
> recommend switching to C if you're going to be doing a lot of manipulation
> of memory.
Another point: the Mac toolbox was originally designed to be called from
Pascal,
and C programmers occasionally get tripped up by variations in calling
conventions and the way strings are stored.

Philip Machanick
philip@pescadero.stanford.edu