3 ms·
Taking your logic a little further, Python+PyPy beats Java hands down. Every single argument applies to Python vs. Java or Python vs. C/C++ more than it does to
by beagle3 13y ago
Taking your logic a little further, Python+PyPy beats Java hands down. Every single argument applies to Python vs. Java or Python vs. C/C++ more than it does to Java vs. C/C++
Which, incidentally, is my tool of choice...
Personally, I've never met nice readable Java code. I'm sure it exists somewhere, but I've actually gone looking for it in the past (including posting a question on HN, out of 10 responses only one was concrete -- Play Framework -- and they've abandoned Java since).
Every piece of Java I've met is an overengineered piece of AbstractAbstractFactoryFactoryBeanSingleton class. I'm sure Notch writes better code. But as far as I can tell he's the only one.
- noelwelsh 13y agoPython, and PyPy AFAIK, doesn't provide true concurrent threads or lock-free primitives like CAS. This means there are a class of high performance and high concurrency applications you simply can't write in Python. I'm no fan of Java, but I am a fan of the JVM. The two don't necessarily go together, as I'm sure you know. I also recognise the JVM has limitations. There will (hopefully) be better things in the future. This is one reason that Rust is interesting to me, but it has a long way to go before I'd use it in production.
- pron 13y ago> Python+PyPy beats Java hands down. . Every single argument applies to Python vs. Java or Python vs. C/C++ more than it does to Java vs. C/C++ Not at all. Python does not even begin to apply a minuscule portion of the optimizations the JVM performs. Also, I wasn't talking theory, I was talking practice: I've worked on porting two multi-million LOC soft real-time applications from C++ to Java, and a few smaller programs; big performance improvements in all cases. I was simply explaining why Java performs better in practice, not speculating why it would. But if you haven't seen that with your own eyes, all that's left for me is to explain why this is so. > Personally, I've never met nice readable Java code. This has no relevance to the discussion, though there's plenty of nice, readable Java code. Anyway, I was talking about the JVM, not specifically Java the language. > I'm sure Notch writes better code. But as far as I can tell he's the only one. Right... and as far as I can tell, you're not really into Java :) That's okay. Millions of developers are.
- beagle3 13y ago> Not at all. Python does not even begin to apply a minuscule portion of the optimizations the JVM performs Are you familiar with PyPy? It doesn't go as far as the JVM, but "minuscule" is definitely wrong. > I was talking practice: I've worked on porting two multi-million LOC soft real-time applications from C++ to Java, and a few smaller programs; big performance improvements in all cases. My experience is the opposite. Not two million lines - just a few tens of thousands, but still. > This has no relevance to the discussion, though there's plenty of nice, readable Java code. Anyway, I was talking about the JVM, not specifically Java the language. One of the previous posts (to which I was replying) claimed that Java is faster in practice because (paraphrasing) it is nicer to read and write, and that was a response to that. > Right... and as far as I can tell, you're not really into Java :) That's okay. Millions of developers are. That's good, that guarantees I'll always be in demand :)
- pron 13y ago> My experience is the opposite. Not two million lines - just a few tens of thousands, but still. But that's the whole point. I could probably write a C++ program of that size that beats a Java program of that size, provided that they're single threaded. But programs of that size are usually written by a single developer or a very small team. Many programs aren't that small. But even at this size, unless the problem is embarrassingly parallel, a multi-threaded Java program would often perform better, mostly due to concurrent data structures that require (or greatly benefit from) GC.
- wisty 13y agoWhile Python beats Java at a lot of things, that wasn't the point. The point was, a badly written Java program can beat a badly written C++ program, because the Java optimiser is more robust against stupid decisions by the programmer. PyPy might make your point correct though. While PyPy will never beat well-written C++ (at least, not in the foreseeable future), it might start beating badly written C++.