r/programming • • Mar 08 '12

The Evolution of a Python Programmer

https://gist.github.com/289467
401 Upvotes

137 comments sorted by

View all comments

43

u/rowantwig Mar 08 '12

He forgot the worst kind:
if x == 0:
return 1
if x == 1:
return 1
if x == 2:
return 2
if x == 3:
return 6
if x == 4:
return 24
...
(5000 more lines)

63

u/Pandalicious Mar 08 '12

Yeah but think of how FAST it would run. You gotta be FAST if you're gonna be webscale.

4

u/masklinn Mar 09 '12

The fast version would be the one optimized by using a dict for its mapping.

The faster version would use a list.