5 ms·
I'd love to see it eat JavaScript and Java for back-end code. But I doubt that's going to ever happen.
by Sohcahtoa82 3y ago
I'd love to see it eat JavaScript and Java for back-end code.
But I doubt that's going to ever happen.
- janalsncm 3y agoI 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.
- acdha 3y agoJust 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.
- Sohcahtoa82 3y agoIs 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?
- acdha 3y agoThere 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.
- eternityforest 3y agoI wish Python would have native JSON schema support to stop this issue. There's https://pypi.org/project/jsonschema-typed-v2/ https://pypi.org/project/jsonschema-typed-v2/ but it hasn't been updated in a few years.
- silviogutierrez 3y agoWhat about https://quicktype.io https://quicktype.io ?
- eternityforest 3y agoo.O wat? That's awesome!
- eternityforest 3y agoType 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
- robben1234 3y agoHave you looked into Mypy with the strict flag? https://mypy.readthedocs.io/en/stable/command_line.html#cmdoption-mypy-strict https://mypy.readthedocs.io/en/stable/command_line.html#cmdo...
- MBCook 3y agoDespite the existence of WebAssembly, which some have suggested to be able to run a non-JS language, I just have a hard time seeing anything non-JS get popular for the web. The in browser debug/development environment just works too well. Short of Google implementing something if Chrome hits 85-90% of all use in an attempt to dump JS it just doesn’t seem like something that would happen. I doubt any browser team would want to implement multiple languages. I doubt Google would want to switch.
- baja_blast 3y agoFor Python to work in the browser via WebAssembly you'd need to have python itself compiled and running to execute python. It would consume a lot of energy and be much slower, I see no upsides. WebAssembly is meant to have lower level languages and programs run in the browser, not so Python devs do not have to learn a second language. Plus Python is not suited for event driven systems.