Flask Thread

*improves your backend development experience*

Attached: 1200px-Flask_logo.svg.png (1200x470, 60K)

Other urls found in this thread:

techempower.com/benchmarks/
mojolicious.org/
blog.aquameta.com/2015/08/28/introducing-aquameta/
twitter.com/NSFWRedditGif

I can hardly imagine real world backend development experience in a programming language with dynamic typing.

I use flask all the time in one-off hobby projects though.

what about that is difficult to imagine?

> just spend 3 times the effort for testing because muh dynamic types

he had this thread few days ago. flask and Python suck gigantic gorilla dick for anything bigger than a simple toy app or small application.

Flask is designed for small applications.
At work I ended up using it to make a little web page that displays server information, it was very quick and painless. Have you ever used it?

yes I have. nothing you said conflicts with what I said.

Huh, well that's a first.. So uhh.. Do you like anime?

Flask is scalable.
If you had problems scaling your app it's probably because you didn't think enough about design.

Attached: 1546498036658.gif (1280x720, 3.64M)

Dynamic typing is only an issue if you suck at programming. If that's the case there are type hints built in to hold your hand.

def retard(name: str, age: int, data: dict) --> Dict:
example_dict = {}
# do something
return example_dict

>Python suck gigantic gorilla dick for anything bigger than a simple toy app or small application.
Wrong. Instagram, Pinterest, and many other sites run on Python (Django). If you're having issues scaling Python it's because you're bad.

hey i am learning flask right now. I have build basic flaskr app from official tutorial. I think i now most of it now.
What project should i do? which will look good in my resume?

>YouTube

>Guaranteeing correctness means you suck
Some solid logic here

This fucking blows my mind.
There are so many convenient, efficient programming languages available for backend webshit. Why would willingly pick a scripting language?

because languages like C++ just don't have an equivalent to Flask.
seriously, they're all ginormous, overengineered pieces of shit, that often don't even have the same features (or even performance!) as flask while being 1000x more effort to write in.

It makes sense when you consider there is a generation of developers raised on JS and Python and have no exposure to languages with an ML like type system.

Sure, not the same performance as flask and its glorious #274 spot techempower.com/benchmarks/

Now tell me one of those that has as much web tooling that is as simple and well documented that does not involve soiling your server with the JVM.
I do know cepples so if there is any toolkit I missed on I'm all ears.

You should know by this point hardware is cheaper than developer time. Also I fucking dare you to expose a LWAN web service to the public internet.

why not try mojolicious.org/

>let me add arbitrary requirements until I'm done dismissing the 273 perfectly valid technological choices that beat using a scripting language on the backend
Sorry I may be arguing with retards on Jow Forums but I still have stuff to do at some point today

>"better performance"
>proven wrong
>but performance doesn't matter!
It's all so tiresome

>I need my programming language to hold my hand

because webshit is 90% CRUD so the heavy lifting is done by RDBMS

Serious question: why would you choose flask over Falcon?

>spends 10 times longer debugging type related errors

What are you talking about? On large projects, it is impossible to catch every typing mistake. Notice that every dynamic language has is saturated with half-baked linters. Simon Peyton Jones is an incredible programmer, and he has mentioned multiple times that he relies on the GHC's internal linter to catch bugs.
Typing is a simple, repetitive task which should be left to the computer, with an optional backdoor (i.e. C#'s dynamic type). 99% of the time, there is no reason for me to do the type-checking work in my head.

it's not, but it's also not difficult to imagine a insecure, slow and buggy website.

This is a meme. Worst that happens is I have to change an int to a str, or str to an int.

>there is no reason for me to do the type-checking work in my head
On the other hand I think someone sucks if they don't immediately see types of (appropriately) simple expressions. Often there are functions that you could write looking almost only at types (these tend to be very general functions often included in libraries).

At work, we just changed 20,000 lines with a 100 line Python script. It worked great except for a type error which wouldn't have been caught in something like Ruby.

Tell me how you find out which int you have to change in a 5k lines code base. Sure, when it's 50 lines you probably see it at a glance. I don't have any experience with big projects in dynamically typed languages so feel free to respond seriously. Also note that if you actually always get your types right then the typechecker will never show you any errors so it will never slow you down.

If it blows your mind, you haven't lived enough, feller. The reason for newfag devs is that they are ignorant. The reason for seasoned devs is, first and foremost, libraries; second, having to manage newfag devs.

I don't get ye flask

>so many convenient, efficient programming languages available for backend webshit
By this I assume you mean SQL. If you're using a RDMS and stored procedures, practically anything works for the presentation layer.
If you mean Go or Rust or Haskell or whatever, you're a meme.

>insecure
Has nothing to do with the language.
>slow
Has nothing to do with the language.
>buggy
Typing only helps prevent some of the issues bad developers will make.

dynamic typing introduces a ton of potential security risks that must be mitigated in other ways, and are easier to fuck up. Especially in webservices.

>all programming languages have the same performance
are you fucking dumb?

I'm not the same person dumbass. And everyone knows developers are expensive enough as they are.

There are some applications where latency matters more than total throughput. In those instances throwing more hardware at the problem cannot solve it.

I've seen some talks from people who program high frequency trading programs, and the're autistic about single-core performance.

>runs like molasses requiring horizontal scaling, using many servers just to render a blog

>One (1) retirement
>Arbitrary requirements
Enjoy your Java then.

I know, and and that's what cffi or RPCs to an executor process are for. Number crunching needs a different programming approach but why should the shitty REST API wrapper be done in fucking C++?

>REST API wrapper be done in fucking C++?
Well I use Golang, and the reason I do it (beyond just inherent performance) is the peace of mind of knowing that my int doesn't secretly contain some unsanitized string. I don't want to cast or sanitize my ints, either.

Elixir/Phoenix. Not sure why you hate the JVM, though.

>webshit
>pythron
lmao

SQL is literally the only language you need for backend development. And I literally mean "literally".
blog.aquameta.com/2015/08/28/introducing-aquameta/

Totally agree. Was transferred on a project with backend running on aiohttp and it's fucking hell. Flask is great for hobby projects though.

All these sour CS grads trying to shittalk python. Typical. Have fun sucking eachothers' dicks in your offices.

Nobody uses flask in enterprise. Try to find a working websocket addon at least. I didn't touch flask for a few years, but last time I did addons were breaking with each python update.

That's pretty much the confirmation they know, they fucked up

>Pure SQL backend

Attached: ed5.png (201x160, 34K)

so was the retard who wrote 20k LOC instead of a bash script fired??

golangs error control is awful tho

Fuck your python trash, this is the real king.

Attached: everything-must-know-spring-boot-application-scratch_12.jpg (700x420, 17K)

>synchronous, blocking web servers in a language where it's difficult to properly do multithreading

No no. I didn't explain well. We have 20k of Java and needed to change something, and we used a 100 line script to do it.

>a language where it's difficult to properly do multithreading
brainlet detected

>Tell me how you find out which int you have to change in a 5k lines code base.
>ERROR ON LINE 324239489
gee, which line is causing me this problem, I guess I'll have to look though the entire codebase to find it :(

GIL?
what are you implying?

you mean checking if err != nil? I don't think it's bad. If you're comparing it to exceptions in Python, they're not really considered flow control and they're considered bad practice (especially in languages outside of Python).

uh usually the user finds a bug because the program was not properly tested and he won't be able to give you enough information to understand the problem
any language with type or syntax errors at runtime shouldn't exist

here, a real world example I made one of my bigger projects throw an error on purpose

Attached: file.png (652x259, 12K)

>and he won't be able to give you enough information to understand the problem
pasting the error log is enough in most cases, the user doesn't have to understand anything
>any language with type or syntax errors at runtime shouldn't exist
you shouldn't exist

Routes are easy to write, auth is easy to implement, I get to write pure python (which I like) or use it as a wrapper for something completely different on the system. Hooking it up to a DB (with proper auth) is also very simple to do. By the time you have a finished product it isn't littered with third party dependencies.

>line number + text of line + all previous calls leading up to the error
WTF literally impossible to debug, dude, that's going to take hours

It says the line right there? What's the problem?

you have to understand it not the user
and you are assuming the user can copypaste or is going to do it before closing the program...
you might also not be able to update like in embedded systems

stop posting bait dumb faggot

also I wouldn't use it for a client side app.

javascript is dynamic

>I can hardly imagine real world backend development experience in a programming language with dynamic typing.
>
>I use flask all the time in one-off hobby projects though.
How many real projects do you work on then? Because I have dealt with plenty of commercial code that uses dynamic typing. It can be a nightmare at times, but people use it anyway.

I really hope it takes off.

>Nobody uses flask in enterprise
Fuck really
Is php any good i can see a lot of job postings in my area compared to nodejs and python web dev.

>I can hardly imagine real world backend development experience in a programming language with dynamic typing.
HA. HA HA. HA HA. Ha. Oh oh, youre serious.

>still at 0.2 three years later
It's dead, Jim.

>Ugly logo
>Ugly font
Yeah, this is worse than shit

The fact that 0.2-rc1 came out in 2019 is how you know it's dead.

Based and perlpilled

>Typing only helps prevent some of the issues bad developers will make.
Yes retard, that's the point. Typing helps prevent errors developers will make.

>what is mypy

So basically flask is a no go for huge websites e.g. crowdsourced websites?

based and redpilled

Spring is the epitome of bluepilled. It's 100% Mr. Anderson and 0% Neo.

I made a Jow Forums clone with flask

>called from line 2391
>called from line 2392
>called from line 3924
>called from line 4523
>called from line 1534
>called from line 532
>called from line 134
>called from line 20
Fair enough though, at most around 20 functions to check. And some typed languages have similar chains of errors in types due to the order of type inference (primitive systems like in OCaml, fuck OCaml). I still don't see the point of deferring type errors to runtime.

I feel like this thread is a bit hostile...
so if you dont want to read all the negative comments i made you a TL;DR

>Python != C
>Python != Perl
>Python != Java
>Runtime is not as fast as compiled
>"I like Flask!" "Oh yeah? Why not use [insert other framework that is nothing like Flask] instead?
>Frameworks that are built to be the fastest are faster
>"I do not like Python, therefore there is NO legitimate use or userbase for it!"
>"I once pythoned... AND I DIDNT LIKE IT!"

Attached: 1422124510490.jpg (500x500, 36K)

Ofbfucking course.
Python has problems dealing with huge ass concurrent streams of data because it doesnt evoke new processes for single users like php does.
A python website is good and all until you have to deploy it to thousands of people and it shits the bed