Hacker News new | past | comments | ask | show | jobs | submit login

1. storing state in the module, or the singleton pattern in general, is not going anywhere for a long time. He describes his problems with it at

http://lucumr.pocoo.org/2009/7/24/singletons-and-their-probl...

and does so very well, but a lot of these criticisms directly stem from python treating modules as objects. that's not going to change.

2. I'm not a python programmer by day, but I found the @route('/') decorator kind of cute. It looks like the kind of syntax Ruby people drool over, with the double meaning of the @ character being cleverly referenced and the potential ability to specify multiple routes by repeating the decorator.

3. Similarly, I imagine that ruby-minded folk would not find the idea of automagic function detection and liberal introspection to be so horrifying. It's just how some people roll...




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.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: