Q: Why should I learn the combination of Python/Django rather than PHP, JS/Node? I am a web designer moving to web development. What is the scope of Python/Django?
Python/Django is like learning Ruby/Ruby on Rails. The equivalent in the PHP world would be PHP/Drupal or PHP/Laravel. Equivalents in NodeJS is not Node/JS but NodeJS/Meteor or NodeJS/Sails. In all those examples above the first part would be the underlying web language, and the second would be a MVC framework on top of the language.
(There exist web frameworks that do not provide MVC but just the web server and HTTP request-response plumbing. This isn’t common in PHP since it is embedded in a web server such as Apache or nginx, but in Python it would be flask and in NodeJS it would be Express or Koa— these are sometimes referred to as “microframeworks.”)
MVC web-frameworks still provide things such as a configuration management, a data object model and abstraction, but even those can get in the way as a website becomes more mature and this pre-fab approach becomes a hinderance to future scalability and optimization.
Also, when not building to scale or building proof-of-concept, a full MVC architecture will help you starting out on server-side web development because it does all the heavy lifting for you. So it might be good to start out with one, though YMMV (your mileage my vary).
As for why you should learn Python/Django over other language/framework combinations, assuming you want to pick your poison by adopting a back-end MVC framework to do back-end development…
Vs. PHP/insert mvc framework. Python as a base language has more overall utility than PHP. DevOps (the third missing coding component in your arsenal) uses either Python or Ruby as the base language so it is useful to have one or the other under your belt. Also Drupal and Laravel adoption is unusually low footprint in the PHP web development space because PHP is a web-development-only language and because applications such as WordPress, MediaWiki, and the like, written in PHP, are their own frameworks for the app markets they serve. Also, PHP’s development philosophy of being “shared-none” and “web glue” is antithetical to a MVC framework—which is kind of like a pre-fabricated house.
Vs. any others? If I’m being 100% honest, if you were to learn a web language/MVC framework combination as your introduction to server-side web development, I recommend Ruby on Rails over all of combinations you mention. It’s very mature, it has a massive saturation in its community (Ruby), and there are far more sites/job opportunities using this platform than any other web framework. Finally you can learn Ruby on Rails first and then Ruby “as you go” whereas other frameworks are heavily weighted to learning the language before the framework.
Having said that, I think Python/Django is a close-second and has the advantages of being in Python, a better learning/teaching language and being more powerful if you are doing data work down the road.
Response to the Django dickhead who called my answer “startlingly ignorant.”
Yes, I’m so “startlingly ignorant” that I’ve been a professional web engineer/architect/manager for almost 20 years on some of the largest projects on the internet, including two of the top 10 largest web properties.
I’ve also coded commercially in Ruby on Rails, Python/Django, as well as in NodeJS and GoLang. However, unlike you, I didn’t recommend against Python/Django, nor did I promote my preferred (web) language. I don’t proselytize a particular language or framework religion, but consider them architectural design choices and work within them.
I obviously wasn’t advocating against using MVC as a pattern, I was against blindly advocating using an MVC embedded in a framework at scale or with a site built with an API-first approach, which is increasingly more common. Even those two top 10 websites I worked at, old as they are, don’t use any of the frameworks mentioned, but they do use MVC in their own framework (WordPress for WordPress.com and MediaWiki for Wikipedia).
In fact, at scale, for every example of a successful use of a MVC monolithic framework (like Instagram using Django), I can come up with a similarly-sized one not doing so (Instagram’s owner, Facebook itself) AND one using a non-MVC micro-framework (like Pinterest which uses Python/flask).
BTW, even today, PHP outnumbers Python and Ruby combined in usage on the web at both scale (top 100 or top 10 sites by traffic) and overall (27% of all domains on the internet are powered by a single PHP application, WordPress), so it is hardly “dead.”
As for Python, I code in it, I think it’s a great language. I’ve actually been advocating it as the best teaching language for over a decade. If someone is coming from an ops background or a data science background I’d recommend they continue to use it when migrating to the web. In many cases, I’d even point them to Django over Flask. Yes, Python’s star is rising, but that has been because of data science and cloud computing and not because of Django.
Fuck you and your Python-uber-Alles religion. (And yes, when someone is PHP-uber-Alles, I shit on them too. I’m not going to hold take a bullet to my head to build a similarity score model in a language that doesn’t have anything like NumPy just because I happen to prefer PHP to connect a database to the web.)