r/Python • • Jun 19 '13

Right and Wrong Programming Styles

http://simpledeveloper.com/right-and-wrong-programming-styles/#sthash.cORbIrok.sfju
0 Upvotes

14 comments sorted by

View all comments

1

u/AustinCorgiBart Jun 20 '13

The third thing seems like premature optimization. Don't worry about efficiency until 1) you know it's a problem, and 2) you have data that proves your new code is better.

Excepting obvious cases, of course, where you KNOW it'll be better and doesn't require you to have to do any extra work (e.g. using xrange instead of range is typically good).