>google style guide bans map, reduce, and filter functions
You told me functional programming was the next big thing /g/.
I see no such prohibition in their C++ style guide.
Their Python style guide was written by this colossal stroopwafel-munching faggot and they haven't bothered changing it since he left.
everyone at google is a brainlet
>>61809824
You're fucking retarded there is no reason to use those functions in Python when list comprehensions are much more readable.
>>61810007
>reduce
>list comprehension
>>61810018
Reduce is a shitty unreadable mess.
>>61810018
with reduce you're supposed to use the for i in iterable construct
>>61809726
i'm assuming this is for python like the other guy and yeah, guido discourages those functions. why are you trying to code golf while using python anyways? it's not a functional language
>>61810039
>using basic functional features
>code golf
>doesn't allow more than one loop in a list comprehension
>>61810067
>smug anime girl
>using badly implemented high order functions in python because you're to intelligent to use haskell
>>61810100
Map is faster and more readable than a list comprehension in some cases.
>>61810144
in python? care to write a code snippet where that's the case and screenshot the times? because i don't believe you.
>>61810144
Fucking prove either of those claims
>>61810151
>>61810161
>>61810258
>range
Brainlet discovered. range has been deprecated for a while.
>>61810274
>>61810258
Ok I guess I stand corrected. I checked this for python3 (to address your range point), and I even did list(map(str, range(100))) to make sure it wasn't just making a lazy iterator, and I got ~25usec vs ~19usec.
>>61810274
Still faster using xrange.
>>61810306
In 3 map is lazy but it's faster than corresponding gen exp.
>>61810306
map is optimised in cpython to only load the function once, the comprehension has to load the str function from globals every iteration since you could modify it during iteration
>>61810373
>since you could modify it during iteration
When would this happen?
>>61810495def f(x):
global str
def str(*_, **__):
print("fuck")
return X
[str(f(i)) for i in range(10)]
>>61810576
damn global keyword
>>61810591
The same could happen if you called a class method that modified that method when called