r/learnpython • • 16d ago • Bravo 1

Is Python a good choice for backend development?

I'm considering learning Python for backend development and would like to hear from developers who use it in their daily work.

How good is Python for building backend applications in production? Are there any significant drawbacks compared to languages like Go, C#, or Java?

36 Upvotes

43 comments sorted by

View all comments

2

u/SharkSymphony 16d ago edited 16d ago

I've been doing it for over a decade now across two companies, and like it just fine.

The advantages are: it's easy and fast to build stuff with, easy to instrument, and pretty easy to deploy. You can also use it for both back-end work and data engineering, which can be nice for small companies where those roles are overlapping. Python also has a bunch of nice high-level features like metaclass programming, exception handling, generator expressions, and list/dictionary comprehensions, which I sorely miss every time I move to another language.

The downsides are: it is less performant than most options you have – but this does not mean it's bad performance, nor necessarily that the customer will experience the performance hit, but it can mean that you'll be pushing more stuff off to asynchronous processing, and you'll need more hosts to scale it up. It is particularly slow at serialization/deserialization out of the box, which can have a marked effect if your back end is processing large files or sending large JSON responses.

Both companies I've done primarily Python with have gradually transitioned back-end services to Go as performance demands. You could, of course, just start with Go – which is not the last word in performance, either, but does offer a significant speed boost over Python. It's kind of a dumb language compared to Python, though. 😛