4 ms·
> if we are forced to stop using python 2, we'll probably need to switch the project over to Java. This is just silly. It will take at least 100x more effort t
by iak8god 9y ago
> if we are forced to stop using python 2, we'll probably need to switch the project over to Java.
This is just silly. It will take at least 100x more effort to rewrite the project in Java than it would to upgrade to Python 3.
> at least the java community doesn't force developers to rewrite their source code when a new JVM comes out
Yes, that was an unfortunate, one-time thing for Python that happened almost a decade ago.
> My employer is mostly a java shop ... and their retort is that [python is] not really enterprise ready
Yep. That sounds like the kind of nonsense people say in a Java shop.
- coldtea 9y ago>This is just silly. It will take at least 100x more effort to rewrite the project in Java than it would to upgrade to Python 3. Yes, but in return it will bring a 10x performance improvement in lots of areas, and the option of a whole lot more sturdy statically checked code.
- baq 9y agoif performance is a problem, then start rewriting the critical pieces right now because python 2 also isn't for you. mypy is a much better type system than Java, btw, if that's what you're after.
- iak8god 9y agoCan you expand on "mypy is a much better type system than Java"? I'd love it if that were true.
- baq 9y agoIt has e.g. a proper Union type, generics and type inference. Lack of pattern matching hurts, but then, Java doesn't have that either. You can also configure how strict you want the checks to be. There are downsides though: type stubs are of... varying... quality, there are ugly hacks needed to resolve cyclic imports and the type annotation syntax gets yucky in places, even in 3.6. I'm using mypy seriously for about a year and it's progressing very well. I see very good ROI even with the uglification of the code.
- iak8god 9y agoI'll check it out. Thanks!
- nayuki 9y agomypy can help you ensure that a variable is never None, whereas it's still tedious to manually check for null in Java.
- coldtea 9y agoSeems trivial, if Python which is so dynamic could get it, to give it to Java with a similar static checker. Haven't checked, but I find it absolutely possible that there's one (or more).
- coldtea 9y ago>if performance is a problem, then start rewriting the critical pieces right now because python 2 also isn't for you. You say it as if that would be a strange position to be it, but it's a common situation. A lot of time you start with the faster to prototype / more familiar language, and outgrow it. That's what companies do after they grow so much that a language such as Python/Ruby/PHP is not doing it for them anymore or wont be doing it soon with their growth trajectory. And you don't have to be Twitter scale either. Even if you have moderate growth, you might find that with a different language, you can use 1/10 the servers, and thus drastically lower your operating expenses. So, when some of those companies face the jump to Python 3, and the required rewriting, they often decide to bite the bullet, and do a fuller rewriting in another language (like Java, but Golang is also getting many Python converts, including e.g. Dropbox IIRC), that will give them much more bang for their buck.
- baq 9y agoall true and it's fine. python isn't be-all end-all, just like java isn't, go isn't, rust isn't, etc. it's a tool in a toolbox.