5 ms·
> Developers from certain languages [Java]... I am mostly a C++ developer but I have been on some Java projects recently, and I am a bit shocked by the "what i
by GuB-42 4y ago
> Developers from certain languages [Java]...
I am mostly a C++ developer but I have been on some Java projects recently, and I am a bit shocked by the "what if it changes?" culture. Lots of abstraction, weak coupling, design patterns, etc... It looks like a cult to the gang of four.
Of course, it is not exclusive to Java, and these patterns are here for a reason, but I have a feeling that Java developers tend to overdo it.
- humanrebar 4y agoOn the other hand, Java projects are better tested and more portable in my experience.
- nullcipher 4y agomore portable.. to what ? are we talking of desktop applications here? I can't remember the last java program I used on the desktop.
- GuB-42 4y agoBetter tested, maybe, I don't know but I believe you. More portable, yes, but it is complicated. Java runs on a VM, so it gets portability from here, if your platform runs the VM, it will run the project. However, as a user, I still had issues with using the right VM on the right version, OpenJDK and Oracle JDK are not completely interchangeable. Messing up with classpath and libraries too. Not so different from C actually, but at the JVM level instead of the platform, the advantage being that it is easier to switch JVM than to switch platform.
- marginalia_nu 4y agoI think a large part of the difference is because interfaces and polymorphism is effectively free in Java, whereas virtual methods in C++ comes at a cost.
- Transfinity 4y agoFree except for you've written 3x as much code and it's 10x harder to understand.
- marginalia_nu 4y agoEh, it's a bit boilerplaty, but much of that stuff is typically done through an IDE. Don't know about harder to understand, the entire point is to remove confusing implementation details from callers.
- achikin 4y agoThe issue is that when you are trying to understand/modify someone else code it always comes down to confusing implementation details rather than abstract architecture on top of them.
- deschutes 4y agoI'd rather see how it's implemented. In my experience enterprisy abstractions are a lot of motion without any progress. They impede change and stymie understanding. The cynical part of me thinks that is the whole point.
- Banana699 4y agoVirtual dispatch always has a cost, it's "free" in Java in the sense that it's always done at the VM level, so you might as well just use it, even final methods are just an agreement with the compiler, the VM doesn't care, it will dynamically look up the method in the class hierarchy like God intended. C++ makes it painful and obvious what you're getting yourself into. The JVM is off course very clever and is, I'm sure, doing tons of shenanigans to reduce the cost, but that's not free, that's someone else investing tons of time and effort and complexity to reduce the cost of a fundamentally expensive operation.
- rr808 4y agoJava is actually a great language. I think the Spring culture ruins it. As you say most of the abstractions are out of control.
- ncmncm 4y agoA language is nothing but the code it engenders. Bad code, bad language. A language that evolves "is" the new code that is written in it, with deep legacy substrata written to previous versions. You can have a good top level but an embarrassing legacy. We should always strive to make our legacy embarrassing, because that marks improvement. If ten-year-old code in your language is not an embarrassment, your language is stagnating.