[lang]

Present Perfect

Personal
Projects
Packages
Patches
Presents
Linux

Picture Gallery
Present Perfect

Readability

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

2008-07-09
12:38

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.

4 Comments »

  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-07-09 @ 13:23

  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-07-09 @ 13:38

  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-07-09 @ 16:35

  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-07-11 @ 10:01

RSS feed for comments on this post. TrackBack URL

Leave a comment

picture