Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What should people new to Python know about its community and ecosystem? [closed]

I think one of the most important thing a beginner need to know about Python ecosystem is that it's a general purpose language surrounded by specialized libs. Experienced pythonistas know them, but a newbie can't:

  • Don't stop to tkinter : go wx, gtk or qt.
  • Don't dev web code by hands : use TurboGears, Pylons, Web.py or Django.
  • Don't parse HTML / XML with hard tools : use lxml or beautifulsoup.
  • Don't make syscall to imagemagik : use PIL.
  • Don't make advanced maths manually : use NumPy and SciPy.
  • Don't access simple databases by hand : use ORM like SQLAlchemy.
  • Don't reinvent sysadmin wheels : use Fabric.
  • etc.

The main ones should be listed in a book with guidances to choose among them.


"What confused you the most when you just started out with Python?"

Rule 2 of learning Python: Any general-purpose module or framework you think you want has already been written. Several times.

The hard part is realizing that your idea is

  1. Not unique.

  2. Been already improved upon before you even starting thinking about it.

  3. Already posted somewhere.

So, code less and search more. Search widely and flexibly until you find things that are similar to what you want to do.

  • Realize that you might have a name you think is descriptive. But other folks may call it something different. Join the community, adopt their naming. You may not like the phrase "ORM", but that's what it's called.

  • Realize that your idea, no matter how sound it seems, may be really poor. When you find a framework that seems to have "needless extra features", you may be missing something from your idea.

  • Realize that your idea, no matter how "intuitive" it seems, may be really poor. When you find a framework that seems "counter-intuitive", the problem could be yours. Learn theirs first, then compare and contrast after you've mastered theirs. Until you've mastered theirs, keep searching and learning.


A few points related to the ecosystem and indirectly the community:

  • I wished I had been reminded more about the Batteries included. I think people should be told to print-out the Table of Contents of the Standard Library and keep it under their pillow, for frequent reviews (that advice, I finally took, several years into it, from an online intro/beginner's video presentation!). The [relative] stability, extensive but relevant content of the Std Lib speaks to the thoughtful governance of the community leaders and its beloved BDFL.

  • I think newcomers can also be "warned" (the word is maybe too strong, too unfair) about the extreme variety of PiPy. This reflects the vibrant, smart and diverse (in terms of background, domain of application, interests...) collective of users and contributors. This however can be overwhelming and possibly risky as all packages in there are not "prime time ready" (But many are and "saved my life" many times over).

  • Even if you feel too new to Python, don't only use the libraries, do peek under the hood! This is true of many languages, but maybe particularly of Python, there's much to be learned from perusing various source code. The reasons this may be particular true for Python are intrinsic to the language itself (multi-paradigms, hi level of abstraction...) but also because of the relative uniformity of coding (and architecting) style and because of the general level of collaboration within the community.


"What confused you the most when you just started out with Python?"

Rule 1 of learning Python: Use the Source, Luke.

There are question on SO asking for "good" source from which to learn Python. The best answers amount to "read the libraries that came with Python."

One can say that the libraries that come with Python are quirky. In places. Which makes them all the better for learning from.

  1. There's a community of like-minded people who are not clones.

  2. Open source software is the highest-quality software you'll ever get to work with, but it's not created by paid developers who will rigidly enforce standards.