Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I like python but I would never choose it for anything more than trivial on the backend. I want to know what types are being passed around from one middleware function to the next. Yes python has annotations but that’s not enough.



Type annotations are pretty good. I'd like to see a strict mode though, something you import that makes missing annotations anywhere into a fatal error


Have you looked into Mypy with the strict flag?

https://mypy.readthedocs.io/en/stable/command_line.html#cmdo...


Just wait until you see what the enterprise Java developers passing around with type Object and encoded XML blobs. Type checking is really useful but it can be defeated in any language if you don’t have a healthy technical culture.


Is that why I see much object serialization/deserialization in Java?

They're trying to pass data between layers of middleware, but Java has very strict typing, and the middleware doesn't know what kind of object it will get, so it has to do tons of type introspection and reflection to do anything with the data?


There are multiple causes but a lot of the nastiest code I’ve seen did suggest “I don’t have time to update those other layers”, along with the very common misperception that you’re working on a huge shared service for the ages and need everything to be as generic and customizable as possible.


I wish Python would have native JSON schema support to stop this issue.

There's https://pypi.org/project/jsonschema-typed-v2/ but it hasn't been updated in a few years.



o.O wat? That's awesome!




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: