On Nov 9, 4:10 pm, "Alf P. Steinbach" <al...@start.no> wrote: > Chapter 2 "Basic Concepts" is about 0.666 completed and 30 pages so far. > > It's now Python 3.x, and reworked with lots of graphical examples and more > explanatory text, plus limited in scope to Basic Concepts (which I previously > just had as a first ch 2 section -- but there's rather a lot of concepts!). > > I think it's wise to invite comments even when it's not 100% completed. First, > because as opposed to ch 1 there is quite a bit of code here, and since I'm a > Python newbie I may be using non-idiomatic constructs, not to mention doing > worse things. :-) Second, because comments in general can improve the text. > > Contents: > > 2.1 Super-basic concept: why programming is not DWIM. 1 > 2.2 Reported errors. 4 > 2.2.1 Case-sensitity. 4 > 2.2.2 Syntax / compilation errors. 4 > 2.2.3 Runtime errors / crashes. 5 > 2.3 A programming exploration tool: turtle graphics. 6 > 2.4 Naming things. 8 > 2.4.1 Naming actions: routines. 8 > 2.4.2 Naming data part I: variables. 11 > 2.4.3 Naming data part II: routine arguments. 13 > 2.5 Controlling the flow of execution. 14 > 2.5.1 Repeating actions automatically: loops. 14 > 2.5.2 Basic comparisions & boolean values. 16 > 2.5.3 Interlude I: a function graph program / about types. 17 > 2.5.4 Automated action choices. 21 > 2.5.5 Value-producing (function-like) routines. 23 > 2.5.6 Interlude II: a graph with zeroes marked / about program structure. 26 > 2.5.7 Dynamically nested actions: recursive routines. 28 > 2.6 Objects. [Not started on this] 31 > 2.7 Collections. [Not started on this] 31 > > In Google Docs (both chapters available here): > > <url:http://preview.tinyurl.com/ProgrammingBookP3> > Formats: PDF > > Cheers, > > - Alf
Well, you may not like it, but it is perfectly acceptable and indeed promoted to use CONSTANT_VAR_NAMES. You're almost discouraging the use of a well understood and oft-used idiom. I they're a lot of them, you generally have a settings module, that just lists all of the 'constants' (.h files effectively). "Technically line_length is a variable"...: No - it's a name that binds to an object that happens to be an integer. You've participated in discussions re: this. Similarly 'number_of_apples = number_of_apples + 1' is not an assignment ;) It's nit-picky and I realise you're trying to keep it simple, but as it's meant for new programmers to the Python language, then introduce them to Python's way of "variables", they'll thank you for it later... (or run screaming, or start another thread here...) I've never seen/heard != described as "different from"; what's wrong with "not equal to"? And why no mention of 'not' (should be mentioned with booleans surely?). That's as far as I've got; might get around to reading more later... Cool tree at the end :) Cheers, Jon -- http://mail.python.org/mailman/listinfo/python-list