60 ms·
These criticisms look to me like you are trying to use your Java programming style in Python. Prefer to use modules and tables of functions as an organising pr
by GlennS 8y ago
These criticisms look to me like you are trying to use your Java programming style in Python.
Prefer to use modules and tables of functions as an organising principle instead of classes.
Use inheritance rarely, and method overriding almost never. Otherwise you can make a really big mess (see Django's Form class hierarchy).
This sort of bad design where you have the flow of control jumping up and down the inheritance hierarchy happens in Java too, but the `abstract` keyword and static typing makes it easier to avoid.
In Java, make your code regular, so someone can understand the piece they're looking at without too much context.
In Python, make your code interesting. Factor out the unimportant repetitive parts, so someone can see a lot of the big picture all at once.
Incidentally, I'm quite happy with print() in the top-level namespace. Java's logging situation (5 widely used logging frameworks and a 6th to abstract over them all) is not better.
- devxpy 8y ago> Django's Form class hierarchy I personally liked it. It is a little overwhelming at first, but after you get used to it, it's actually quite powerful.