Popular conceit about learning programming languages

Dennis Lee Bieber wlfraed at ix.netcom.com
Sat Nov 23 22:22:10 EST 2002


Bengt Richter fed this fish to the penguins on Saturday 23 November 
2002 10:08 am:

> 
> Fortran has abstractions too, but, e.g., no idea of dictionary per se
> binding a particular set of names to a particular set of objects.

        No, but then again, "dictionary" is just a name for an implementation. 
For example, a Python dictionary and a REXX "stem variable" are both 
forms of an abstract construct I know under the term "associative 
array" (and REXX has a minor advantage too, as you can initialize stems 
in a way in which a default value applies to all "undefined" keys). 
REXX stem variables are variables in which the name contains a "."
Python d["key"] is equal to REXX d."key" (yes, you can quote the part 
of the variable that follows the "."). FORTRAN does not have 
associative arrays, but that doesn't stop me from thinking in that 
concept, leaving the implementation to later... True, for FORTRAN that 
implementation will require coding a bit of a library of routines, 
but...

        As for where the concept of associative arrays came from... I learned 
of them NOT from Python or REXX, or from any other language. I learned 
of them from courses on database internals, language design, etc.

> Learning python gives you the abstract notion of name->thing
> relationships to think with. You can get this notion from in Lisp as
> well, but in Fortran name->thing relationships are narrowly contrained
> (for useful purposes) and don't give you the general abstract notion.
> OTOH, arrays also have abstract counterparts, and Fortran and
> associated libraries gives you some useful things there.
>
        PostScript (yes, that /is/ a programming language) introduces one to 
similar concerns. "Making" a substring doesn't copy part of the 
original string, it just associates the name with part of the original. 
Changing the contents of the substring changes it AND the original 
string. I learned that one years ago, on my Amiga. I've never had a 
PostScript printer -- but my favorite Amiga wordprocessors only 
produced NLQ output by using PostScript (the alternative was "screen 
dump -- magnifying a 12 pixel character to fill a 24dot printer cell... 
very ugly rectangular blocks). So I used so-called PostScript 
compatible interpreter programs to render the pages. Turns out both 
programs I used (one was discontinued and I had to buy a replacement) 
did NOT implement the proper substringing behavior. I had to modify the 
wordprocessor PostScript preamble files to work around that improper 
behavior by doing string copies rather than subscript assignments.
 
> So I would say "thinking in" a language is thinking in the abstract,
> but restricting oneself to the abstractions that map easily to
> representatons in the syntax of the language. The more powerful the
> language, the less the restriction.
>
        Whereas I tend to do the thinking without taking any language into 
account, using concepts picked up from anywhere if they assist in the 
analysis of the problem space.
 


-- 
 > ============================================================== <
 >   wlfraed at ix.netcom.com  | Wulfraed  Dennis Lee Bieber  KD6MOG <
 >      wulfraed at dm.net     |       Bestiaria Support Staff       <
 > ============================================================== <
 >        Bestiaria Home Page: http://www.beastie.dm.net/         <
 >            Home Page: http://www.dm.net/~wulfraed/             <




More information about the Python-list mailing list