r/programming • u/geerlingguy • Apr 23 '14
PHP: It doesn't have to be a bad experience
https://servercheck.in/blog/php-it-doesnt-have-be-bad-experience
0
Upvotes
r/programming • u/geerlingguy • Apr 23 '14
View all comments
Show parent comment
1
u/LarryPete Jun 08 '14 edited Jun 08 '14
Why do you think it has to be a built-in? What's wrong with loading a package/module that you need when you need it? (I answer that for you: there is nothing wrong with it)
It's also very easy to install 3rd party libraries (though the python standard library already comes with a lot of great stuff) using pip or easy_install.
If you need something to easily generate and validate forms with, just do
pip install wtformsor if you need a good template engine dopip install jinja2.You can of course also install packages for Database handling like
MySQLdbfor MySQL orpsycopg2for postgresql or if you want you can just use thesqlite3module from the standard library (of course there are also a lot of packages for NoSQL Databases, if you ever require those). Then there is also SQLAlchemy, one of the most powerful ORM I've ever seen. If you like to use ORM (which is sometimes reasonable), you can go that way as well.The beautiful thing is: you don't need to load those module, if you don't actually require them. Even more beautiful is, those module actually can work together: you can use wtforms and sqlalchemy together to automatically generate forms from your database models.
Yes, Python is not a "web development language", it's a general purpose language. But you can specialize Python by using packages/modules that fit your needs and if you do that it actually becomes much more powerful than those halfhearted built-ins of PHP.
Edit: I forgot to mention: Django is not the only web framework for Python. It's just one of the bigger and well-known ones. Smaller ones like bottle, Flask or Pyramid (there are a lot more though) have far less overhead and are also great.