On 1/1/2023 9:14 PM, avi.e.gr...@gmail.com wrote:
Thomas,

I used PASCAL before C and I felt like I was wearing a straitjacket
at times in PASCAL when I was trying to write encryption/decryption
functions and had to find ways to fiddle with bits. Similar things
were easy in C, and are even easier in many more recent languages
such as Python.

PASCAL was not the first language I learned.  I won't pretend I had to
do anything very complicated, or do much bit-twiddling. It was, though, the first one (except probably for FORTH) I enjoyed programming with more than I disliked the boiler-plate formalities.

The distinction between teaching a first language, or one that is so cautious as to catch and prevent all mistakes it can, is not for
people willing to be bolder or work faster or write routines that can
be used more generally.

What has not been mentioned is that languages like python go a step
further and allow a function to return many arguments and even a
varying number of arguments, as well as none at all. To do anything
like that in PASCAL

(or C, for that matter)

took some thought on how to make some structure you could fill out
then return as a single value that the receiving code had to sort of
decode and perhaps deal with parts that could hold a union of several
things. Can a compiler or interpreter easily verify you did something
reasonable, as compared to say python that allows something like:

(res1, res2, _, res4, _, rest) = f(x)

Yes, that's one of the good things about Python, how it makes working
with tuples so easy and natural.  OTOH, harking back to PASCAL for a
minute, it had enumerations and sets long before Python got them.

The above tells the interpreter you expect perhaps 6 or more results
and what to do with them.



-----Original Message----- From: Python-list
<python-list-bounces+avi.e.gross=gmail....@python.org> On Behalf Of
Thomas Passin Sent: Sunday, January 1, 2023 1:03 PM To:
python-list@python.org Subject: Re: NoneType List

On 1/1/2023 8:47 AM, Stefan Ram wrote:
Thomas Passin <li...@tompassin.net> writes:
Guido had been working on the ABC language for some years before
he developed Python. ABC was intended mainly as a teaching and prototyping language.

In those days, there used to be a language called "Pascal". Pascal
had a dichotomy between "functions" and "procedures". A call to a
function was intended to have a value. A call to a procedure was
intended to have an effect.

Wirth developed Pascal as a teaching language. IIRC, originally it
was taught to students before there were any implementations. I did
most of my programming with Turbo Pascal for many years.  Just to
clarify what you wrote above, in Pascal a "procedure" does not return
anything while a "function" does.

I really liked (Turbo) Pascal and I hated C back then.  No wonder I
like Python so much.  It must be something about how my mind works.

For some beginners, the difference between a value and and effect
can be hard to grasp. So, Pascal's distinction helps to hammer that
home.

Experienced programmers know the difference and do no longer require the effort of the language to teach it to them.

The time when someone is a beginner and still struggles to
understand the difference between values and effects usually is
significantly shorter than the later time where he has understood
it and is programming productively, so it might be better when the
language is adapted to people who already have understood the
difference.



-- https://mail.python.org/mailman/listinfo/python-list


--
https://mail.python.org/mailman/listinfo/python-list

Reply via email to