Conversation
Edited 4 months ago

wow I’m ngl FastAPI seems like an improvement over Flask in every way where it isn’t exactly the same:

  • it has a really nice way of getting request parameters by making them the arguments of your function that handles the request (they will be automatically converted to the right types - including weird types like frozenset[bool])
  • also it automatically validates those request parameters and you can give it all kinds of cool hints about what form the parameters should take (including minimum and maximum numbers, max lengths, etc.)
  • it lets you automatically set up an error page in case the request parameters fail to validate, and this same system can be used to handle any exception raised when responding to a request
  • also it’s way faster
  • and it has proper async
  • and it has a really nice simple lifetime management system so that you can clean things up before it exits. whereas I don’t think flask has a way to run code right before exiting at all?

idk why anybody even uses Flask lol this is so much better

1
0
2

@kasdeya solid documentation and loads of history... Flask is just familiar and well known. Doesn't mean it's the absolute best at the job.

1
0
1

@shijikori that’s very fair tbh. I do have to admit that FastAPI’s documentation isn’t super great. it’s a relatively thin layer over another framework called Starlette and you often have to flip between docs for Starlette and docs for FastAPI in order to figure out how stuff works

1
0
0

@kasdeya it's interesting though. I have found myself with time on my hands (plenty of it) again. I'll see what stuff I'll make out of that time (besides cooking)

1
0
1

@shijikori oh - do you have any ideas of what kind of stuff you want to work on?

1
0
0

@kasdeya I gotta get back to my D&D character manager. I've been putting it off because I constantly over think the structure of the program.

1
0
1

@shijikori omg is it going to be like an electronic character sheet? that sounds like such a cool project. is it going to be a webapp, or something that people install?

1
0
0

@kasdeya TUI in C# is what I'm thinking. Yeah, essentially e-Character Sheet. I'm just trying to keep myself from basically making a simulation engine. If I find a good way to make a GUI, I might look into that.

1
0
1

@shijikori that sounds like a really cool project - I hope it goes well! although I can completely understand how it can be overwhelming, given that there are basically infinite possibilities for what the user might want to track

1
0
0