Is anybody coming from Pascal?

David C. Ullrich ullrich at math.okstate.edu
Sat Jul 21 15:49:54 CEST 2001


Well, I may be qualified to answer this one because I
know less C than anyone else here. And in fact the 
first "real" language I learned was ObjectPascal. 
Two comments:

[i] I _think_ that all your complaints with Python are
just the sort of thing you need to get used to - there's
no real reason the Python way is worse, if you'd learned
Python first then the way Pascal does things would bother
you the same way. I think. (The bit about 5/2 = 2 does
bug a lot of people - that's something they talk about
changing periodically. You should note that 5.0/2 comes
out to 2.5. That won't work so well with variables;
note as well that float(5)/2 is 2.5. Still bugs me,
but even here I suspect that if you'd learned Python
first then you'd be posting to a Pascal group right 
now saying what the heck is this stuff where / and
div do the same thing except different.)

[ii] "Object Pascal" actually refers to a few different
things. I'm a big fan of Object Pascal as in Delphi, which
I'm guessing is the Object Pascal you have in mind. But
I don't quite follow why you say you'd like to hear from
people who've tried it. I use both languages a lot, but
for very different sorts of things; I wouldn't regard
either one as a substitute for the other.


On Sat, 21 Jul 2001 07:05:13 +0100, edmund at ngetal.fsnet.co.uk (Edmund
Strangely) wrote:

>Hello,
>
>I've been lurking here for a while while working my way through 'Learning
>Python'. So far only a few things have pissed me off with it. I was just
>wondering, is anybody else coming from Pascal? Or Modula2/3? The book I am
>reading kind of assumes that you are coming from C, and as I understand it
>Python is written in C which is why it shares some of the same
>conventions. Python is my first object orientated language. Pascal was my
>second programming language (after BASIC on a spectrum) and although I
>sort of learned C later, I still prefer Pascal. I personally like it more
>than C for a few reasons. I don't think that I should have to worry about
>how many bytes precisely my variables are stored in. (And I like BASIC
>even better in this respect, in that integers and fp numbers are
>automatically converted, and strings will grow and shrink as required (as 
>in Python seemingly)). I don't like the fact that in Python if
>
>>>>a=5
>>>>b=2
>>>>#and then
>>>>c=a/b
>>>>#then
>>>>c
>2
>
>in Pascal if you *want* modulo arithmetic (which is not normally the case
>) then you have DIV and MOD. I like having a distinction between functions
>and procedures, for purely aesthetic reasons (I think having loads of
>function names followed by () just looks ugly, procedures don't give
>return values). Python only has functions, but I can forgive it that. But
>the one thing above all that I think Pascal has over C (and which Python
>shares) is that you can nest your procedures/functions! Most of my Pascal
>programs had a mere few lines in the 'main' body of the program and the
>rest would be large functions and procedures each with their own
>sub-procedures and sub-functions with their own sub-sub units etc. When I
>first started on C I just couldn't *believe* that you couldn't nest
>functions, and just had to put them one after the other! You call that
>structured programming?
>
>I conclusion, and in reviewing this post, I seem to have been rambling a
>bit (it's a bit late/early in the day) but I'd be interested to get a
>response from anybody else who rates Mr Wirth, and in how any such people
>finding the transition. I'd also be curious to hear from anybody who has
>tried object Pascal.
>
>-- 
>                      Smash Bourgeois Revisionism!
>               Edmund Strangely aka Bad Nail Varnish Boy
> 'at all times he remained peculiar in presentation, and at one point
>                    painted his finger nails black.'


David C. Ullrich



More information about the Python-list mailing list