Programming intro book ch1 and ch2 (Windows/Python 3) - Request For Comments

Alf P. Steinbach alfps at start.no
Sun Dec 20 02:29:43 EST 2009


* John Posner:
> On Fri, 18 Dec 2009 13:00:48 -0500, Alf P. Steinbach <alfps at start.no> 
> wrote:
> 
>>
>> Chapter 2 is about Basic Concepts (of programming). It's the usual: 
>> variables, ...
> 
> 1. Overall suggestion
> 
> You have a tendency to include non-pertinent asides [1]. But then, 
> rambling a bit endows a manuscript with the author's distinctive voice. 
> Fortunately, we live in a hypertext-enabled world, where you can have 
> your cake and eat it, too. I suggest that you go over your manuscript 
> with a ruthless eye, and turn your rambles into hypertext-accessible 
> "sidebars". See how much you can reduce the length of Chapter 2, which 
> current runs 98 pages!

He he. :-)

You're right, although the examples you chose were not as I see it rambles, just 
short asides within sentences; useful concrete examples; and general background.

I do have a tendency to apparently ramble, especially about technical details 
and consequences  --  it's not arbitrary but an attempt to bring in important 
consequences and/or some more fundamental unifying view. I tried to discipline 
myself to not do that, to just let go, to let /the reader/ replace arbitrary 
rules with understanding, in time. Like, you don't really need to understand the 
physics to do hammering. Even though even a rough understanding of the physics 
can help you avoid looking like an effeminate Hollywood movie star acting out 
hammering, can help you avoid getting hurt, can get the job done much faster, 
and can help you in other situations! But I'll try even harder. :-)


> 2. Comments on Section 2.6.7, "References & automatic garbage collection"
> 
> There's a spell-check evader on page 2:49: "trough" s.b. "through". And 
> your spell-checker should have caught "adressable" on page 2:48.

Sad to say, I'm not using a spell checker. The reason is that for me, in /most/ 
cases the speling erors marked by Word's spell checker are not speling erors. 
The beast is Just Wrong. And it's Wrong-Headed, insisting on "fixing" perfectly 
correct text. For example, replacing "southeast" with "southwest" (now, what the 
**** does Word's spell checker know about geography? Nothing!) Even worse, as 
soon as that beast just gets its little toe inside the door, it tends to invite 
in its friends the Grammar Checker and the Auto Formatter. Which feel free to 
not only report what they see as improvements, but to just change the text!

So, thanks!

Will be fixed.


> I find your sequence-of-attribute-lookups approach to the topic of 
> "variable assignment" interesting. The directed-graph illustration on 
> page 2:49 even hints at the fact that in the world of Python, names 
> ("turtle", "forward", etc.) and objects (various kinds of yellow boxes) 
> are very different things.
> 
> (I suggest getting rid of the callout "Very small fixed size variable". 
> That way, only objects, not names, have the italicized callouts.)
> 
> But using the term "references" and the directed-graph metaphor has its 
> drawbacks. Avoiding the term "reference" will make it easier to navigate 
> the turbulent waters of call-by-reference vs. call-by-value vs. 
> call-by-name. (You don't even stick a toe in those waters in Section 
> 2.7.5.) Combining memory addresses with the directed graph metaphor 
> invites the reader to think at way too low a level, IMHO.

Uhm, discussing call-by-name would really be rambling & anecdotal. AFAIK no real 
programming language has had that since Algol, where it was introduced by a too 
unclear spec implemented literally (i.e., lack of 2-way communication within the 
team introduced a "feature"!). Or am I misunderstanding what you mean?

It's True, as you note, that people tend to get confused. I recently (just weeks 
ago) was astounded to see that a C++ "expert" thought that Java had pass by 
reference, apparently because in Java only references are passed around. But I 
think the cure for that is not to draw a veil over the things that can confuse, 
such as avoiding the word "reference", but rather to just discuss the reality.

That is, I think argument passing & associated terminology is not more 
complicated than even my mom could understand, if she put her politician's mind 
to it. Certainly, anyone young enough won't have any problem. I believe... ;-)


[snip]

> I hope these comments help.

Yes, thanks,

- Alf



More information about the Python-list mailing list