Need advice about which tool to choose?Ask the StackShare community!

Flask

12.1K
9.9K
+ 1
1.4K
PHP

98.4K
43.8K
+ 1
4.5K
Add tool

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.

Decisions about Flask and PHP
Timm Stelzer
Software Engineer at Flexperto GmbH · | 18 upvotes · 115.5K views

We have a lot of experience in JavaScript, writing our services in NodeJS allows developers to transition to the back end without any friction, without having to learn a new language. There is also the option to write services in TypeScript, which adds an expressive type layer. The semi-shared ecosystem between front and back end is nice as well, though specifically NodeJS libraries sometimes suffer in quality, compared to other major languages.

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.

See more
Kyle Harrison
Web Application Developer at Fortinet · | 17 upvotes · 120.5K views

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.

See more
Octavian Irimia

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 :)

See more
Pros of Flask
Pros of PHP
  • 297
    Lightweight
  • 257
    Python
  • 207
    Minimal
  • 140
    Open source
  • 95
    Documentation
  • 62
    Easy to use
  • 51
    Easy to setup and get it going
  • 51
    Well designed
  • 45
    Easy to develop and maintain applications
  • 43
    Easy to get started
  • 15
    Beautiful code
  • 14
    Rapid development
  • 12
    Powerful
  • 12
    Expressive
  • 11
    Awesome
  • 10
    Love it
  • 10
    Speed
  • 9
    Simple to use
  • 9
    Flexibilty
  • 8
    Get started quickly
  • 8
    For it flexibility
  • 8
    Perfect for small to large projects with superb docs.
  • 7
    Flexibilty and easy to use
  • 7
    Easy to integrate
  • 7
    Productive
  • 6
    Customizable
  • 6
    Not JS
  • 5
    Secured
  • 5
    User friendly
  • 5
    Flask
  • 3
    Unopinionated
  • 937
    Large community
  • 800
    Open source
  • 754
    Easy deployment
  • 480
    Great frameworks
  • 384
    The best glue on the web
  • 230
    Continual improvements
  • 180
    Good old web
  • 141
    Web foundation
  • 130
    Community packages
  • 123
    Tool support
  • 31
    Used by wordpress
  • 30
    Excellent documentation
  • 25
    Used by Facebook
  • 23
    Because of Symfony
  • 16
    Dynamic Language
  • 14
    Awesome Language and easy to implement
  • 12
    Fast development
  • 11
    Cheap hosting
  • 11
    Very powerful web language
  • 9
    Flexibility, syntax, extensibility
  • 9
    Composer
  • 9
    Because of Laravel
  • 7
    Easy to learn
  • 7
    Short development lead times
  • 7
    Worst popularity quality ratio
  • 7
    Fastestest Time to Version 1.0 Deployments
  • 7
    Readable Code
  • 6
    Easiest deployment
  • 6
    Fast
  • 6
    Faster then ever
  • 5
    Most of the web uses it
  • 4
    Open source and large community
  • 4
    I have no choice :(
  • 3
    Easy to learn, a big community, lot of frameworks
  • 3
    Is like one zip of air
  • 3
    Has the best ecommerce(Magento,Prestashop,Opencart,etc)
  • 3
    Cheap to own
  • 3
    Simple, flexible yet Scalable
  • 3
    Easy to use and learn
  • 2
    Hard not to use
  • 2
    Large community, easy setup, easy deployment, framework
  • 2
    Safe the planet
  • 2
    Walk away
  • 2
    Great flexibility. From fast prototyping to large apps
  • 2
    Used by STOMT
  • 2
    Great developer experience
  • 2
    Open source and great framework
  • 2
    Fault tolerance
  • 2
    FFI
  • 2
    Interpreted at the run time

Sign up to add or upvote prosMake informed product decisions

Cons of Flask
Cons of PHP
  • 10
    Not JS
  • 7
    Context
  • 3
    Not fast
  • 19
    So easy to learn, good practices are hard to find
  • 16
    Inconsistent API
  • 8
    Fragmented community
  • 5
    Not secure
  • 2
    No routing system
  • 1
    Hard to debug
  • 1
    Old

Sign up to add or upvote consMake informed product decisions

What is Flask?

Flask is intended for getting started very quickly and was developed with best intentions in mind.

What is PHP?

Fast, flexible and pragmatic, PHP powers everything from your blog to the most popular websites in the world.

Need advice about which tool to choose?Ask the StackShare community!

What companies use Flask?
What companies use PHP?

Sign up to get full access to all the companiesMake informed product decisions

What tools integrate with Flask?
What tools integrate with PHP?

Sign up to get full access to all the tool integrationsMake informed product decisions

Blog Posts

Oct 3 2019 at 7:13PM
https://img.stackshare.io/stack/511159/default_5f04358e03a27bf2607a39dd9b409dd7830ce4d3.png logo

Ably Realtime

JavaScriptPythonNode.js+8
4
3127
GitHubPythonNode.js+47
43
67726
What are some alternatives to Flask and PHP?
Django
Django is a high-level Python Web framework that encourages rapid development and clean, pragmatic design.
Tornado
By using non-blocking network I/O, Tornado can scale to tens of thousands of open connections, making it ideal for long polling, WebSockets, and other applications that require a long-lived connection to each user.
ExpressJS
Express is a minimal and flexible node.js web application framework, providing a robust set of features for building single and multi-page, and hybrid web applications.
Node.js
Node.js uses an event-driven, non-blocking I/O model that makes it lightweight and efficient, perfect for data-intensive real-time applications that run across distributed devices.
React
Lots of people use React as the V in MVC. Since React makes no assumptions about the rest of your technology stack, it's easy to try it out on a small feature in an existing project.
See all alternatives
Interest over time