Category: One Step
-
“Range len”, the anti-pattern

One step further on the way of Python: don’t count to get, just get. A common anti-pattern used by Python beginners is the “range len” pattern. I’m pretty sure you already encountered this anti-pattern in the past, and there is even a high probability that you have done it yourself. I did too ! Anti-pattern…
-
“Hidden and”, the anti-pattern

One step further on the way of Python: don’t hide “and” with “if” nesting. It’s very common to see nested “if” statements in code bases. And if the possibility to nest “if” statement make sense and can be very useful, there is a common anti-pattern easy to recognize and easy to fix. I call this…