[Tutor] functions, system statements, sleep

D-Man dsh8290@rit.edu
Sat, 20 Jan 2001 15:44:45 -0500

On Fri, Jan 19, 2001 at 06:27:48PM -0800, Daniel Yoo wrote:
| On Fri, 19 Jan 2001, D-Man wrote:
| > On Fri, Jan 19, 2001 at 06:07:31AM -0800, Matthias Hager wrote: | I'm
| > a complete idiot, but when I create a function in Python, how do I run
| > it? Say I create a function that has a main menu. And after the user
| > goes through the introductory, how can I run the main_menu function? |
| > 
| > First you will have to un-learn all the bad habits Perl taught you.
| Whoa, whoa --- it's not bad, only different.  Perl has its own philosophy,
| and there isn't a need to classify it as bad.  (Sorry about that --- I'm
| just touchy sometimes...)

It is certainly different.  I believe that taking shortcuts like
omitting variable names (using the "magic" $_ instead) and omitting
arguments (and/or parens) when calling functions is just asking for
trouble.  Thus I think it is bad.  (but, of course,  most (all?)
classifications are just based on opinion anyways so there is no
purpose in arguing the point)

If you are simply writing a one-time script to change something it
might not be so bad of a feature, but if you are trying to debug a
full application it is a nightmare.

| About calling conventions --- at least it isn't like Matlab: according to
| Matlab, if we have a function that doesn't have parameters, it's illegal
| to put:
|     function()
| Matlab will refuse to accept something logical like this --- it's wants to
| just see
|     function
| without parenthesis.  Now that's evil.  *grin*

Of course. ;-)