7 ms·
I use Python as a prototyping tool only, and I mean prototyping in the sense that the code will always be thrown away and rewritten in a more suitable language.
by ilovecaching 8y ago
I use Python as a prototyping tool only, and I mean prototyping in the sense that the code will always be thrown away and rewritten in a more suitable language.
Python sacrifices so much in the way of efficiency, safety, and maintainability that it's hard to justify the wins in expressiveness. Easily checked errors that should have never made it to production manifest at runtime even after rigorous testing. Increasing performance requires moving to asyncio which drastically reduces readability and limits the code reuse from non-async libraries. Eventually code bases grow so large mypy becomes a must, and we have to contend with interfacing untyped libraries and refactoring all of our existing code with annotations.
Python has its place, but in line with how scary modern software practices are to me, it's crazy that Python has become such a mainstay in production software.
- rhlala 8y agoI want to do it too, witch language do you recommend for desktop apps?
- ilovecaching 8y agoI’ve used Go with the ui library and Rust with GTK with a lot of success. Most languages have bindings to GTK and Qt.
- deshpand 8y agoMaybe you have the luxury of rewriting that others don't have. Do you rewrite to assembly? That's going to be really fast you know! With a proper test framework, people can and are building large scale applications. There are plenty of ways to optimize performance without a complete rewrite. Python is really Python+C to a large extent.
- ilovecaching 8y agoPrototyping is something that should be time boxed and usually costs me a day to a week of time at the most. Experience tells me that most applications do not survive the first iteration very long without prototyping, and Python lets me maximize my time spent prototyping. As for your jibe, my original point was that there is something between Python and Assembly. There are many languages that provide all or many of the nice things that Python gives us that are staggeringly more efficient and safe. Python is really Python+C if you’re willing to write C extensions, which completely negates the point of using Python. C extensions also don’t maintain safety, or solve Pythons shift of compile time bugs to runtime. It really only addresses the efficiency losses by making you write code in another language. People can and will build successful applications in all sorts of crazy ways. It’s a fallacy argument that just because something is done a certain way, that must mean there are no better ways that could save us time, money, and sanity.
- deshpand 8y agoPython is not perfect and languages do evolve. Maybe Rust or Go or something new will take over the world. But there's a trade-off between developer time and execution time and you can't focus on just one. There's also the benefit of a large ecosystem of libraries (and talent, if you are a large enterprise) when you embrace Python that may not yet be available in some other newer languages. Prototyping usually involves working with existing code base and the ecosystem, although if you are building a brand new product or application, your context may be different.
- tankerdude 8y agoIt might be scary to you, but who runs Python at scale? youtube ran it for quite a long time. reddit yelp Those sites seem mainstays to me, with good load. Perhaps performance is a problem for you for the server load and costs that you want, but it does allow you to iterate quickly to get your product out the door. Last thing though: Checked errors. I think that's largely solved with type hinting (along the lines of TypeScript) where you get some guarantees. Stacks of choice though for me is really Python and Go. I would use Go for when I truly need that raw speed with a lot fewer servers in Go in terms of horizontally scaling.