|
|
|
|
|
by manvillej
1056 days ago
|
|
both examples seem pretty contrived and I think this comes down just what language you are used to. Their other code seems very JS-y. I work in both python & js. The python reads like natural language: Processed items is a set of some transformation of each item in bar.baz() where something is true for that item.
then Foo the smallest in that list.
It reads like english.JS-y stuff doesn't read like natural language, but I do think its more concise and fits the IDE function discovery workflow better. Both models can be made into horrid messes or elegant solutions. Both are highly readable. Now I like the python one because I find it natural to attach contextual "whys" or "because" comments to them. Processed items is a set of some transformation of each item in bar.baz() where something is true for that item.
then Foo the smallest item.
# because foo is a slow function and we don't want to foo every bar and baz
|
|