69

"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.

Comments
  • 7
    @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
  • 6
    @runfrodorun No support for unsigned integers (as a primitive type)
  • 5
    @runfrodorun I feel limited in any language which you can't manage memory yourself. But at least c# has uints.
  • 5
    As a sysadmin I hate Java because it pegs every server it runs on.
  • 7
    @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
  • 2
    I have yet to see a Java web services application that didn't live inside my asshole.
  • 3
    I 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
  • 1
    Kotlin 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...
  • 5
    Wow, this rant contains all the endlessly arrogant shit i expect from a discussion that contains java and speed. Nice.
  • 1
    @CWins Care to elaborate?
  • 1
    @CWins A discussion about Java and Speed just wouldn't make any sense as Java is a programming language...

    ...but it's definitely too verbose and therefore to slow to type and read 😁
  • 4
    I 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!
  • 2
    @catintroholic sure, i only learned java 2 weeks ago

    @mampf vavr looks cool, thanks for the suggestion
  • 7
    Java isn't slow at all. Its speed is comparable to that of Go.

    No Java is something else.

    Ugly.
  • 1
  • 1
    @BindView you're welcome. Also take a look at immutables, which is >> autovalue and lombok
  • 5
    Look, 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... ) .
  • 1
    @runfrodorun yes, but no need to go that far
  • 0
    It's not the runtime speed they're complaining about...
  • 1
    ^ω^
  • 1
    Because 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.
  • 1
    I'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?
  • 0
    @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.
  • 0
    I built my own concurrency that is better than the c++17 one.
  • 0
  • 0
    I didn't :-(
  • 1
    @CWins well its about time to do then
  • 3
    @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.
  • 0
    @theCalcaholic
    You misunderstood me, i don't think java is slow. Which part made you think that?
  • 0
    @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. :)
  • 0
    @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.
  • 2
    @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.
  • 0
    @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.
  • 0
    @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.
  • 2
    @CWins i want your last reply tattooed on my back
  • 0
    @BindView I hope you're large. :P
  • 2
    @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.
  • 2
    @BindView
    Permission granted, photo requested 😉
  • 0
    @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
  • 0
    @runfrodorun I think new can actually be faster than malloc.
  • 0
    @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.
  • 1
    @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)
  • 0
    @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.
  • 0
    @runfrodorun well that is to be expected from a person disappointed of C++03 ;)
  • 0
    @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++
  • 0
    I think the overhead that java has is too much for all the small projects that are developed with it
Add Comment