Instead of deciding between Python or Lisp for a programming intro course...What about an intro course that uses *BOTH*? Good idea?

Rustom Mody rustompmody at gmail.com
Tue May 12 22:02:35 EDT 2015


On Wednesday, May 13, 2015 at 6:45:07 AM UTC+5:30, Steven D'Aprano wrote:
> On Wed, 13 May 2015 02:05 am, Chris Angelico wrote:
> 
> > So if you're writing a library function, it probably shouldn't use
> > print()... but your application is most welcome to. You usually know
> > which one you're writing at any given time.
> 
> You might be, but beginners are not.
> 
> I'm not sure I accept Rustom's fix for the problem (I think that his cure is
> worse than the disease), but it is *hard* to get some beginners to use
> return instead of print:
> 
> def add_twice(x, y):
>     """Add twice y to x."""
>     print x + 2*y
> 
> 
> sort of thing.
> 
> Personally, I think that banning print is only useful if you wish to
> encourage cargo-cult programming:
> 
> "Don't use print!" 
> "Why not?"
> "My CS lecture said not to use it! I dunno, maybe it has a virus or
> something."

:-)

[And more real than you know --- every medicine has a side-effect]
Just to be be clear about the framing -- though it does not work too well
across Usenet --
I would suggest to TEACHERS to not use/show print TOO EARLY

Something like cigarettes: 
You dont ban children from smoking. You ban adults from setting up tobacco
shops near schools

> procedural language is *perfect* for that, since you can highlight the
> differences:
>  
> function foo(n:int): int;
>   begin
>     foo := n+1;
>   end;
>  
> procedure foo(n:int);
>   begin
>     writeln(n+1);
>   end; 

This cuts both ways
Python much more than Pascal can make the 1st possible because of data
structures in general being first class

Unfortunately python culture across the net is laissez faire about using the
2nd -- I am demoing SMTP protocol... Does print or no print really have anything
to do with it?

When you give the procedure foo vs function foo example, you are jumping across 
the levels of familiarity and usage to assessment/evaluation.

Shall I use an if or a while?
Shall I use a list or a dict?
Shall I use immutable + or mutable extend/append? 
:
:
And a dozen other more fundamental things to assess.

If I could count the number of times a beginner hangs an else onto a while...
Students dont 'Not get it' because they are asses but because they are at a
firehose.  The asses are the adults who stand by and keep turning on the pressure



More information about the Python-list mailing list