3 ms·
1. storing state in the module, or the singleton pattern in general, is not going anywhere for a long time. Agreed. I think his general point was to avoid them
by moe 17y ago
1. storing state in the module, or the singleton pattern in general, is not going anywhere for a long time.
Agreed. I think his general point was to avoid them as much as possible, though - which is generally good advice.
2. I'm not a python programmer by day, but I found the @route('/') decorator kind of cute.
That was actually not one of the nasty parts but inherited from the underlying Werkzeug framework. This is how it's really done in many python frameworks.
3. Similarly, I imagine that ruby-minded folk would not find the idea of automagic function detection and liberal introspection to be so horrifying.
Yea well, you are right, it gets religious at that point.
Goes to show that even proper bad code is hard to write, I guess. ;-)
Introspection is generally heavily used in python, too, he's just carrying it a bit too far by looking at stack frames and such. This may indeed be a philosophical difference to ruby where the shortest code generally beats everything. In python we usually draw the line at the point where it would become hard to follow or debug a certain kind of magic.