DEV Community

Cover image for Day-6 Flask Server

Day-6 Flask Server

Pranjal Sharma on March 02, 2024

Hey, fellow code adventurers! Get ready to hop on the Flask, I am very excited to move to the next step, Today's Agenda- Introd...
Collapse
 
dyfet profile image
David Sugar

I lost all interest in Flask the day I learned ruby and sinatra. Sinatra is much more expressive and eliminates lots of boilerplate code. On average my sinatra version of a flask service was half the code, easier to read, and ran as fast. This is especially true with sql queries or converting json arguments.

Eventually I did move on from ruby to go because it is faster than either and sat somewhere in complexity between sinatra and flask for writing web service apis. But to me, flask is another ancient thing that should be abandoned, like the perl frameworks that existed before it.

Collapse
 
janmpeterka profile image
Jan Peterka

I recently moved from Flask to Rails for my apps. It's so much easier and cleaner!
I've already rewritten one of my apps, working on the second one.

But! I'm glad for my experience with Flask, as I have more understanding for what's happening "under the hood", and I tried writing some helpers and "magic" seen in Rails in Flask/Python. it was bit frustrating, but it makes me appreciate how well thought Rails is.

There is still value in Flask in my opinion - for small things, experimental things,..
But most of the time I'll prefer Rails from now on.

(Also, one of my pain points was ORM. I really didn't like SQLAlchemy, and didn't find much an alternative in Python space. SQLAlchemy 2.0 made it even worse. Maybe I just didn't understand some basic paradigm about it/data mapping, but I'm much happier with Active Record, which just seems so natural to define)

Collapse
 
dyfet profile image
David Sugar

Indeed. Sinatra is kinda like a mini-rails in Ruby, but the same points do apply. Active record is very intuitive, too. It, rails, sinatra, all touch upon what I like most about Ruby in general; being able to integrate different things into a solid and simple dsl, and then expressing the problem you are solving in just that.

Collapse
 
janmpeterka profile image
Jan Peterka • Edited

Also, I used Flask-Classful, which made it much more enjoyable!

Collapse
 
naikg profile image
Nagesh Naik

Nice