Why not allow empty code blocks?
Rustom Mody
rustompmody at gmail.com
Sat Jul 30 12:58:19 EDT 2016
On Saturday, July 30, 2016 at 10:07:59 PM UTC+5:30, Chris Angelico wrote:
> On Sun, Jul 31, 2016 at 2:15 AM, Rustom Mody wrote:
> > Diff between
> > print "x"
> > and
> > print("x")
> > is one char — the closing ‘)’
> >
> > To make a dispute about that — I’ll leave to BartC!
> >
> > The more general baby that is significant is that beginners should have
> > it easy to distinguish procedure and function and python does not naturally aid that. print was something procedure-ish in python2 but the general notion being
> > absent is a much more significant problem (for beginners) than print.
>
> But Py2's print is not just a procedure. It's magical syntax. You
> can't create your own procedures.
>
> Why SHOULD they be special? Ultimately, a procedure is simply a
> function that has no useful return value; and there are myriad times
> when I've called a function or method for its side effects and ignored
> the return value. So do I need to be able to "call a function as if it
> were a procedure", or is there a stark difference between the two
> types of callable?
>
> Where, in any useful production code, is the difference between
> functions and procedures actually helpful? Or where, in student code,
> would it be useful to distinguish? I've been teaching Python to
> students with a variety of backgrounds, and nobody has yet been
> bothered by this. Not a single one.
>
> ChrisA
In English — and all Indo-European¹ languages — there are two moods
“It is raining” is in declarative mood
“Come in!” is in imperative mood
Now there is a realm in which they are not distinct
“It is raining!” said Harry Potter to Hermione and it started raining
“Come in!” said Harry, And the chair walked hoppety-hop into the room
So sure if you want to teach magic to your kids, all power to you.
Myself, I’ll stick to what I know better than magic — programming
¹ Benjamin Lee Whorf pointed out that fundamental categories — in this example,
imperative and declarative moods — determine the form of thinking of the
people/race that use that language.
In particular the native American language Hopi, is not so ruined with
time-as-space metaphors. And therefore ‘advanced’ ideas like quantum physics
turn out not so advanced in Hopi [I am told]
But this is all way too far afield
Pragmatically not distinguishing imperative and declarative — or ‘do’ vs ‘is’
— is unrealistic
More information about the Python-list
mailing list