Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

True, Python allows a lot of crazy hacks like monkeypatching, dynamically creating classes and so on. It is there if you need it. It is not like in Java where those things are simply impossible. The Python culture on the other hand discourages obscure hacks and unreadable cleverness, and the language is generally designed to encourage the straightforward and readable solution. I don't really see a contradiction in that.

You cannot prevent people from doing stupid things anyway. What you can do is encourage good style, and making the "right way" the path of least resistance. You can write readable code in any language, even Perl, if you use enough effort and discipline, but Python tries to make readable code the easy default.

The "quote" you made up is not representative of the Python culture or the article here, although I'm sure you can find some blogger somewhere with that attitude. They seem to have mostly migrated to other more hip languages though.



> The Python culture on the other hand discourages obscure hacks and unreadable cleverness

I guess Pandas, Matplotlib, SQLAlchemy, etc, etc didn’t get the memo.


GP's quotes are paraphrased from PEP 20 and I think _are_ put of Python culture, at least as I've experienced it.

https://www.python.org/dev/peps/pep-0020/


I'm afraid you've misunderstood olavk's point. 'The "quote" you made up' certainly refers to

> "here's this cool feature for doing something you could do a different way that looks like hieroglyphics and nobody understands but you should totally use it because it's awesome!"

not to

> "explicit is better than implicit" and "there should be one and only one good way"


Yeah that is what I meant, sorry for being unclear.


Doh, I think you're right!


You might be surprised at how many of those things are possible in a language like Java. Class loader and dynamic proxy tricks add a lot of power to the language.




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

Search: