Present Perfect


Picture Gallery
Present Perfect


Filed under: Conference,Hacking,Python — Thomas @ 12:38 pm

12:38 pm

In a “Functional Programming in Python” talk, and the author has decided to “remove the return statement from all examples for readibility.”

So all of the examples are wrong, and 7 characters are removed while the monster functional statements on the right of the eliminated return statement are still there. Somehow I fail to see how this achieved more readability.

Of course it only took getting to the second slide for someone to raise a hand and say “didn’t you forgot to put return in there?” to which the presenter replied “yes, I just told you I wasn’t showing them for readability.”

Something went wrong there.

Side note – why are all functional programming examples about prime numbers ? Fetishists.


  1. Another possible reason is that most of time there is no ‘return’ in true functional language, it’s always the last computed expression which is returned implicitly.

    Comment by Garuma — 2008-7-9 @ 1:23 pm

  2. Is that at EuroPython? I think I saw the same talk at RuPy and found it to be rather poor.

    Comment by Carl Fredrich Bolz — 2008-7-9 @ 1:38 pm

  3. http://www.dabeaz.com/generators/Generators.pdf for a good presentation on functional tricks (generators) that uses actual, real-world examples.

    Comment by David Adam — 2008-7-9 @ 4:35 pm

  4. @Garuma: don’t think so, this is all python code and the presenter explicitly stated he’s removing it for readability.

    @Carl: yes, Europython. Yes, I can’t say I learnt that much.

    @David: excellent, that looks really useful, thanks!

    Comment by Thomas — 2008-7-11 @ 10:01 am

RSS feed for comments on this post. TrackBack URL

Leave a comment