What's not trending on twitter
Now, I don't know about you. But looking at repetitive code drives me nuts.
It's physically painful. With some mental and emotional pain mixed in.
I think this is actually a trait of good programmers. When we look at code that repeats itself, in ways it doesn't have to... And we get a bad feeling that we have to make go away... Of course we'll end up with better quality code.
Code that is more powerful in how it's expressed and organized. More adaptable.
And Python provides, for our righteous resistance to repetition:
- Its object system. I have a lot of things to tell you about that, in the coming weeks.
- Its function abstractions. A Python function is an ordinary object, which lets you do magic if you know how.
- Its exception system. So much deeper than people realize. I swear I could write a thick book just about exceptions in Python.
- Generator functions. Man, this feature is awesome.
- Decorators. Which are kind of my favorite, because they let you avoid patterns of code reuse you can't dodge any other way.
The only question is: with so many powerful tools to learn, where do you start?