Adventures As Me


The snake and the PHP

Written 03 Feb 2004

Recently, Jon Lim ported his ADODB DB Abstraction layer from PHP to Python. During the process he learned a few things, that he decided to share.

What I find particularly fun is the subtle nuances from one language to the other. While many of the nuances are subjective, others depend on objective matters. For example, Jon couldn't easily find a feature like htmlspecialchars so he created his own. However, in the comments one reader noted:

See cgi.escape() or escape and quoteattr from the xml.sax.saxutils module. I agree that this should be easier to find and there are moves to gather the common web stuff into a top-level, standard package. See the web-sig on python.org for more.

Having worked in both languages myself one thing I can say is the documentation is much better for PHP. The clear language and user comments outshine the documentation for Python. It enables one to quickly find and use what you want. Many times I've hunted through Python's documents and module listings to find what I want. If someone were to reorganize the Python documentation and allow user comments I think it would do much to help developers.

Related Posts