On Thu, May 29, 2014 at 4:43 AM, Nick Coghlan <ncoghlan@gmail.com> wrote:
For that last point, my interest is as much educational as it is in
easing the transition from Python 2. The parentheses in "print('Hello
world!')" mean introducing the idea of function calls early to explain
how it works, while being able to omit them makes it easier to gloss
over the distinction between statements and function calls initially
and then cover it later after the basics of flow control have been
nailed down.

I've been doing a lot of intro-to-python teaching lately (py2 so far...), and I understand this desire. IN fact, a lot of notes point to the fact that python's "hello world" is simply : print "hello world", rather than what is required in some languages to do something that simple.

However, I also believe that when teaching it's better to introduce the "right way" to do something up front, rather than a "beginners' way", then later say, well, you really SHOULD do it this other way... So if we want our students to use print as a function, we might a well start them off that way. Saying that their very first easy program is:

print("hello world")

is fine -- they don't have to know or understand what a function call is -- they simply copy the syntax. And frankly, we get to simple function calls, VERY early in the program -- you can't really do anything without them...

In fact, in my latest class, we've made an effort to introduce forward-thinking up front, even before we explain quite what it all means:

use u"a string" to make a string

you write a class like:

class C(object):
   ...

before we talk about subclassing, or what "object" is...

just my $0.02

-Chris










 
Cheers,
Nick.

--
Nick Coghlan   |   ncoghlan@gmail.com   |   Brisbane, Australia



--

Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R            (206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115       (206) 526-6317   main reception

Chris.Barker@noaa.gov