Live data from Hacker News

Do you think writing backend with Python feels wrong?

news.ycombinator.com

1–10 of 17 posts

Do you think writing backend with Python feels wrong?

#1
Because I think like that.

I tried Django, Flask, FastAPI till now, maybe there is other frameworks that is good enough, but I only had experience with "production-ready" frameworks.

And it feels... wrong? I don't know why, but it feels like something is wrong.

In Django, I barely ever feel like coding. It was just writing config files, like I didn't feel like I was coding.

Same in Flask and FastAPI. Development is so quick that I literally don't feel like coding. I mainly worked with GoLang till now, reinvented so many wheels, ventured into so many libraries, it felt "fuck yeah I am codin we are ballin".

Python seems... too easy? You barely ever reinvent wheels, you have something in your head? Some freak made it a feature of FastAPI. "hey caner, can we do th....", yes you fucking can I don't even need to hear your question because a dude created a feature you wanted in Starlette. It is madness.

Another example, you need to write lines of lines comments and markdown files for Swagger documentation in GoLang, FastAPI does that for you.

Validators? Pydantic holds your hand.

Yes, I am literally bickering about writing less code feels so wrong.

But am I the only one?

edit: I don't say fuck python and it's frameworks, I have tons of fun with it. and it pays the bills right now, so.... just a discuss and steam off post.

Re: Do you think writing backend with Python feels wrong?

#2
I think as your backend grows larger you will likely begin to run into the issues that I experienced with Python through my years of writing it.

The dynamic typing eventually makes certain kinds of bugs creep into your code and it can be difficult to realise.

Code written in dynamic languages are also more difficult and time consuming to refactor than code written in a statically typed language.

Re: Do you think writing backend with Python feels wrong?

#3

I think as your backend grows larger you will likely begin to run into the issues that I experienced with Python through my years of writing it. The dynamic typing eventually makes certain kinds of bugs creep into your code and it can be difficult to realise. Code written in dynamic languages are also more difficult and time consuming to refactor than code written in a statically typed language.

Yes that is right too.

Dynamic typed languages always feels like I am 6 again, with my crayons all over the place, doing random bullshit go till something sensible comes out.

Good luck finding what is wrong if a bug occurs, good luck if you will refactor it and think how can you replace it, how can you rewrite it without destroying the whole aesthetic of the code. just like my parents trying to figure out how will they renew the wall after I draw a huge chunk of random shit to the wall with my crayons.

Re: Do you think writing backend with Python feels wrong?

#4

I think as your backend grows larger you will likely begin to run into the issues that I experienced with Python through my years of writing it. The dynamic typing eventually makes certain kinds of bugs creep into your code and it can be difficult to realise. Code written in dynamic languages are also more difficult and time consuming to refactor than code written in a statically typed language.

If he’s using FastAPI he is essentially forced to use typing and is probably running a static type checker

Re: Do you think writing backend with Python feels wrong?

#5
post #4

I think as your backend grows larger you will likely begin to run into the issues that I experienced with Python through my years of writing it. The dynamic typing eventually makes certain kinds of bugs creep into your code and it can be difficult to realise. Code written in dynamic languages are also more difficult and time consuming to refactor than code written in a statically typed language.

If he’s using FastAPI he is essentially forced to use typing and is probably running a static type checker

Even, it's only enforced in routing functions.

Outside of it, like utility packages, MongoDB or such so, you are not enforced, go with whatever you want.

...guess what my coworkers prefer! urgh.

Re: Do you think writing backend with Python feels wrong?

#6
Lol this is quite funny.

Can elaborate on “yes you fucking can I don't even need to hear your question because a dude created a feature you wanted in Starlette”? Just for my amusement.

Also, if you haven’t yet tried Pydantic V2 you should give it a shot. It doesn’t work with FastAPI yet but I think your mind will be blown at how many absurdly complicated things “just work”.

Re: Do you think writing backend with Python feels wrong?

#7
Java has the advantages that it fully supports threads, I've seen JVM back ends hold up under heavy load. It is often possible and sometimes easy to get a 7.5x speedup on an 8-core machine with Java.

I write a lot of backend code using aiohttp in Python for my own side projects, it is really a blast, particularly if the code is "more than a web server", say it is listening to message queues, connected to something like Denon's HEOS API which is asynchronous, and also offering websocket endpoints.

I know some organizations with >5 coders seem to find pip is Kryptonite though.

Re: Do you think writing backend with Python feels wrong?

#8
post #6

Lol this is quite funny. Can elaborate on “yes you fucking can I don't even need to hear your question because a dude created a feature you wanted in Starlette”? Just for my amusement. Also, if you haven’t yet tried Pydantic V2 you should give it a shot. It doesn’t work with FastAPI yet but I think your mind will be blown at how many absurdly complicated things “just work”.

Yeah I know, even smallest feature "json schema" made my jaw drop in Pydantic. Maybe we had it in V1 too, but it works so seamless now, especially too useful with MongoDB. As you said, there are so many absurdly things that I couldn't even dive in.

...I will tell my boss to use v2 on new project lol.

For the first part, dude my head is aching so hard that its at a point to kill me. I will comeback to you when I am somewhat clear-minded.

Re: Do you think writing backend with Python feels wrong?

#9

Java has the advantages that it fully supports threads, I've seen JVM back ends hold up under heavy load. It is often possible and sometimes easy to get a 7.5x speedup on an 8-core machine with Java. I write a lot of backend code using aiohttp in Python for my own side projects, it is really a blast, particularly if the code is "more than a web server", say it is listening to message queues, connected to something li…

Aiohttp is too risky to code,and it is only good if you are only one working on that project, or you are working with good friends of yours.

Give it in a hands of bad programmer, you are fucked harder than any pornstar I have ever and yet to seen in my 21 year lifespan.

You are right about pip too, I don't know how did they achieve to come with a package manager that is worse than NPM. Such a feat.

Re: Do you think writing backend with Python feels wrong?

#10

Java has the advantages that it fully supports threads, I've seen JVM back ends hold up under heavy load. It is often possible and sometimes easy to get a 7.5x speedup on an 8-core machine with Java. I write a lot of backend code using aiohttp in Python for my own side projects, it is really a blast, particularly if the code is "more than a web server", say it is listening to message queues, connected to something li…

Java’s strength IMO is that the JVM is pretty reliable and performant even under heavy loads, and can be predictably tuned and optimised where that’s needed. That’s pretty compelling along with an OK language that works well at scale (lots of developers).
Post reply on HN