On Sunday, May 31, 2015 at 9:55:45 AM UTC+5:30, Chris Angelico wrote: > On Sun, May 31, 2015 at 1:30 PM, Rustom Mody wrote: > > <Admission> > > In a recent course I taught, I used a[0] and a[1:] to split arrays and write > > recursive functions a la Haskell in Python. > > Is it efficient? no > > Is it idiomatic python? NO! > > Is it good to do that? That depends on one's priority. > > In mine, learning recursion is more important than learning idiomatic python > > </Admission> > > If recursion is more important than idiomatic Python, why are you > using a Python interpreter? Use Python to teach Python, and use > Haskell to teach Haskell!
Heh! I would have expected less naivete from you Chris! Firstly idiomatic haskell is as low priority (maybe more so) than idiomatic python More to the point no language matches perfectly¹ everything that a learner needs to learn. Can you write a kernel module in python? (Or Haskell?) Can you see details of machine state and transitions in python? Can you client-script a browser in python? C is the best fit for the first Assembly for the second Javascript for the third. And probably a dozen other languages for a dozen other key concepts. Finally the idiomatic vs fundamentals is not a clear binary divide. If I were interviewing someone claiming to be a C programmer who did not know the difference between postfix and prefix ++, I'd be darned suspicious. OTOH if someone who had written significant code in C simply refused to write a '++' saying "Causes just too much trouble" most people would regard it as odd but not unacceptable. ¹ or can. Thats Gödel's second theorem for you -- https://mail.python.org/mailman/listinfo/python-list