Readability |
2008-07-09
|
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.
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
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
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
@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