Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #61600
| References | (2 earlier) <52A78F6F.3060507@stoneleaf.us> <CABicbJKoN9fV48yskd5wqE79vsb5=nPGfwgOTCO+fCFMG7g8qw@mail.gmail.com> <CAPTjJmpQ9bFP66j3p-PDb2Mp88GKWKktrcFRCWQtdo6fb8LHmA@mail.gmail.com> <mailman.3908.1386777719.18130.python-list@python.org> <a34ada67-aa04-4f4d-b26d-e941cee03c4c@googlegroups.com> |
|---|---|
| Date | 2013-12-12 03:45 +1100 |
| Subject | Re: Experiences/guidance on teaching Python as a first programming language |
| From | Chris Angelico <rosuav@gmail.com> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.3915.1386780355.18130.python-list@python.org> (permalink) |
On Thu, Dec 12, 2013 at 3:27 AM, rusi <rustompmody@gmail.com> 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.
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Re: Experiences/guidance on teaching Python as a first programming language bob gailer <bgailer@gmail.com> - 2013-12-11 11:01 -0500
Re: Experiences/guidance on teaching Python as a first programming language rusi <rustompmody@gmail.com> - 2013-12-11 08:27 -0800
Re: Experiences/guidance on teaching Python as a first programming language Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-12-11 16:36 +0000
Re: Experiences/guidance on teaching Python as a first programming language Chris Angelico <rosuav@gmail.com> - 2013-12-12 03:45 +1100
Re: Experiences/guidance on teaching Python as a first programming language Roy Smith <roy@panix.com> - 2013-12-11 20:42 -0500
Re: Experiences/guidance on teaching Python as a first programming language Larry Martell <larry.martell@gmail.com> - 2013-12-11 21:07 -0500
Re: Experiences/guidance on teaching Python as a first programming language Roy Smith <roy@panix.com> - 2013-12-11 21:31 -0500
The increasing disempowerment of the computer user (was: Experiences/guidance on teaching Python as a first programming language) Ben Finney <ben+python@benfinney.id.au> - 2013-12-12 13:21 +1100
Re: The increasing disempowerment of the computer user Mark Lawrence <breamoreboy@yahoo.co.uk> - 2013-12-12 02:35 +0000
Re: The increasing disempowerment of the computer user Ben Finney <ben+python@benfinney.id.au> - 2013-12-12 13:35 +1100
Re: The increasing disempowerment of the computer user Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-12-12 10:59 +0000
Re: The increasing disempowerment of the computer user David Hutto <dwightdhutto@gmail.com> - 2013-12-14 00:44 -0500
Re: Experiences/guidance on teaching Python as a first programming language rusi <rustompmody@gmail.com> - 2013-12-11 19:52 -0800
Re: Experiences/guidance on teaching Python as a first programming language Chris Angelico <rosuav@gmail.com> - 2013-12-12 15:20 +1100
Re: Experiences/guidance on teaching Python as a first programming language bob gailer <bgailer@gmail.com> - 2013-12-12 11:51 -0500
Re: Experiences/guidance on teaching Python as a first programming language Larry Martell <larry.martell@gmail.com> - 2013-12-12 16:18 -0500
Re: Experiences/guidance on teaching Python as a first programming language Frank Miles <fpm@u.washington.edu> - 2013-12-13 16:21 +0000
csiph-web