NoneType List

avi.e.gross at gmail.com avi.e.gross at gmail.com
Sun Jan 1 21:14:50 EST 2023


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. 

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 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)

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.com at python.org> On
Behalf Of Thomas Passin
Sent: Sunday, January 1, 2023 1:03 PM
To: python-list at python.org
Subject: Re: NoneType List

On 1/1/2023 8:47 AM, Stefan Ram wrote:
> Thomas Passin <list1 at 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



More information about the Python-list mailing list