[OT] C# -- sharp or carp? was Re: Learning Python (or Haskell) makes you a worse programmer

Sven R. Kunze srkunze at mail.de
Tue Mar 29 12:11:36 EDT 2016


On 29.03.2016 18:05, Peter Otten wrote:
> Reformatting it a bit
>
> String.Join(
>      "\n",
>      mylist.Where(
>          foo => !String.IsNullOrEmpty(foo.description)
>      ).Select(
>          foo => foo.description))
>
> this looks like a variant of Python's
>
> str.join(
>     "\n",
>     map(lambda foo: foo.description,
>     filter(lambda foo: foo.description, mylist)))
>
> Assuming it's type-safe and can perhaps reshuffle the where and select part
> into something optimised there is definitely progress.
>
> But still, Python's generator expressions are cool..

Haha, sure. But don't get stuck there. Learn something new from time to 
time; even a new language.


Best,
Sven



More information about the Python-list mailing list