Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed3.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.001 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'python,': 0.02; 'output': 0.05; 'subject:Python': 0.06; 'explicit': 0.07; 'string': 0.09; 'executed': 0.09; 'subject:language': 0.09; 'cc:addr:python-list': 0.11; 'python': 0.11; 'creates': 0.14; 'language.': 0.14; '"hello': 0.16; '3:27': 0.16; 'footnote': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'handlers': 0.16; 'repl': 0.16; 'subject:programming': 0.16; 'world!': 0.16; 'world!")': 0.16; 'language': 0.16; 'wrote:': 0.18; 'thu,': 0.19; 'command': 0.22; '>>>': 0.22; 'programming': 0.22; 'cc:addr:python.org': 0.22; 'print': 0.22; 'creating': 0.23; 'cc:2**0': 0.24; "i've": 0.25; 'first,': 0.26; 'second': 0.26; 'subject:/': 0.26; 'header:In-Reply-To:1': 0.27; 'function': 0.29; '[1]': 0.29; 'am,': 0.29; 'dec': 0.30; 'message- id:@mail.gmail.com': 0.30; 'lines': 0.31; 'produces': 0.31; 'languages': 0.32; 'another': 0.32; 'quite': 0.32; 'text': 0.33; '(including': 0.33; 'style': 0.33; "i'd": 0.34; 'could': 0.34; 'but': 0.35; 'received:google.com': 0.35; 'programming,': 0.36; 'rather': 0.38; 'anything': 0.39; '12,': 0.39; 'how': 0.40; 'even': 0.60; 'commands': 0.60; 'world.': 0.61; 'skip:* 10': 0.61; 'teaching': 0.64; 'more': 0.64; 'teach': 0.65; 'felt': 0.74; 'as:': 0.81; 'bare': 0.84; 'rusi': 0.91; 'to:none': 0.92; '2013': 0.98 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:cc :content-type; bh=K2V2x5Kd9CMkQzj8iiGtWU/GoPuwDKUHnOga0ftsKYs=; b=dIegYywxGWZkicpAWQ4TAdd8M7+RKO2vxO9ekblWmWm2npcpiiNgIaluL5aI4A27Qh Is66LEB+VdZuVRswRoheuB1VsnpoWeMqJqZS1qGKGIKY2DewaqhzPgkJnNrIJ8M9DVfA hT5oGCRI0YJ9UZUw9YZxhqxTcgSBLzQQ6+/VcG1/zMh1bhYRXYEnPUS+TMcd3Fyxf/5R t+qtZZqdIjUhzWNKugjagmU6UEgtprZW2dW/VYfK1g3XYif4uV4ppAgqcFFCywKiQ/0d 7p/2Mo3UBzG9v4epjWjTVCUY9hnvlhlceuqb76zy2uBHkD4lF8OhsNA7cOqU9qSnSnj7 079A== MIME-Version: 1.0 X-Received: by 10.68.228.97 with SMTP id sh1mr2982725pbc.50.1386780352118; Wed, 11 Dec 2013 08:45:52 -0800 (PST) In-Reply-To: References: <201312090824.25211.gheskett@wdtv.com> <52A78F6F.3060507@stoneleaf.us> Date: Thu, 12 Dec 2013 03:45:51 +1100 Subject: Re: Experiences/guidance on teaching Python as a first programming language From: Chris Angelico Cc: "python-list@python.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 36 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1386780355 news.xs4all.nl 2865 [2001:888:2000:d::a6]:41031 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:61600 On Thu, Dec 12, 2013 at 3:27 AM, rusi wrote: > However when we have an REPL language like python, one has the choice > of teaching the hello-world program as: > > print ("Hello World") > > or just > > "Hello World" > > The second needs one more assumption than the first, viz that we are in the > REPL, however on the whole it creates better habits in the kids. How is the bare string creating better habits? The only time I've ever been happy with bare strings having functionality[1] is in shell-like languages (including REXX; the one time I built a REXX system in which bare strings weren't executed as commands was a MUD, where command handlers could use bare strings to send lines of text to the client, and I wasn't happy with that - an explicit function would have been better). I'd much rather teach a function that produces clean output than depend on the REPL for Hello World. Now, depending on the REPL for *expressions* is quite another thing. >>> 1+2 3 That makes perfect sense! But it's using Python as a calculator, not as a programming language. Python blurs the line a bit, but for teaching programming, I'd use programming style even at the REPL: >>> print("Hello, world!") Hello, world! ChrisA [1] I don't have anything to footnote here, I just felt like having one.