Flask vs PHP: What are the differences?
What is Flask? a microframework for Python based on Werkzeug, Jinja 2 and good intentions. Flask is intended for getting started very quickly and was developed with best intentions in mind.
What is PHP? A popular general-purpose scripting language that is especially suited to web development. Fast, flexible and pragmatic, PHP powers everything from your blog to the most popular websites in the world.
Flask belongs to "Microframeworks (Backend)" category of the tech stack, while PHP can be primarily classified under "Languages".
"Lightweight", "Python" and "Minimal" are the key factors why developers consider Flask; whereas "Large community", "Open source" and "Easy deployment" are the primary reasons why PHP is favored.
Flask and PHP are both open source tools. It seems that Flask with 44.8K GitHub stars and 12.6K forks on GitHub has more adoption than PHP with 23.7K GitHub stars and 5.5K GitHub forks.
According to the StackShare community, PHP has a broader approval, being mentioned in 8868 company stacks & 2867 developers stacks; compared to Flask, which is listed in 502 company stacks and 509 developer stacks.
As for why we didn't pick the other languages, most of it comes down to "personal preference" and historically grown code bases, but let's do some post-hoc deduction:
Go is a practical choice, reasonably easy to learn, but until we find performance issues with our NodeJS stack, there is simply no reason to switch. The benefits of using NodeJS so far outweigh those of picking Go. This might change in the future.
PHP is a language we're still using in big parts of our system, and are still sometimes writing new code in. Modern PHP has fixed some of its issues, and probably has the fastest development cycle time, but it suffers around modelling complex asynchronous tasks, and (on a personal note) lack of support for writing in a functional style.
We don't use Python, Elixir or Ruby, mostly because of personal preference and for historic reasons.
Rust, though I personally love and use it in my projects, would require us to specifically hire for that, as the learning curve is quite steep. Its web ecosystem is OK by now (see https://www.arewewebyet.org/), but in my opinion, it is still no where near that of the other web languages. In other words, we are not willing to pay the price for playing this innovation card.
Haskell, as with Rust, I personally adore, but is simply too esoteric for us. There are problem domains where it shines, ours is not one of them.
Node continues to be dominant force in the world of web apps, with it's signature async first non-blocking IO, and frankly mind bending speeds. PHP and Python are formable tools, I chose Node for the simplicity of Express as a good and performant server side API gateway platform, that works well with Angular.
Both PHP and Python are free but when it comes to web development PHP wins for sure. There is no doubt that Python is a powerful language but it is not optimal for web. PHP has issues... of course; but so does any other language.
Another reason I chose PHP is for community - it has one of the most resourceful communities from the internet and for a good reason: it evolved with the language itself.
The fact that OOP evolved so much in PHP makes me keep it for good :)
Sign up to add or upvote prosMake informed product decisions
Sign up to add or upvote consMake informed product decisions
What is Flask?
What is PHP?
Need advice about which tool to choose?Ask the StackShare community!
Sign up to get full access to all the companiesMake informed product decisions
Sign up to get full access to all the tool integrationsMake informed product decisions