coding style - where to declare variables

Marko Rauhamaa marko at pacujo.net
Mon Jul 23 02:22:55 EDT 2018


Dennis Lee Bieber <wlfraed at ix.netcom.com>:
> On Mon, 23 Jul 2018 00:08:00 +0300, Marko Rauhamaa <marko at pacujo.net>
> declaimed the following:
>
>>I Java terms, all Python values are boxed. That's a very usual pattern
>>in virtually all programming languages (apart from FORTRAN).
>
> 	FORTRAN, C, COBOL, BASIC, Pascal, ALGOL, BCPL, REXX, VMS DCL, probably
> R, Matlab, APL.
>
> 	I never encountered the term "boxed" until trying to read some of the
> O'Reilly books on Java.
>
> 	In my world, Java and Python are the ones that are not "common".

Yes, "boxed" is a Java term. However, the programming pattern of using
dynamic memory and pointers is ubiquitous and ancient:

    FILE *f = fopen("xyz", "r");

where f holds a pointer, fopen() returns a pointer, and "xyz" and "r"
evaluate to pointer values.

In Python, every expression evaluates to a pointer and every variable
holds a pointer.


Marko


More information about the Python-list mailing list