3 ms·
Even in Python I find the vaguely more functional style of list comprehensions easier to read than explicit loops. I've taught enough classes to know that many
by mjn 7y ago
Even in Python I find the vaguely more functional style of list comprehensions easier to read than explicit loops. I've taught enough classes to know that many students who've had only a CS-101 type class do prefer explicit for loops that accumulate a result rather than list comprehensions, though. Seems like any statements about clarity (in either direction) have to include a fairly big caveat about who the audience is.
- fooker 7y agoNice that you mention Python. The creater of Python echoes my points: http://lambda-the-ultimate.org/node/587 http://lambda-the-ultimate.org/node/587
- tome 7y agoOh, I know. I use Python more by necessity than choice and it's only made bearable by features that Guido doesn't want to be there! If only it had tail call optimisation, multi-line lambdas and other features that Guido doesn't want. Then it might be even more than bearable.