4 ms·
I've made the switch from PHP to Python and don't really want to look back. Python is generally much better thought out from an object oriented perspective. Pa
by stevenwei 17y ago
I've made the switch from PHP to Python and don't really want to look back. Python is generally much better thought out from an object oriented perspective.
Package and module imports are a lot saner in Python. I'm glad I'm no longer messing with require_once, autoloaders, and all sorts of functions polluting the global namespace.
Python having first class functions and classes makes a whole lot more sense to me. PHP's call_user_func_array and passing around string names of classes and functions for callbacks is just so ugly.
In terms of web framework experience I was using Symfony in PHP and switched to Django for Python. I liked both, but I've found that Django is easier to use. I'm not a big fan of Django's templating language though compared to Symfony (which was just straight PHP).
- mcpherrin 17y agoPHP is, essentially, a souped up templating language, so I'm really not surprised you prefer it. Django's templates aren't bad though, even if a little awkward at times.
- stevenwei 17y agoIndeed. It just seemed a little restrictive not to be able to use some basic Python operators from within a template. Why invent a separate awkward syntax when Python itself is perfectly suitable?
- ygd_coder 17y agoThe idea was so that a web designer who didn't know any programming could easily edit it.
- stevenwei 17y agoInteresting. I wonder how well that has worked out in practice. Seems to me like any designer smart enough to get comfortable with Django's templating language probably wouldn't have any trouble getting comfortable with Python itself! It's not like you'd ever do anything particularly complicated (programming wise) from within your templates anyway.
- jacquesm 17y agoThere are some very neat fixes to the more glaring issues with Djangos templating language, for instance the if statement. edit: more digging: http://www.djangosnippets.org/snippets/1350/ http://www.djangosnippets.org/snippets/1350/
- andrewtj 17y agoif's been upgraded in 1.2 to be significantly more useful: http://docs.djangoproject.com/en/dev/releases/1.2-alpha-1/#smart-if-tag http://docs.djangoproject.com/en/dev/releases/1.2-alpha-1/#s...