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

> And what can be used instead of C++?

For most use cases Java is a better option. Very fast, without any of the pain.

If you truly must not have a VM (rare), there's still C. Perhaps rust.



I think this is probably the most salient point. C/Rust then Java. I don't know why people hate on Java so much. And I think C lives fine along side Rust.


Java forces OOP and it's verbosity is worse than COBOL.


> Java forces OOP and it's verbosity is worse than COBOL.

Java doesn't force OOP in any meaningful way. I mean it does, in that you need to wrap all code in a class, but that's a non-issue (one line of code at the top and a closing bracket). You can write Java code where all functions are static and do nothing is object-oriented, when that's the best match for your needs.

On verbosity, you can latch on to the ConstructorAccessorMapFieldGetterFactorySingleton nonsense if you want but that's on you. Nothing in the Java language forces that on anyone. Having been writing Java code since 1996 I've never written such code.


Java is based on Objective-C without any of the nice flexibility, doesn't have value types, has C-like numeric types except they're less flexible yet not any safer, and its culture thinks you organize code by putting it into 6+ layers of namespaces inside other namespaces.

My rule is that languages are good if they have value types, which explains why PHP is good.


C# also has value types and structs. Also a bonus over the top fanboyism is absent.


Java is not very fast compared to c++, or you'd see it in embedded systems all over.


> Java is not very fast compared to c++, or you'd see it in embedded systems all over.

Those are quite different domains, with only minimal overlap.

Embedded systems more often that not are not seeking maximum performance. What matters is smaller code size and running on mimimal hardware. Java doesn't do so well there since you have the overhead of the VM. Java is rarely a sensible choice for embedded code. Just use simple C, or rust if it works for the use case.

(Yes I know project green was originally about embedded set-top boxes! But times changed.)

Performance critical systems are usually large servers for either high througput (web or other server traffic) or low latency (HFT) applications. The opposite end of the spectrum from embedded. That's where Java shines. You might be able to beat Java with carefully hand-tuned C++ but just as likely the JIT might beat you. So for maximum performance server code combined with a more sane developer productivity, Java cannot be beat.


I understand, but the topic of this article is about embedded systems. Java is not a player here.


what's fast really depends on lot on what you are building - without more details about the challenge at hand any statements about performance are unhelpful. A huge backend system? The logic in a toaster? A space ship?




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

Search: