Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
@Torbuntu exactly. c++ is going to be faster because it is compiled for the hardware you are running it on, but java is the fastest vm language
-
@runfrodorun I feel limited in any language which you can't manage memory yourself. But at least c# has uints.
-
@runfrodorun yeah these are all valid reasons, my problem is with people who read that java is slow in a reddit thread and decided they hate java based on that. Im not saying its the best for absolutely everything
-
bahua128017yI have yet to see a Java web services application that didn't live inside my asshole.
-
theNox92717yI don't know if I'm allowed to contribute to this topic since I learned Java half a year ago and C++ a year ago, but at the moment I don't prefer any of these two ... both have their pros and cons for me, I might be slightly more inclined to like C++ but it's maybe just because I'm more familiar with it and Java is rather new for me
-
mampf1837yKotlin is great. Java is okay if you use vavr.io.
Anyway, my EE7 apps will start in a second on IBM OpenLiberty. Wow! Nothing is slow... -
CWins48087yWow, this rant contains all the endlessly arrogant shit i expect from a discussion that contains java and speed. Nice.
-
Cyanite84917yI love Java.
Mostly because C/C++ brings up really bad college memories I would rather leave repressed.
But if you're going to hate on Java, give a valid ass reason! -
@catintroholic sure, i only learned java 2 weeks ago
@mampf vavr looks cool, thanks for the suggestion -
awnumar2837yJava isn't slow at all. Its speed is comparable to that of Go.
No Java is something else.
Ugly. -
mampf1837y@BindView you're welcome. Also take a look at immutables, which is >> autovalue and lombok
-
hell165967yLook, I have both sysadmin and developer opinions about java.
As a dev I fucking love it, as a sysadmin I fucking hate it.
This is the dilemma of my life.
I've been playing and doing some "benchmarks" and "load tests" with java and golang with redis and some fun things and go is a lot faster then java of course but java still is pretty damn fast if you know what you are doing ( same thing with go... ) . -
pain04861717yBecause Visual Studio doesn't support it. Say what you will about windows and ms. VS is a great IDE for .Net languages. And because I have memories of an editor that was literally just syntax highlighting with a compiler and output window. That's it and Everytime I hear Java that is where my mind goes.....
run program...
See button placement...
Stop, alter position....
compile...
Repeat way too many times. -
CWins48087yI'm confused. So java is not slow if the code does not suck. Is there some kind of galactic energy that forces javadevs to use slow elements of the language in places where it loses valuable time?
-
luper4477y@runfrodorun I'd think we'd get along well, I totally agree with your complaints about java. Mostly I hate the paradigms used in java, not everything needs to be a class.
But C++98 why man! What about auto, I makes everything look prettier. And concurrency in c++17 looking interesting. But honestly I didn't start programming C++ until after 11 so maybe a little biased. -
@CWins Java isn't really significantly slower than most languages for most applications (significant = enough that it matters). Their JIT is actually really fast. If you're claiming that Java is too slow, do you mean that only compiled languages are valid languages? Because that's not very realistic, is it?
I mainly dislike Java, because it's so cumbersome to write. Not even because of its verbosity. But it is missing a lot of data types and convenience stuff (like operator overloading) which I'm used to from any modern language. -
CWins48087y@theCalcaholic
You misunderstood me, i don't think java is slow. Which part made you think that? -
@CWins Oh ok. The following quote made it look to me as if it was expressed under the premise that Java Software runs slow:
"So Java is not slow if the code does not suck. Is there some kind of galactic energy that forces javadevs to use slow elements of the language in places where it loses valuable time?"
I read it as 'So if java itself is not slow, why does java software run slow - are java devs just incompetent?', but I understand now, how you meant it. :) -
@CWins However, to answer that question:
That 'galactic energy' is called abstraction (and it basically applies to any abstract language). There are some things which cost a lot of performance. For example allocating RAM inside of a loop instead of allocating it before and reusing it.
In C for instance you can do these kinds of things too, but you would know that you're doing it. In an abstract language like Java a lot of this stays hidden (because you're just declaring/instantiating a variable, only the JIT compiler knows, when the RAM gets allocated).
Also - as in most abstract languages - even if you knew exactly what's happending under the hood, you have limited control over it.
Another example is iterating over 2d arrays. In C you know exactly how the array is layed out in RAM, because you defined it, so you can optimize the loops (it's optimal to jump as little as possible in RAM between array elements). In Java it's a guessing game. -
CWins48087y@theCalcaholic
Agree with most of it, but i don't see abstraction as the galactic force. A software being good or a mess is decided by the developer, and shit can be done in every language.
While languages like java and c# hide some things a little more, i don't think it counts as an excuse not to care.
Reflection is one if this things, strong opinions, few facts. "I don't use reflections cause it's slow", everyone has heard that once. How slow? Oh, barely get an answer to that. If the user clicks a button, and it starts a 20ms sql request surrounded by either 0.45ms code in c++, 0. 50ms code in java or 0.60ms with reflections, no one gives a damn.
Garbage Collection "too slow" oh, how slow? What do people expect? The whole OS freezing for 10 seconds every few minutes?
A good developer knows what takes time, how much and when it's worth going for more speed or a simpler solution. -
@CWins I agree completely. I'm just saying you have a better feeling for some of these things if you're working with a lower level language - except maybe, when you're very experienced in the abstract language and have deep knowledge about how its underlying compiler/transpiler/interpreter/JIT compiler/whatever works.
-
@CWins Maybe it's just that: In lower level languages you HAVE to make certain decisions (because there is no abstraction/default implementation) which is not the case for low level languages.
-
CWins48087y@theCalcaholic
I think it helps when new devs learn c and/or c++ with all it's details modern high level languages don't bother you with any more.
The dotnet list<> for example has a capacity and if you add beyond it, it needs a bigger internal array and does array.copy to get it. Adding one million values and having the internal array recreated one million-minus-one times is just a waste. Someone with c++ knowledge would ask himself how the memory is managed and actively look for a way to control it. -
@CWins Yeah exactly. I'm always a bit sceptical towards teaching a heavily abstracted, OOP based language as first language, because it makes people get used to relying on 'magic', i. e. not understanding *exactly* how a good part of their software works.
Although I wouldn't necessarily teach C as a first language either, because it is not the easiest thing to learn. :P -
@irene @runfrodorun
I think the JVM only needs to increment a pointer when allocating a new object and if you have large amounts of short lived objects the generational garbage collection is really efficient.
Trying to avoid things like calling new will probably just make it more confusing. -
QCat8047y@runfrodorun you forgot
- inconsistent standard library
- abuse of exceptions by every single Java developer
- native interface slower than vanilla
(defects the C# do not have) -
CWins48087y@QCat
.Net tries hard to stay compatible to a lot of old stuff, that's why new things are implemented and old ones stay. That obviously leads to some old stuff being not consistent with how modern c# would look like.
Some time ago, a colleague wanted to do xml "easy, one class does it all" i said. He didn't agree. I noticed he used the old xml functions instead of xml.linq. Google for tutorials and search SO shows often the old ways of doing things. -
QCat8047y@runfrodorun the main problem with C# API is things that accumulated, and you said yourself you didn't like that accumulation over newer versions of C++
-
meretan11337yI think the overhead that java has is too much for all the small projects that are developed with it
"Java is slow"
If that is the only reason you can come up with when i ask you why dou you think java is bad, im going to assume youre either a fucking shit programmer or live in the 90s.
rant