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

This advice may make sense for some languages, but it certainly doesn’t make sense for Python.

Python generally provides one and only one best way to do things. With one exception (single quotes vs. double quotes) I can’t think of any cases where my company didn’t espouse or require using regular, idiomatic Python.

My company consistently preferred using expressive features do the language. For example, using list comprehension instead of for-loops.

After learning Python, reading up on the frameworks used at my company (Django and Django Rest Framework) would be the next best use of a new dev’s time.

This advice might be specific to Django and Django Rest Framework. Both frameworks are old, popular, and opinionated; other people have thought through the best way to do things.

Understanding all the packages in the standard library is by no means a requirement, but knowing the language itself backward and forwards pays enormous dividends when debugging.



The "one way to do it" slogan was useful when comparing to Perl (TMTOWTDI), as it highlighted different philosophies (understandable vs expressive). I think it is wrong to take it literally. There is many different ways of doing the same things in Python.


So which "one way" do you use to format output in Python?




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

Search: