in Flask

Why I Like Flask

I’m a huge fan of the python micro framework Flask. Here are the reasons why.

Flask is built with python

The python programming language is a joy to use. It strives to be practical, intuitive, and concise. It is not clever. What do I mean by that? Some programming languages encourage what it is known as ‘code golf’ where multiple functions can be summed up in a single cryptic line of code. Python discourages this in favor of clean code and readability.

Python is popular across many communities, so whatever problem you have there is typically a python package available to help solve your problem.

Flask makes core web functions simple

At a high level, most web frameworks are doing the following:

  1. Map a route to a function
  2. Gather data and send it to a template
  3. Convert the template into regular HTML

With Flask, this entire process is easy:

Flask starts small

The smallest flask application is literally one file and seven lines of code:

This makes it ideal for writing small applications or simple micro services.

Flask can grow big

Through the use of extensions and blueprints, a flask application can grow just as big as a large Ruby on Rails or Django app. For example, the cookiecutter-flask template features user registration/login/logout, database migrations, caching, and tests.

Some may say ‘with all those features why not just use Django’? Django is awesome and it does a great job integrating a lot of components right out of the box. But I’m still more productive using Flask. That gets me to my last point.

Flask helps me get things done!

The main reason I started using Flask and never looked back, is because it does not get in my way. It’s like starting with a pile of legos, and each lego fits together well and you just keep stacking. Why try something else when it works so well?

I can clearly see where data is flowing in my application. This helps me track down bugs, and know what is needed to implement a new feature.

Write a Comment

Comment