Slashdot Mirror


Everything About Java 8

New submitter reygahnci writes "I found a comprehensive summary of the developer-facing changes coming in Java 8 including: improvements to interfaces, functional interfaces, lambdas, functions, streams, parallels, date/time improvements, and more. The article includes example code with realistic examples of use as well as explaining the reasoning behind some of the choices made by the developers who are working on Java 8."

233 comments

  1. The important bit by Anonymous Coward · · Score: 0, Insightful

    Will it be more secure?

    1. Re:The important bit by p00kiethebear · · Score: 2

      After all the security vulnerabilities patched this year, I would think they're feeling the pressure to make sure there isn't a repeat.

      --
      The Blade Itself
    2. Re:The important bit by Anonymous Coward · · Score: 5, Informative

      This is about Java the language, not Java the browser plugin. You should know the difference by now...

    3. Re:The important bit by p00kiethebear · · Score: 3, Informative

      This is about Java the language, not Java the browser plugin. You should know the difference by now...

      I've been misinformed then, I thought the security vulnerabilities in the java plugin were inherited from vulnerabilties in the way the language itself handled data. Someone mod up the guy above.

      --
      The Blade Itself
    4. Re:The important bit by Anonymous Coward · · Score: 0

      This is about Java the language, not Java the browser plugin.

      And these features need to be supported in the JVM, creating a larger attack surface. Oracle are struggling to keep what they already have secure, adding more features is just going to worsen the problem.

    5. Re:The important bit by halfEvilTech · · Score: 4, Funny

      I say we start a pool on how many zero days will be availible by the time it launches or even if we want to be generous, within the first week.

      I will start it off with 7

    6. Re:The important bit by Anonymous Coward · · Score: 0

      IBM as a great VM, (granted it's swing implementation suck)

    7. Re:The important bit by K.+S.+Kyosuke · · Score: 1

      And these features need to be supported in the JVM, creating a larger attack surface.

      I'd think that deficiencies in intermediate forms can be handled. That aside, you can add as much syntactic sugar as you wish without compromising anything. (Well, the sanity of the developers, sometimes, I guess. :))

      --
      Ezekiel 23:20
    8. Re:The important bit by Anonymous Coward · · Score: 0

      The vulnerabilities are a result of bugs in the core library implementation. It's exacerbated by the fact that this core library API is (mostly) available to untrusted code which can combine and invoke it in ways not anticipated by the implementation authors. That's what causes these security vulnerabilities. Java-the-language does not have these vulnerabilities, so to speak.

    9. Re:The important bit by viperidaenz · · Score: 1

      Why do you think IBM built SWT?

    10. Re:The important bit by viperidaenz · · Score: 1

      And these features need to be supported in the JVM

      As far as I can tell, none of these features have anything to do with the JVM. They're all library and compiler changes. None of them are directly related to security or sand-boxing. It also seems like there will be no significant changes to class verification either. Only to allow annotations in more places, maybe lambas, but I dare say they'll be implemented as regular anonymous classes by the compiler.

    11. Re:The important bit by Anonymous Coward · · Score: 0

      Why do you think IBM built SWT?

      Have you ever tried to develop a rich UI using Swing? It's possible, but it seems like they went out of their way to make it difficult.

    12. Re:The important bit by KZigurs · · Score: 2

      Probably. Server side Java (where it is used mainly) is pretty much reasonable security wise.

      Why would anyone enable Java in a browser is beyond me.

    13. Re:The important bit by SplashMyBandit · · Score: 5, Insightful

      Actually, once you get used to Swing it is pretty hard to go back to any other toolkit. Swing is amazingly powerful, and ever since Java 1.6.0u10 also very performant (since it is based on Java2D which is DirectX accelerated on Windows and OpenGL accelerated everywhere else). One thing you do have to be aware of with Swing is not to block the "Event Dispatch Thread". Once you learn that, and how to use GrdiBagLayout properly then you are 'away laughing'.

      With the Nimbus Look & Feel the look of Swing is pretty awesome. Of course, many Swing developers have or are transitioning to Swing;'s successor, JavaFX 2. JavaFX 2 looks amazing (lots of special effects, gradients, transparency, reflections, animations etc that can be switched on very easily). JavaFX 2 does have a slightly different model for properties than Swing, so there is a bit of an impedance mismatch when you embed Swing into a JavaFX 2 UI or vice versa.

      I understand many don't like the learning curve of Swing, and some of the overheads (eg. TableModels) - but it turns out these abstractions are necessary for users to be able to make custom controls (which is easier, IMHO, than other toolkits as you get a lot of control on how your custom will work exactly how you want it to).

      The best thing about Swing, IMHO is not even the enormous capability for extensions. For me the best features is not only to have pixel-precise layout, but also you can make the UI resize *exactly* the way you want. While I like GWT and CSV for web stuff when I use them I always miss Swing as the later us able to work out the correct size of controls itself, and resizes exactly the way I want it (that's due to a problem in browsers computing layout [which the GWT guys called "intractable" in the browser; but Swing shows this is not the case on the desktop]).

      There is a lot of life left in Java desktop technologies. I'm having a great time using OpenGL (via JoGL) in Swing to produce a modern jet combat flight sim. The ability to mix Java controls and 3D saves a lot of work (most 3D apps have to implement UI controls themselves - so end up behaving non-conventionally and looking a little odd).

    14. Re:The important bit by SpazmodeusG · · Score: 5, Informative

      No Java itself is used in so many places. Your phone probably uses it for a start. From the cheapest old fashion Nokia candybars to the latest Android smartphones to a whole host of embedded systems around the place and various webservers. They all use Java extensively and they never have an issue with the language.

      Unfortunately there's a particular Java plugin from Oracles version of the Java VM that insists on running every Java program your browser comes across. You wouldn't run a plugin that runs every compiled executable you come across would you? Well Oracles Java plugin tries to run every Java applet it comes across. That's where these security flaws you hear about come from.

      So Java as a whole is having its name tainted by one particular plugin.

    15. Re:The important bit by Anonymous Coward · · Score: 0

      Who modded this nitwit insightful ?

    16. Re:The important bit by Anonymous Coward · · Score: 4, Funny

      After all the security vulnerabilities patched this year, I would think they're feeling the pressure to make sure there isn't a repeat.

      Normally one would think that, but this is Oracle we're talking about.

    17. Re:The important bit by SuperKendall · · Score: 1

      I once built a large rich UI client in Swing, once you embrace GridBagLayout it all works really well.

      Swing just has a steep learning curve, and (at least at the time) kind of ugly controls. But it's very functional and not difficult once you understand the system.

      --
      "There is more worth loving than we have strength to love." - Brian Jay Stanley
    18. Re:The important bit by Anonymous Coward · · Score: 0

      Why anyone who knows anything about java knew that it was in the JVM and web plugins and not the language. Why does he deserve a mod point for saying the obvious?

    19. Re:The important bit by MightyYar · · Score: 4, Insightful

      You wouldn't run a plugin that runs every compiled executable you come across would you?

      Sadly, I have Flash installed. I think its track record is almost as awesome.

      --
      W..w..W - Willy Waterloo washes Warren Wiggins who is washing Waldo Woo.
    20. Re:The important bit by lgw · · Score: 2, Informative

      No, the vulnerabilities are in Java, not the plug-in. (In Oracles JVM, the Android JVM will have its own, disjoint set of vulnerabilities).

      It's just most places Java runs don't have an exposed surface to attack. Server-side Java has had tons of vulnerabilities patched so far - but it was rarely urgent to apply the patches, since there's no access to that JVM from off the box.

      The browser plug-in was the way the JVM flaws were eposed, but it was the JVM that had the flaws (OK, the plug-in also has its own set of flaws, as well, but not so many).

      --
      Socialism: a lie told by totalitarians and believed by fools.
    21. Re:The important bit by lgw · · Score: 1

      Probably. Server side Java (where it is used mainly) is pretty much reasonable security wise.

      No, most of the Java security flaws apply to server side Java as well. It's just that you usually don't care, because an attacker has no way to exploit the JVM unless he's already running arbitrary code on the box.

      Why would anyone enable Java in a browser is beyond me.

      Remember all those crappy intranet apps that used to require IE6 and ActiveX? Many were replaced by crappy intranet apps that require Java in the browser. Same stupid, different toolset.

      --
      Socialism: a lie told by totalitarians and believed by fools.
    22. Re:The important bit by LordLimecat · · Score: 1

      Apparently something about the one makes the other absolutely impossible to fix. That, or Oracle simply doesnt care.

      Either way, "a JRE plugin that wont ruin your network security" might be the most substantial feature ever, if they could hit it. Its all well and good to add new features to the language unless IT security everywhere are working on phasing out java (the client bits) because of its abysmal record...

    23. Re:The important bit by LordLimecat · · Score: 1

      An even more fun game is taking a stab at what Java version your computer has updated to at any one time. I thought I was on JRE 7u12, but I checked and we were up to u17 after a week.

      You could probably make a pretty decent calendar out of JRE versions; year = 2006 + $MajorVersion, Week = $updateLevel.

    24. Re:The important bit by WankersRevenge · · Score: 2

      Once you learn that, and how to use GrdiBagLayout properly then you are 'away laughing'

      heh ... laughing from insanity? I think this sums up my experience with Gridbag. I ended up switching to Mig Layout which was a paradise compare to Gridbag. It actually made Swing work fun.

    25. Re:The important bit by Yosho · · Score: 1

      I understand many don't like the learning curve of Swing

      I've always thought that Swing's learning curve was pretty easy compared to other GUI toolkits. I've got some experience Win32 MFC, wxWidgets, Qt, GTK, Ext JS, Carbon, and Cocoa, and honestly I thought Swing was the easiest one of them to just pick up and start churning out GUIs. But, maybe that's just me. I don't consider learning curve to be an important factor when picking a toolkit unless your goal is to get newbie programmers to just crank out GUIs as fast as you can.

      On the other hand, the two things I really hate about it are how it has its own look & feel -- even if you're using the "native" look & feel styles, they're still very obviously not really native GUIs -- and the fact that you need to take advantage of pixel-perfect positioning. I don't want to futz around with that; I want to just be able to drop a bunch of widgets into a window and have them look like they ought to look on that OS.

      and some of the overheads (eg. TableModels)

      And oh man, I wish I could punch the person who designed TableModel. It's terrible and makes me curse any time I have to make a table in a Swing GUI. Ext JS's Grid / View / Store / Model setup is so much more logical and flexible.

      --
      Karma: Terrifying (mostly affected by atrocities you've committed)
    26. Re:The important bit by TheSunborn · · Score: 5, Informative

      Let me try to explain it:

      Java (The language and vm) does in general allow code to do anything. Mess up the system, call native methods and so on. In this it is no different from other languages such as c++ and php, which is why no one are running c++ og php directly in a browser*.

      But sun wanted to be able to run Java code in the browser, so they made an security manager, which in principle allow you to specify exactly what parts of the java standard library a program should have access to. So you can restrict file access, to specific sub directories. Control thread and process control, class loading and so on.

      So each call to a potential dangerous method first goes to the system manager to ask for permission, and if permission is granted the rest of the method is executed. And here is part of the problem: Default for all methods is access granted if there is no call to the security manager.

      So for every method in the Java library, they had to determine if it could me misused, and it it could be misused, they had to insert call to the security manager to verify that the user have access to use this method in this way based on the arguments to the method.

      And just one method which don't verify its argument as good as it should is enough to grant access.

      The problem is made far worse by the combination of the java class loader which loads classes dynamicly, and the java reflection api which allows dynamic class loading and method calling. Verifying that code can't use the reflection and class loader to bypass the security system is really difficult, as proved by the many security problems.

      So when people say the problem is in the java browser plugin, they are not exactly right. The problems are in the java security manager, but I think the browser plugin is the only component which uses the security manager. Our server code for example don't need a security manager to control exactly what our code have access to, because the code is written by guys we trust, and the rest of the security is handled by the system.

      *Or at least should not. Active X is Microsofts version of the "Try to run untrusted general purpose code in the browser project". And its security record is as bad as javas.

    27. Re:The important bit by SpazmodeusG · · Score: 4, Insightful

      Well you can't say Java has flaws and then detail one particular set of flaws in one product. Even then your claims that the flaw is in the JVM is doubtful. I can right now load up a Java program in Oracles JVM and delete my files off my hard drive. I can also straight up spin up 100000 busy threads and bring my machine to a crawl. Are these flaws? Of course not. I can do the same thing in C++.

      The flaw is allowing the browser plug-in to do things it shouldn't. The JVM itself is supposed to allow you full functionality including the ability to shoot yourself in the foot. The flaw is the fact you've exposed the JVM to the outside world. The Applet Plug-in tries to limit this functionality but fails. That is not the fault of the JVM.

    28. Re:The important bit by Anonymous Coward · · Score: 0

      Once you learn that, and how to use GrdiBagLayout properly then you are 'away laughing'

      heh ... laughing from insanity? I think this sums up my experience with Gridbag. I ended up switching to Mig Layout which was a paradise compare to Gridbag. It actually made Swing work fun.

      Back in the day I use to refer to it as DoucheBagLayout.

    29. Re:The important bit by SplashMyBandit · · Score: 1

      Cool. Thanks for the tip on MigLayout. If I can't ever get GridBagLayout to work for me I'll definitely take a look at MigLayout.

      Funny video. I guess changing things at random is what most GUI coders do, right? That's not my workflow - but I can see how GBL would suck until you learn all the aspects that make a layout work and resize properly.

      At least you seem to be in the camp that Java on the desktop still has some uses :)

    30. Re:The important bit by SplashMyBandit · · Score: 1

      Well said. I tend to make a bunch of mutable classes (eg. a MutableTableModel) that I use as a base class. It's still stinky that in order to create a decent table you need some custom classes. But for me the degree of control is worth it. I like what you can do with styling with JXTable too.

    31. Re:The important bit by Nivag064 · · Score: 1

      Hmm...

      Gridbag layout is simple, once you learn it and are _DISCIPLINED_.

      I would hate to try and devise an alternative.

      I have made major use of it in at least 2 commercial project.

      Gridbag layout is great for some GUI problems, I would be more than happy to use it again.

    32. Re:The important bit by Anonymous Coward · · Score: 0

      This is about Java the language, not Java the browser plugin. You should know the difference by now...

      And the plugin is failing to enforce the security sandbox because of vulnerabilities in the language, notably, the new reflection capabilities.

    33. Re:The important bit by Anonymous Coward · · Score: 1

      The Applet Plug-in tries to limit this functionality but fails. That is not the fault of the JVM.

      Except that it is running the standard JVM security sandbox, which explicitly does not perform as it is supposed to, when it did in previous versions. The thing that changed is the new extensions to the reflection APIs, and those changes are definitely in the JVM / Java language / standard library realm. They are not peculiar to the plug-in, which is simply a consumer of the sandbox security model.

    34. Re:The important bit by angel'o'sphere · · Score: 0

      Well, you got a +5 :) but your assumptions about a security manager works and how amd where it is used: are completely wrong.
      It is trivial to write a Java Application thatbuses a security manager and thus, e.g. restricting it from accessing the internet or certain parts of the file system.
      Your idea that dangerous methods call the security manager is completely wrong. The VM calls the security manager before said method is executed.

      --
      Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
    35. Re:The important bit by petermgreen · · Score: 1

      I remember writing my own subclasses of borderlayout and flowlayout to get more sane cooperation between the two. It worked very nicely but was a bit ugly because there is no good way to extend the interface between nested layoutmanagers and getprefferedsize is too limiting an API to do what I wanted.

      --
      note: i'm known as plugwash most places but i screwd up registering that here somehow in the past and now can't register
    36. Re:The important bit by delt0r · · Score: 2

      The thing is that applets should die. I am a java dev. But i don't understand this big deployment on the web push. C/C++ don't have it and do just fine. I have applets/ws disabled long before this list of security issues.

      --
      If information wants to be free, why does my internet connection cost so much?
    37. Re:The important bit by julesh · · Score: 2

      Well, you got a +5 :) but your assumptions about a security manager works and how amd where it is used: are completely wrong.
      It is trivial to write a Java Application thatbuses a security manager and thus, e.g. restricting it from accessing the internet or certain parts of the file system.
      Your idea that dangerous methods call the security manager is completely wrong. The VM calls the security manager before said method is executed.

      Your assumption that the VM inserts the security manager code is wrong. See, for instance, the source code for java.io.FileInputStream(File). You can clearly see starting at line 128 and continuing to line 131 that this check is performed by the library, not the VM. Similar code is present throughout the Java standard library.

    38. Re:The important bit by julesh · · Score: 1

      The VM will need an update to perform the linking of default methods in interfaces. Other than that I think you're right; it certainly looks as though the lambda function stuff is implementable from a purely compiler perspective (although whether that's how it has actually been done, I don't know).

    39. Re:The important bit by angel'o'sphere · · Score: 1

      You are right in tis case. Hm, uncertain now if this is so because that code is very old, or if I was completely mistaken myself.

      I have to check that again ...

      --
      Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
    40. Re:The important bit by Anonymous Coward · · Score: 0

      In this example, security checks are performed inside the Java standard library, which cannot be replaced, so actually there would be no way for you to try to read a file without having this check done, isn't it?

    41. Re:The important bit by Anonymous Coward · · Score: 0

      Yeah, that's the purpose. What's your point?

  2. Lambdas! by Anonymous Coward · · Score: 1

    I can't wait!

    1. Re:Lambdas! by Anonymous Coward · · Score: 0, Funny

      I can't wait!

      In December 1974, the lambda was officially declared the international symbol for gay and lesbian rights by the International Gay Rights Congress in Edinburgh, so it fits right in here with the slasdhot fanbois.

    2. Re:Lambdas! by Anonymous Coward · · Score: 1

      Lambdas were supposed to be in Java 7, it was hard, and they were cut. I expect its going to continue being hard to add lambda functions in a way that pleases all the right people and would suggest that you do in fact not wait for them.

    3. Re:Lambdas! by K.+S.+Kyosuke · · Score: 1

      In December 1974, the lambda was officially declared the international symbol for gay and lesbian rights

      Oh my, they got it wrong, Church wasn't gay, *Turing* was! They should have selected the infinite tape as their symbol!

      --
      Ezekiel 23:20
    4. Re:Lambdas! by SuperKendall · · Score: 1

      In December 1974, the lambda was officially declared the international symbol for gay and lesbian rights

      I don't care if NAMBLA or the KKK adopts the lambda as its official symbol, it's a damn useful programming construct.

      it fits right in here with the slasdhot fanbois.

      Projection is SUCH a painful thing to watch.

      --
      "There is more worth loving than we have strength to love." - Brian Jay Stanley
    5. Re:Lambdas! by Anonymous Coward · · Score: 0

      Who are the "right people" ? The 5 people who bothered to learn Haskell?

    6. Re:Lambdas! by Anonymous Coward · · Score: 0

      I'm all for lambdas, closures, currying etc, but I think it was a mistake to include them in Java. The syntax is necessarily very un-Java-like and extremely cluttered with exception declarations. More importantly, Java already had closures in the form of inner classes. Ok, the syntax is still a bit cumbersome but all Java programmers have been dealing with them since day one (listeners) and are familiar with the related idioms. Lambdas don't add any new functionality or expressive power.

    7. Re:Lambdas! by GiganticLyingMouth · · Score: 1

      I'm aware your comment was mean facetiously, but lambdas were also added to C++ in C++11

    8. Re:Lambdas! by lgw · · Score: 1

      It's also painful to watch how long C# will have had lambda (and the handy list-processing constructs that lambda's so handy for!) before Java releases with it. I wasn't a fan of C# until I had to use Java professionally, but that really made me appreciate C#.

      --
      Socialism: a lie told by totalitarians and believed by fools.
    9. Re:Lambdas! by Hentes · · Score: 2

      Apparently, these lambdas don't even form real closures, their free variables can only be final ones.

    10. Re:Lambdas! by Anonymous Coward · · Score: 0

      I don't get it. Why would that matter?

    11. Re:Lambdas! by lgw · · Score: 1

      Why is it painful to replace a simple function call with a multi-line for loop to map a function over a list? Why is it painful that you can't even have List<int> in Java?

      --
      Socialism: a lie told by totalitarians and believed by fools.
    12. Re:Lambdas! by Anonymous Coward · · Score: 0

      Yeah? And Lisp has had it for like 40 fucking years. God, I hate this new batch of douchy brogrammers.

    13. Re:Lambdas! by Anonymous Coward · · Score: 0

      I though you had an account here Paul? Why post as AC?

    14. Re:Lambdas! by physburn · · Score: 1

      I don't get what Lambdas are supposed to do, can someone explain?

    15. Re:Lambdas! by Hentes · · Score: 1

      Closure is a technical term for variable capture, and Java8 doesn't have it.

  3. Nothing about security by tepples · · Score: 0

    Did you Ctrl+F the linked page for "secu" too? I didn't find anything.

  4. Java has too many versions by Anonymous Coward · · Score: 0, Offtopic

    The Java language changes too much. All this meddling with the language isn't okay. It screws with compatibility, screws with VMs, screws with IT departments, etc.

    And from the programmer's point of view, it requires constant education and rewriting of code with very little benefit. What was the problem with the old language?

    This is all because the language is managed by a corporation. At least the standards bodies don't give us new versions more frequently than once-per-decade. (Although I don't think C needs the periodic changes it gets either.)

    Also, get off of my lawn.

    1. Re:Java has too many versions by viperidaenz · · Score: 3, Informative

      How exactly does it screw with compatibility? Old code will still compile. Old compiled classes will still load.
      They're adding new stuff. Nothing old is being changed or removed.
      You don't *have* to re-write anything. If someone tells you so, its because they want to.

      It only screws with IT departments because they fear change. They also seem to not want to install security updates either.
      The only JVM upgrade problems I've experienced in the last 10 years was with legacy code written for IBM's 1.3 JVM because the developers at the time thought it was a good idea to refer to com.ibm classes.

    2. Re:Java has too many versions by Billly+Gates · · Score: 0

      How exactly does it screw with compatibility? Old code will still compile. Old compiled classes will still load.
      They're adding new stuff. Nothing old is being changed or removed.
      You don't *have* to re-write anything. If someone tells you so, its because they want to.

      It only screws with IT departments because they fear change. They also seem to not want to install security updates either.
      The only JVM upgrade problems I've experienced in the last 10 years was with legacy code written for IBM's 1.3 JVM because the developers at the time thought it was a good idea to refer to com.ibm classes.

      Or we have software that needs to run? Laugh at I.T. departments all you want but we never had to worry about Vista. We never had issues with ME because we never had to run it. We didn't have to worry about the ribbon either as we gradually learned at home how to use it. We never had to worry about our browsers being broken every 6 weeks either. Sure they may not have the latest wizz bang checklist features but most sites still only develop for IE 8 anyway.

      At home I use Android SDK which only runs Java 6. I plan to keep it as Java 7 had all the security issues that 6 never had because Sun wrote 6 and not Indian interns at Oracle who never touched it before.

      You are right I fear change as I see Windows 8 and just reformatted my system because I had to use the headache inducing horrible gui of Office 2013 in its all white glory with no borders or colorless gray. YUCK.

      Windows 7/XP and older software works fine thank you very much and I do not want to change. It is supperior and I do not have to be a guinne pig to make sales numbers for WIndows 8/0ffice 2013. MS literally called every retailer to get office 2010 off the shelves!! Assholes.

    3. Re:Java has too many versions by viperidaenz · · Score: 1

      My IT department is still running Java 6 update 5 from 2008. They're too scared to upgrade to any later update levels because no one is going to give them the money to regression test every piece of Java code we've got.

      The only saving grace is there is no browser plugin installed.

      There has been well over 200 security issues fixed since 2008. As a bonus there has been significant performance improvements.

    4. Re:Java has too many versions by viperidaenz · · Score: 1

      Oh, and good luck with XP in 12 months time when there are no more security updates.

    5. Re:Java has too many versions by Anonymous Coward · · Score: 0

      The Java language changes too much. All this meddling with the language isn't okay. It screws with compatibility, screws with VMs, screws with IT departments, etc.

      And from the programmer's point of view, it requires constant education and rewriting of code with very little benefit. What was the problem with the old language?

      This is all because the language is managed by a corporation. At least the standards bodies don't give us new versions more frequently than once-per-decade. (Although I don't think C needs the periodic changes it gets either.)

      Also, get off of my lawn.

      Pretty much every single thing you said is wrong. I would like to believe this is sarcasm, but you are probably either a "java is javascript lol" idiot, or just a really shitty programmer.

    6. Re:Java has too many versions by lgw · · Score: 1

      IMO, there's no problem with adding language features, but there's a big problem in that new JVM versions aren't always safe to move to! (And you can't use the new language features without the new JVM, of course).

      There have been JVM point releases with memory leaks, and with serious performance degradations, in oddball corner cases. If your software happened to live in one of those oddball corners, and you moved to the latest JVM without full regression testing, you were hating life.

      So simply moving to a JVM that supports new language features means you need a full regression cycle, which is just not a problem that I've faced with other languages. I've seen builds break when moving to the latest C++ compiler, but never performance or memory leak issues when doing so!

      --
      Socialism: a lie told by totalitarians and believed by fools.
    7. Re:Java has too many versions by LordLimecat · · Score: 1, Informative

      They're adding new stuff. Nothing old is being changed or removed.

      Oh, ok, we'll tell that to all the apps that broke with JRE > 1.4.2u9 (ie, Cisco ASA crap). Or the apps that broke with JRE >1.5. Or >1.6u9.

      If you havent seen incompatibilities due to java upgrades, be thankful: it means that you havent seen much of java.

    8. Re:Java has too many versions by viperidaenz · · Score: 1

      It means I haven't seen that much bad Java code.

    9. Re:Java has too many versions by Hypotensive · · Score: 1

      They're adding new stuff. Nothing old is being changed or removed.

      Actually the old JavaScript engine is being removed and replaced with a completely new implementation.

      Given how many undocumented hoops you had to jump through to do anything useful with the last one, I'm really not looking forward to this.

    10. Re:Java has too many versions by Hognoxious · · Score: 1

      Old code will still compile. Old compiled classes will still load.

      In theory, yes. In practice I've had problems with java programs being very picky about which runtime they need.

      --
      Confucius say, "Find worm in apple - bad. Find half a worm - worse."
    11. Re:Java has too many versions by julesh · · Score: 1

      My IT department is still running Java 6 update 5 from 2008. They're too scared to upgrade to any later update levels because no one is going to give them the money to regression test every piece of Java code we've got.

      If they'd demanded automated tests of every functional requirement (which has been a standard best practice since some time around the mid 90s, so they aren't likely to have any Java code hanging around from before the industry woke up and realised how important it was), it would be less than a day's work to perform those regression tests, and would likely not take more than a few more days to fix any problems found. The new features would probably make the effort pay back in less than a month.

      But they clearly ignored industry practice, presumably in the name of economy and getting the job done quickly, so you're stuck with an unmaintainable obsolete code base. And are probably still writing legacy code today.

    12. Re:Java has too many versions by benhattman · · Score: 1

      And from the programmer's point of view, it requires constant education

      Boo hoo hoo.

      Anyone who finds an incremental addition of a handful of new language features every 4 years to be too hard should honestly go into another profession. If you went into computer programming, you signed up for learning new things at least a couple times a decade. If you don't want to learn new things and you insist on programming, I guess teach yourself COBOL and you should be in good shape.

      Though there are 7 major versions of Java, only two of them added any language features to the source code (5 and 7). The rest of the releases did nothing more than add standard libraries, garbage collector fixes, other jvm optimizations, etc. And every single change to date has been backwards compatible. You can take code you wrote in 1997, compile it today, and it will run at least as well as it did then

    13. Re:Java has too many versions by viperidaenz · · Score: 1

      As long as you used the ScriptEngine interfaces correctly, you'll be fine. Nothing stopping you from continuing to include Rhino though. It's built and maintained by Mozilla.

    14. Re:Java has too many versions by viperidaenz · · Score: 1

      You're right, I am still writing code for a system that was built in the late 90's. It pays very well too.
      As far as I'm aware though, there have been no issues with upgrading all the way from Java2, 1.3, 1.4 and 1.6

      As for fully automated testing, yes it is a best-practise. It also seems to be one that is never applied.
      The last from-scratch project I worked on did start writing automated tests. They had one tester allocated to that.
      They had ~30 testers at one point doing manual testing.

      While the automated tests did end up covering a fair portion of the system, it would still take a week of a half a dozen testers to run the manual tests.

  5. Will it run Minecraft? by SpaceManFlip · · Score: 1
    THat's all that matters. How many headshots can you achieve with the diamond laser pickaxe?

    Or I guess it could be considered relatively important also not to allow drive-by downloads of malicious software from webpages that you didn't even click anything on

    1. Re:Will it run Minecraft? by viperidaenz · · Score: 1

      I don't see the risk if you don't install the browser plugin.
      Java belongs on servers, not in browsers. (perhaps the occasional desktop software too)

  6. LOL Java by Anonymous Coward · · Score: 0, Flamebait

    Has it stopped being an overly-verbose, memory-hogging, slow pain the ass?

    1. Re:LOL Java by Lendrick · · Score: 0, Flamebait

      > Has it stopped being an overly-verbose, memory-hogging, slow, insecure pain the ass?

      FTFY

    2. Re:LOL Java by angel'o'sphere · · Score: 3, Informative

      For non trivial programs Java does not use more memory than an equivalent C++ program.

      Same for speed. Unless you have a brain dead "repeat 1000 times" benchmark, Java is as fast as any other language.

      After all: it gets compiled down to the same machine code ...

      --
      Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
    3. Re:LOL Java by K.+S.+Kyosuke · · Score: 3

      For non trivial programs Java does not use more memory than an equivalent C++ program.

      Only if the large majority of your data is in non-object arrays, or in very large objects so that the headers and overhead are small enough.

      --
      Ezekiel 23:20
    4. Re:LOL Java by Anonymous Coward · · Score: 1, Informative

      After all: it gets compiled down to the same machine code ...

      No, it doesn't. C++ gets compiled into machine code. Java gets compiled into bytecode that is run on the Java Virtual Machine. Also Java uses garbage collection, which can slow things down.

    5. Re:LOL Java by lorinc · · Score: 2

      Same for speed. Unless you have a brain dead "repeat 1000 times" benchmark, Java is as fast as any other language.

      After all: it gets compiled down to the same machine code ...

      Not exactly. Java is unable to vectorize floating point operations now (might change with java8 though), which is very common in any multimedia application. So it remains a lot slower than what you get by default in C/C++ with a decent compiler.

    6. Re:LOL Java by tepples · · Score: 1

      Java does not use more memory than an equivalent C++ program.

      In an exclusively garbage-collected language with no deterministic finalization, it isn't possible to do something like C++ RAII, where non-memory resources are closed as soon as an object is destroyed, in Java.

      After all: it gets compiled down to the same machine code

      But you still have to keep the bytecode and the VM in memory at all times, which hurts especially on a mobile device.

    7. Re:LOL Java by HarrySquatter · · Score: 1

      Same for speed. Unless you have a brain dead "repeat 1000 times" benchmark, Java is as fast as any other language.

      That's funny since those contrived benchmarks are the only ones Java can actually win. Usually because the C++ code is also set to no optimizations. If this were really true why are all the high-performance multimedia, mathematics, etc. libraries all still written in C, C++ or Fortran? That's because Java is still magnitudes slower.

    8. Re:LOL Java by c0lo · · Score: 1

      it isn't possible to do something like C++ RAII, where non-memory resources are closed as soon as an object is destroyed,

      Like allocating and deallocating the c_buff buffer each time a "std:string" gets created on the stack? And you think this is fast?

      After all: it gets compiled down to the same machine code

      But you still have to keep the bytecode and the VM in memory at all times, which hurts especially on a mobile device.

      I doubt that APK (that is: an Android Package, not the hosts-file dead-horse) requires more than one JIT compilation (which is cached afterwards) and the GC in memory.

      --
      Questions raise, answers kill. Raise questions to stay alive.
    9. Re:LOL Java by viperidaenz · · Score: 2

      C++ is unable to perform comprehensive escape analysis (good for optimising multi-threaded code). C++ also lacks the ability to optimise virtual method calls.
      Java can inline non-final methods and undo it if required.

      There is a *lot* of stuff you can do when you have runtime optimisations as well as compile time.

      You're technically correct in the Java is not compiled to machine code. The JVM does the bytecode to machine code compilation.

    10. Re:LOL Java by SplashMyBandit · · Score: 4, Interesting

      That's because Java is still magnitudes slower.

      I'm afraid I have to disagree. I'm writing a modern jet combat simulator in Java and the runtime speed is fine. The bottleneck is never the CPU, it is always the GPU. I also have to say that Java's performance in terms of latency is very good. The reason for this is because I'm able to create a lot of threads very easily and Java manages resource sharing very well, plus use of the language features for synchronization threads and I get to use around 20% of each of the eight cores on my machine. When I use an excellent product in a similar niche called DCS:World I do notice that it's speed is somewhat hampered by the C++ running on a single core. Now yes, multi-threading in C++ is of course possible, but it is much tricker than Java, especially the resource management.

      So I think your comment is not correct. Java is comparable to C++ (sometimes faster, sometimes slower) on a single thread. When it comes to overall performance I find Java is faster overall because it is much easier to utilize all the cores in a machine with Java. In terms of gaming the performance of programming language used is nearly irrelevant - it is all down to how well you use the GPU (especially GPU memory; if you can keep stuff in VRAM then your performance is awesome).

      Finally, let's move from the speed that is not that relevant (runtime) to the speed that actually matters (development time). Java is much much faster to develop in. You do have to spend some time profiling and tuning a Java program, but since you spend far far less time debugging than C++ you are still winning. I also love the JVisualVM that comes with the Sun/Oracle JDK and OpenJDK. While C++ has profilers they are a hassle to use, you have to compile your program each time you want to profile and recompile to measure different metrics. With JVisualVM you can profile any Java program without source and without recompilation since the monitors are built into the JVM (in exactly the same way as performance counters are built into operating systems these days, accessible by dtrace, strace, truss etc).

      So, I think C++ is best used in niche programs where the host environment measures its memory in kilobytes. For other applications Java is more than fast enough on a single thread, has better throughput on multi-core machines, and is *much* faster to develop in (saves money, and also means something gets delivered sooner, as in, "faster time to market"). That's why Java kicks ass on the Tiobe Index - even if users only know about it from Minecraft and browser plugin issues.

    11. Re:LOL Java by viperidaenz · · Score: 2

      You don't need to wait till an object is garbage collected for non-memory resources to be closed. You call the close method (in a finally block, or use the try-with-resources introduced in Java 7)
      The C++ compiler doesn't manage resources entirely for you. You need to do that yourself in your destructor.

      If keeping bytecode in memory was really a deal breaker, there is nothing stopping the use of memory mapped files.

    12. Re:LOL Java by Anonymous Coward · · Score: 0

      What? I count 4 instructions for std::string on the stack.

      => 0x0000000000402a20 : mov 0x2c3459(%rip),%rax # 0x6c5e80
            0x0000000000402a27 : add $0x18,%rax
            0x0000000000402a2b : mov %rax,(%rdi)
            0x0000000000402a2e : retq

    13. Re:LOL Java by K.+S.+Kyosuke · · Score: 2

      First, the compiler algorithms are virtually identical in both cases, save for the expansion of method calls (vtables vs. multiple types of inline caches). Second, GC hardly affects overall speed if it's good enough (Azul Zing). The problem with Java's memory model is more about the lack of developer-controlled locality - if everything is an object accessed by reference, you end up with a lot of tiny pieces scattered around your memory. There's both size and speed overhead to that, no matter whether the whole thing got malloc()ed or allocated by a bump-a-pointer allocator with GC.

      --
      Ezekiel 23:20
    14. Re:LOL Java by K.+S.+Kyosuke · · Score: 1

      You're technically correct in the Java is not compiled to machine code. The JVM does the bytecode to machine code compilation.

      That's like saying that it wasn't me who wrote this sentence, but instead I caused my fingers to move with the power of my will and my fingers wrote it instead. Java *is* compiled to native code. The last time I checked, the present simple tense was used for statements with general validity, and the general truth is that the majority of installed Java runtimes on PCs run the majority of opcodes executed *after* compiling them to native code. I don't see how you can make a more general statement than that.

      --
      Ezekiel 23:20
    15. Re:LOL Java by K.+S.+Kyosuke · · Score: 1

      In an exclusively garbage-collected language with no deterministic finalization, it isn't possible to do something like C++ RAII, where non-memory resources are closed as soon as an object is destroyed, in Java.

      If only we had something like dynamic-wind to deallocate resource we don't need anymore in GC'd languages... Oh, wait, we do!

      --
      Ezekiel 23:20
    16. Re:LOL Java by Lawrence_Bird · · Score: 0

      I think Linus would agree, C++ is best used nowhere.

    17. Re:LOL Java by nitehawk214 · · Score: 2

      > Has it stopped being an overly-verbose, memory-hogging, slow, insecure pain the ass?

      FTFY

      Sounds like you got screwed.

      --
      I'm a good cook. I'm a fantastic eater. - Steven Brust
    18. Re:LOL Java by c0lo · · Score: 1

      try something like
      {
      std::string aux="Dummy message: ";
      aux=aux+" hello buddy"; // would be better a "computed value" here, based on an outer cycle index
      std::cout << aux.c_str() << std::endln;
      }

      and see how RAII goes.

      --
      Questions raise, answers kill. Raise questions to stay alive.
    19. Re:LOL Java by lgw · · Score: 1

      I've used both, and I find it much easier to manage threads on C++ than Java. They both offer thread management, it's just a matter of what libraries you're used to.

      Similar to "what language is faster to develop in". The language you know well is faster. I spend far less time debugging in C++ (and no time at all chasing leaks, thanks to RAII and Scoped Objects), and much less time worrying about resource management. Once again, because of what tools I'm familiar with.

      The one place where C++ is just structurally weak is in making GUIs-coupled-tightly-to-Databases. Static typing and the lack of reflection or an Object class just make Hibernate/Rails/other GUI+ORM development unworkable. Which is one firm reason C++ is better: GUI+ORM development is the most boring and poorly paid area to work in!

      --
      Socialism: a lie told by totalitarians and believed by fools.
    20. Re:LOL Java by HarrySquatter · · Score: 1, Interesting

      I'm afraid I have to disagree.

      And yet your anecdote doesn't really answer my question. If Java was so fast why do all the high performance libraries for things like multimedia not use it? Even the multimedia classes in Java's own stabdard library use native code libraries under the covers because pure Java would be too slow.

      Now yes, multi-threading in C++ is of course possible, but it is much tricker than Java, especially the resource management.

      I write multithreaded C++ code with Qt all the time. It is absolutely trivial. What is supposed to be tricky?

    21. Re:LOL Java by HarrySquatter · · Score: 1

      I've used both, and I find it much easier to manage threads on C++ than Java.

      Same here. Too many people extrapolate their own subjective experiences in using different languages as if they were a universally shared thing. Hell I know plenty of Python and Ruby programmers who find Java to be far less productive in their work.

    22. Re:LOL Java by jbolden · · Score: 1

      Same for speed. Unless you have a brain dead "repeat 1000 times" benchmark, Java is as fast as any other language.

      Based on what? Java is rather fast but I have to see any other area of performance where it exceeds C/C++ and quite a few it is well slower than C/C++. The way it handles code is too similar. So by what metric is it "just as fast"?

      And no it doesn't get compiled down to the same machine code. Abstraction adds complexity in machine code. That's why Fortran, C and Assembly consistently outperform higher level languages.

    23. Re:LOL Java by SplashMyBandit · · Score: 2

      If Java was so fast why do all the high performance libraries for things like multimedia not use it?

      There are pure Java codecs. They work fine. It is not the C++ that is necessarily fast, but the inline assembler you can put in. In fact, the perfect analogy of using native libraries in Java is when C++ is too slow and you use inline assembler. In both cases you use a higher level abstraction for the huge productivity boost and switch to the lower level abstraction only when you really have to (which is become more and more rare these days) - when you are prepared to sacrifice portability for performance (on a single target). After doing C++ for nearly two decades I hate going back. Java is always my first choice unless I have some other reason (which is getting more and more rare these days).

      I write multithreaded C++ code with Qt all the time. It is absolutely trivial. What is supposed to be tricky?

      Resource management in a non-deterministic program. Releasing resources neither too early nor too late is problematic. For large data sets this is a problem (I don't know whether you are near the memory limits of your machine, or have smaller programmes) and is why very many modern environments use garbage collection to take the burden of the developer (especially as programs go from large, where any technique can work, to huge).

    24. Re:LOL Java by jbolden · · Score: 2

      When people talk about benchmarks in terms of faster they mean performance not development. In terms of development time, Java gets crushed by much higher level languages. As for projects that aren't CPU constrained but constrained by something else, you are just saying you don't care about performance. That's wholly different than Java having C like performance.

      As for multithreaded, C++ is obviously faster. If you want non tricky multithreaded languages like Haskell or Eiffel crush both of them.

      And no on a single thread Java is not comparable. It generally is in the range of 1.5-5x slower. Which ain't bad at all, but I have yet to see any situation in which it is faster.

    25. Re:LOL Java by Anonymous Coward · · Score: 0

      Straight C is the way to go if you want speed.

    26. Re:LOL Java by SplashMyBandit · · Score: 2

      Bro, your 1.5-5x is just not true unless the Java was written by idiots (and as we old timers remember the chestnut, "You can write bad FORTRAN in any language"). Even in 2008 Java was beating C++ and approaching FORTRAN for speed, citation follows. Now you can cherry pick whatever benchmark you want and it will show C++ as faster, and I'll choose another benchmark and that will show Java as faster. That means they are about on par with regard to performance (that wasn't true in the past, but is true today).

      Here's the citation about the "Current State of Java for High Performance Computing", written in 2008 (the JVM has got *much* faster since then):
      http://blogs.oracle.com/jag/entry/current_state_of_java_for
      Please note that the report was written by INRIA, the French Scientific Supercomputing outfit - it is not a fluff whitepaper from a vendor (who will lie to make sales). If you can flaw the INRIA paper I'd be very interested to hear why you are right and they are wrong.

      When people talk about benchmarks in terms of faster they mean performance not development

      If your development time is so long the project stakeholders may cancel it. That is the major cause of software development failure. If you time to develop is long your time to market is also long. That can mean missed opportunity and even business death. So the long development time might be appropriate for the toy QT programs you develop, but it completely blows for large commercial projects where you have a big team and the set of people who start a project may not be the set of people who finish (people get pregnant, get sick, get promoted, all sorts of stuff). Once you start looking past just the purely technical stuff you have quite a different view of technology. That's why few people choose C++ to start a project these days.

      In terms of development time, Java gets crushed by much higher level languages.

      I find that most of those higher level languages tend to be fairly good at one domain. They are faster to develop in, if you are doing the problem they were designed to solve, and then they suck. The runtime performance of higher-level language blows. eg, Groovy, Ruby, Python are not in the same league as C++/C/Java/C# etc. For most modern applications it simply doesn't matter anymore, because you are waiting for a database, or the network, or user input (**slow**), or the GPU, or the memory bus, etc etc. It is only if you are stuck doing batch operations that it really matters. Now I'm waiting for you to say, "but, but, multimedia!". The reality is that multimedia should be done in hardware. I use Java+JoGL+OpenGL for this. This destroys C++ (or any other software implementation) for performance. Horses for courses my friend. That's why few people use C++ anymore - we understand it well (used it for decades) - but realise that implementing a new commercial application with it is just duh stooopidd.

    27. Re:LOL Java by Mr+Thinly+Sliced · · Score: 1

      This destroys C++ (or any other software implementation) for performance.

      Of the top of my head:

      • * Java doesn't allow management of packed arrays of structs. This means you can't do things like cache optimisation of data structures. You can kind of get there by using nio buffers and ugly map to offset style things, but it's just ugly and unwieldy. Cost for no reason.
      • * Java suffers from predictability problems. Jitter introduced by the system management threads and mutexes causes stalls to threads that you have no control over. There is a realtime Java VM, but it's not really "Java" as you can't use standard Java libraries and classes.
      • * Related to the point above - in code with strict scheduling deadlines, you can't use dynamic memory allocation (this goes for C++ as well as Java), but using any of the standard Java libraries and/or objects allocates memory all over the place. You can use things like the Javolution collections to get around these issues.
      • * Java's GUI toolkit (swing) allocates memory all over the place meaning all the hard work you put into a no-allocation loop in your code is wasted when using a JTabbedPane allocates massive amounts of memory just by moving your mouse over it.

      I like Java as much as the next Java programmer, but the picture isn't that rosy when it comes to things needing real performance. C++ provides quite a few tools that can blow Java out of the water, purely because there's no runtime overhead and you have deterministic overhead. Add in the ability to manage cache line access and C++ will quickly run away with the title.

      C++ doesn't make you pay for anything you aren't using and offers quite a few tools that allow micro-management of performance in a way Java simply cannot.

    28. Re:LOL Java by viperidaenz · · Score: 1

      Java is *not* compiled to native code unless the JVM decides it should be.Not all byte codes are compiled, it is faster to run it as interpreted code if you're only going to run the code a few times.

      Also, not all JVM's have a JIT compiler.

      Most bytecode is not compiled since it is not run frequently. Why do you think the JIT compiler is called HotSpot? It compiles hot spots of code in to machine code.
      The code also isn't necessarily compiled in the same thread that the code runs it. A larger large loop will probably run quite a few iterations in the interpreter while the code is being compiled to machine code, once that has finished, the machine code is run instead. The last thing you want is more unpredictable latency in your application. You also don't want one thread stalling while it waits for code to compile when there may be other cpu's sitting idle.

    29. Re:LOL Java by SplashMyBandit · · Score: 1

      * Java's GUI toolkit (swing) allocates memory all over the place meaning all the hard work you put into a no-allocation loop in your code is wasted when using a JTabbedPane allocates massive amounts of memory just by moving your mouse over it.

      This is true if you are dealing with smartphones. In that case GCJ is an alternative, or C++. However, it is hard to find a *current* system that is so memory limited that this is an issue.

      * Related to the point above - in code with strict scheduling deadlines, you can't use dynamic memory allocation (this goes for C++ as well as Java), but using any of the standard Java libraries and/or objects allocates memory all over the place. You can use things like the Javolution collections to get around these issues.

      Multimedia is soft realtime. You simply spend memory to read ahead. If you are talking about controlling stepping motors in software (which I've done in the past), then it is a problem. If you are controlling stepping motor device driver hardware then it is not a problem. Sorry, I just can't see a case where you need a hard realtime requirement and C++ would make a difference compared to Java. You would always do any hard realtime in hardware when you are worried about microsecond jitter (since it is the *operating system* that screws your jitter up, the difference in userspace Java vs C++ is neglible if you have idle cores ready to respond to work)

      But let us suppose for a moment you do have a hard-realtime requirement in your software. Then I would say, "Go ahead and use C++ if you think it would make a difference". It turns out that the amount of software that would fit this niche is small and getting smaller. But again I will remind you that the difference in determinism between C++ and Java is negligible if you have ever cared to measure them on a modern desktop O/S. It is the O/S that is the major source of jitter that will break your realtime requirements, not the software stack you are using.

      * Java suffers from predictability problems. Jitter introduced by the system management threads and mutexes causes stalls to threads that you have no control over. There is a realtime Java VM, but it's not really "Java" as you can't use standard Java libraries and classes.

      All multi-threading systems suffer this, do they not? This is one of the reasons that increasing the number of threads does not increase performance linearly (in general) even if you have one core per thread. However, the efficiency loss of multi-threading doesn't matter because total throughput increases. As I mentioned in my earlier post, having 8 cores at 20% utilization has vastly better jitter than the comparable single threaded C++ program in the same niche (DCS:World). I would assume that there are plans to add threads to the C++ codebase of that product, but I would imagine it is so complex to do (retrofit to an existing C++ program) that even after several years it has not yet happened. One cannot simply dismiss the superior language constructs for synchronization when it comes to development effort. By having these (portable) language constructs it makes it easier to get massive multi-threading working correctly in Java relative to C++, and hence the jitter goes down and total throughout goes up. Conclusion, for less effort you get better total throughput with Java (assuming your problem can be parallelized; as most complex applications can).

      * Java doesn't allow management of packed arrays of structs. This means you can't do things like cache optimization of data structures. You can kind of get there by using nio buffers and ugly map to offset style things, but it's just ugly and unwieldy. Cost for no reason.

      I'm glad you concede that NIO can solve the problem. Yes, they are slightly unnatural compared with the simplicity of most of Java. However, I would argue that they are a lot more safer and portable than fudging around with poi

    30. Re:LOL Java by carnivore302 · · Score: 1

      When first reading your comment I though wtf?! After the second time I knew it must be sarcasm.

      --
      Please login to access my lawn
    31. Re:LOL Java by angel'o'sphere · · Score: 1

      C++ objects also have an header/overhead. Where do you think the VTAB (virtual function table) is referenced?

      With more I mean ofc significantly more. If I have a million objects and each of them has 4 extra bytes, that is 4 mega byte ... not much imho.

      --
      Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
    32. Re:LOL Java by Mr+Thinly+Sliced · · Score: 1

      On GUI toolkit memory allocations - This is true if you are dealing with smartphones. In that case GCJ is an alternative, or C++. However, it is hard to find a *current* system that is so memory limited that this is an issue.

      Unnecessary memory allocations increase the cache pressure on the CPU introducing extra memory stalls and forcing the VM to interrupt threads.

      Multimedia is soft realtime. You simply spend memory to read ahead. If you are talking about controlling stepping motors in software (which I've done in the past), then it is a problem. If you are controlling stepping motor device driver hardware then it is not a problem. Sorry, I just can't see a case where you need a hard realtime requirement and C++ would make a difference compared to Java. You would always do any hard realtime in hardware when you are worried about microsecond jitter (since it is the *operating system* that screws your jitter up, the difference in userspace Java vs C++ is neglible if you have idle cores ready to respond to work)

      You seem to neglect the importance of low jitter - and you're writing a game? I write audio applications and have my prototyping in Java, but the real application in C++. I've measured the difference, and it's night and day. Java introduces another jitter source (VM stalls due to signals for housekeeping) that dwarf OS level jitter. It's not just a case of turning on the parallel garbage collector, either. Your threads still are interrupted. No such interruption occurs with native threads - even on a non-realtime OS.

      But let us suppose for a moment you do have a hard-realtime requirement in your software. Then I would say, "Go ahead and use C++ if you think it would make a difference". It turns out that the amount of software that would fit this niche is small and getting smaller. But again I will remind you that the difference in determinism between C++ and Java is negligible if you have ever cared to measure them on a modern desktop O/S. It is the O/S that is the major source of jitter that will break your realtime requirements, not the software stack you are using.

      I have measured it. Lowest audio output latency with Java in no-allocation loop is around 40 ms on a core2 2.4Ghz - same machine with C++ and I'm down in the sub-milliseconds. It's that big a difference.

      but I would imagine it is so complex to do (retrofit to an existing C++ program) that even after several years it has not yet happened. One cannot simply dismiss the superior language constructs for synchronization when it comes to development effort. By having these (portable) language constructs it makes it easier to get massive multi-threading working correctly in Java relative to C++, and hence the jitter goes down and total throughout goes up. Conclusion, for less effort you get better total throughput with Java (assuming your problem can be parallelized; as most complex applications can).

      You seem to have the idea that C++ is "C with objects". Threads in modern C++ are no more difficult to use or pool that in Java. But C++ threads won't get blocked unless you choose. Modern C++ has better granularity with synchronisation primitives too - with varying levels of relaxation for atomics. In C++ you get to deal with the actual primitive - not an abstracted Java Object that's increasing the pressure on the CPU cache.

      I'm glad you concede that NIO can solve the problem. Yes, they are slightly unnatural compared with the simplicity of most of Java. However, I would argue that they are a lot more safer and portable than fudging around with pointers to achieve the same goal (as in, with pointers you have all sorts of awful macros to handle alignment, memory model and word size differences on different platforms; in Java this is transparent to you).

      Again, you've missed how modern C++ deals with packed array structures. Us

    33. Re:LOL Java by angel'o'sphere · · Score: 1

      You seem not to know what the word magnitude means.
      It means: by a factor of ten.
      The libraries you mentioned are written in the languages you mentioned because they are used by said languages.
      E.g. see colt: http://acs.lbl.gov/software/colt/
      The rest of the stuff like 'multimedia' makes no much sense as this is all build in into the Java environment and if younuse it you are calling the C functions implementimg it ...

      --
      Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
    34. Re:LOL Java by SplashMyBandit · · Score: 1

      Unnecessary memory allocations increase the cache pressure on the CPU introducing extra memory stalls and forcing the VM to interrupt threads.

      I intend my processes to be interruptable. That gives me low jitter.

      Lowest audio output latency with Java in no-allocation loop is around 40 ms on a core2 2.4Ghz - same machine with C++ and I'm down in the sub-milliseconds. It's that big a difference.

      That is a big difference indeed. Is it possible for you to go into a little more detail of why you get 40 ms in Java? How granular are your units of work.

      Well, I'm sure it's good enough for you, but when you start putting some actual logic into your flight sim for your fluid dynamics and attempt to do this with low latency you'll start to see the jitter problems with Java.

      Nobody solves the Navier Stokes equations in real time. Flight models are surprisingly light weight (in runtime use, not in complexity) in fact there used to be a demo using the NASA F-16 flight model in very old versions of Java that ran very smoothly (one of the old JoGL demos on an old JVM and old machines, and ran beautifully). Again, I think you are buying into a myth that C++ is required for even something as heavy as a flight sim (where a lot more than mere flight modelling goes on).

      Where I see jitter is in the IEEE 1278.1 comms. The jitter is caused by the network - and this is vastly below the latency across the intertubes. I also use a dead reckoning algorithm to compensate for dropouts, latency/jitter spikes. Please also note that at a 60 Hz frame rate a human cannot distinguish any visual activity that occurs faster than 17 ms. In general, most people are ok to around 40 ms. It is only when you get spikes much longer than this that people notice. So that is why your result seems surprising. Another interesting metric is that to render a quarter-million triangle F-16C Block 52 model and a GLSL shader physics based atmospheric transmission model with a Intel 2600k chip and a Radeon 5970 (dual-GPU, but quite old) I can get over 700 fps (limited by the GPU, not Java and not the CPU). The CPU core responsible is mostly twiddling its thumbs during this activity. The other cores have more work doing the network protocol and aerodynamics, but it is all pretty light weight (all AI activity is performed on the server, so the client machine doesn't have much to do).

      There's a reason that modern games are still written in C++ rather than a managed language - when you need to extract performance in a predictable way you want determinism. Managed languages can't provide that guarantee.

      The IL-2 Sturmovik simulator was mostly written in Java. It did use C++ for heavy lifting because the JVMs of the era were slow. That is simply not the case anymore. Minecraft is a very popular multiplayer game written in Java. Bohemia Interactive's Take On Helicopters and Armed Assault III have Java APIs for modding, so at least some parts must be in Java (even if an integration layer) - which means when you attach Java it still runs with acceptable jitter (because of course, the jitter is determined by the 'weakest link' not the average of components). And as I will repeat, my *experience* with using Java for a game is that the CPU-components run as smooth as silk and I have low jitter. The CPU is always waiting for the GPU (in fact, some of my synchronization is doing deliberate yields [introducing jitter] while waiting for the GPU to be ready for the next frame).

      So, the fact that you are having *huge* 40 ms latencies sounds *extremely* fishy to me. So I'm curious about what you are doing that makes the latency so enormous. I'm saying latency here based on the word you used. You do know that jitter is variation in latency yes? It is jitter that is the killer, not latency. Both jitter and latency can be compensated for by proper buffering, of course. Are you streaming from disk without any buffering or a

    35. Re:LOL Java by SplashMyBandit · · Score: 1

      One thing I forgot to mention. You've seen the JOAL library, yes? That's what I'm using for audio. Works great. I get to stay with the niceness of Java, get 3D sound effects, and its portable. As I mentioned in an earlier post, the strength of Java is in its vast wealth of libraries.

    36. Re:LOL Java by Mr+Thinly+Sliced · · Score: 1

      All the games you mention bar Minecraft have a native core engine that isn't written in Java.

      Minecraft itself isn't exactly a good advertisement for Java performance in games - and I'm not blaming Notch for that. Most of the bad press it gets performance wise is due to VM stalls.

      And as I will repeat, my *experience* with using Java for a game is that the CPU-components run as smooth as silk and I have low jitter.

      I suspect the jitter is below your perception level since the GPU is doing the heavy lifting.

      In my case I have Java DSP code generating audio samples - no filesystem reads / writes. Floats are generated as a block into the NIO buffer.

      I'm using JavaJack as the audio connector to Jack - the standard Java audio engine is terrible.

      Basically Jack DSP thread makes a callback that provides NIO buffers to do the DSP calculations and place the result in (simply generating a 440hz sine wave, for example). The lowest output latency I can get with Java without jitter causing pops and clicks is about 40ms (1024 samples * 2 periods) as I mentioned. I've verified zero memory allocations and turned off UsePerfData too (UsePerfData can cause VM stalls due to the mutex around writing the performance data).

      When tracing the VM using sysprof I can see the VM is trapping a signal to do it's housekeeping every X iterations which halts all running threads. This is on both OpenJDK1.8 and Suns JDK 1.8.

      Using latencytop on the machine at the same time shows the VM spending time in userspace lock contention and waiting for events (timeouts for the housekeeping threads).

      I notice you didn't mention realtime Java. I'll ask again - if the Java VM doesn't have jitter - why do the realtime specification and VM's exist? (since realtime is all about predictability).

    37. Re:LOL Java by Mr+Thinly+Sliced · · Score: 1

      One thing I forgot to mention. You've seen the JOAL library, yes? That's what I'm using for audio.

      Funny you mention that - as the DSP isn't happening in Java.

      As I mentioned in an earlier post, the strength of Java is in its vast wealth of libraries.

      But that's not a java library - it's a java veneer on top of a native library.

    38. Re:LOL Java by jbolden · · Score: 1

      The Oracle HPC paper put the overhead at 1-1.5 (i.e. Java at 40-50% of the gcc Fortran version). They used Fortran as a benchmark for Java. There were no areas of outperformance and that was with a rather mediocre Fortran compiler. Your own paper doesn't support your theory. Choose a benchmark favorable to Java and in many areas it does well.

      If your development time is so long the project stakeholders may cancel it.

      I'm not arguing development time isn't important. I'm arguing what the word "fast language" is not about development time. Cars are important, refrigerators are important. The fact that a fridge is important does not make it a car.

      The runtime performance of higher-level language blows. eg, Groovy, Ruby, Python are not in the same league as C++/C/Java/C# etc.

      Of course not. But this is you conflating measures again. Your point was about development speed. If you are saying that Java is a good compromise: you get development speed faster than C++ without taking order of magnitude performance hits and pick up mostly cross platform; I'd agree with you. If you claim that Java code is as fast as C++ then I disagree. If you claim that Java is fast to develop in compared to most languages I'd disagree.

      if you are doing the problem they were designed to solve, and then they suck.

      Now that being said all languages are stronger in some areas than others. Languages to survive have to find niches where they are particularly well suited, which means such niches exist. The things that make Java safer than C/C++ for commercial development are the things that knock it out of the game for systems programming. The things that give Java performance within an order of magnitude of C/C++ are the lack of abstractions that can kick development times up by almost an order of magnitude over high level languages.

      Just to pick a simple example where Java is a problem... C++ is far better at dealing casually with data structures at the bit level where the packing / unpacking needs to happen fast. I wouldn't want to try and write a router in Java.

      With the exception of pretty good cross platform, Java is a compromise. There is a lot of advantage in the standard language being pretty good at a lot of things and not fantastic at any of them. But let's not pretend this tradeoffs aren't happening.

    39. Re:LOL Java by WankersRevenge · · Score: 1

      Great argument guys ... It's a pleasure to read two very intelligent people discuss the pros and cons of languages without devolving into feces tossing. It's kind of rarity these days.

      Hats off to both of you!

    40. Re:LOL Java by julesh · · Score: 1

      The per-object overhead for Java's Hotspot VM (at least the 32-bit version) is 8 bytes. The per-object overhead for C++ objects compiled with most common C++ compilers for a 32-bit architecture and using virtual methods with public inheritance is also 8 bytes (1 vtable pointer, 1 vftable pointer).

    41. Re:LOL Java by julesh · · Score: 1

      If this were really true why are all the high-performance multimedia, mathematics, etc. libraries all still written in C, C++ or Fortran? That's because Java is still magnitudes slower.

      Java is slower for these applications because of a few choices made early in the language design that cannot now be undone. One of them is that portability of code is more important than performance, and that therefore mathematical operations must have exactly specified results -- with the result that Java cannot use processor integrated implementations of transcendental functions, among other issues, meaning any code using exponential functions, trig functions, or logarithms runs about 10-100 times slower than native implementations. But you will get the same result on any platform...

      But for general purpose logical data manipulation, like 90%+ of real world code, Java is just as good as any other language.

    42. Re:LOL Java by benhattman · · Score: 1

      I would say it differently. For all programs, Java has a memory overhead of tens of MB that a comparable C++ program would not have. It's got to run that JVM, and there's no way around that.

      The difference is that a C++ program that's 2MB in memory might use 50MB in Java, but a 300MB C++ program might be a 350MB Java program. Java will always use more memory. It's just that overhead is fixed and becomes less meaningful on larger programs.

    43. Re:LOL Java by K.+S.+Kyosuke · · Score: 1

      You're still talking about implementation details. The point is that the overwhelming majority of run time of Java applications is spent in native code (two levels of optimization, C1 and C2, in the dominant implementation), a minority (10%?) in interpreted code, and less than 1% in memory management routines. The major deficiencies of extant runtime environments for Java are: 1) native code being thrown away when the process is terminated, increasing the startup time, which mostly hurts short-running processes, 2) latencies in memory management, which is fixed by the use of efficient GC strategies like Azul's C4.

      The actual reason why multimedia applications in C++ are faster is the hand-written assembly routines or C/C++ routines written using CPU intrinsics being used all over the low-level libraries (codecs, image processing and signal processing code etc.). No compiler is going to help you there, although an extension of Java for writing intrinsics in Java code isn't inconceivable.

      --
      Ezekiel 23:20
    44. Re:LOL Java by julesh · · Score: 1

      But that's not a java library - it's a java veneer on top of a native library.

      Unless you're using an extended version of Java that supports the constructs you'd need to communicate directly with the hardware, i.e. pointers to arbitrarily-allocated memory blocks, and I/O instructions, so are you. Java isn't designed as a hardware interface, so you have to use a native hardware interface for such tasks. Is this really a surprise?

    45. Re:LOL Java by angel'o'sphere · · Score: 1

      That is, what I said: for non trivial programs. And the difference is not 50MB it is far less.
      The smallest Java process I had so far was a tomcat running in 16MB memory. Ran just fine. However that was Java 1.4 and an early tomcat.

      --
      Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
    46. Re:LOL Java by SplashMyBandit · · Score: 1

      I notice you didn't mention realtime Java. I'll ask again - if the Java VM doesn't have jitter - why do the realtime specification and VM's exist? (since realtime is all about predictability).

      Yes, realtime is all about predictability - not throughput. The VM has jitter, just like the operating system. The JVM spec is so you don't miss deadlines, no matter what you scheduled period is.

      Did you perchance use JVisualVM to look at what your program was doing? what was it doing when spending time? sometimes the hotspot will become obvious (eg. a library call that you can use a faster alternative to).

      When tracing the VM using sysprof I can see the VM is trapping a signal to do it's housekeeping every X iterations which halts all running threads. This is on both OpenJDK1.8 and Suns JDK 1.8.

      What was the delay? It should have been sub-millisecond. It is definitely not the source of the 40 ms delay that you see.

      I'm not sure whether you are aware of this, but to get low jitter you must yield. Otherwise you get a thread hogging the VM and it doesn't get a chance to do its housekeeping. You can get better performance by putting a try { Thread.sleep(1) } catch(InterruptedException ex) { // Ignore the interruption } in you main loop. That yields and lets the VM, other apps, operating system do their housekeeping periodically. If you don't do this it appears the VM will give you more CPU but then pulls the rug out from under you when it can no longer wait to process all the things it has accumulated. By introducing a little jitter you stave off large pauses. This worked for me, at least, and I couldn't believe how simple it was to do.

    47. Re:LOL Java by SplashMyBandit · · Score: 1

      But that's not a java library - it's a java veneer on top of a native library.

      And C++ is a veneer on top of some hand-crafted assembly in its library. And all are a veneer over whatever was used to build the operating system. The argument is not particularly relevant. The reason it is a veneer over a native library is that the native libraries already exist and are being re-used - this is common pattern for all application level languages.

    48. Re:LOL Java by SplashMyBandit · · Score: 1

      The Oracle HPC paper put the overhead at 1-1.5 (i.e. Java at 40-50% of the gcc Fortran version). They used Fortran as a benchmark for Java. There were no areas of outperformance and that was with a rather mediocre Fortran compiler. Your own paper doesn't support your theory. Choose a benchmark favorable to Java and in many areas it does well.

      I believe the debate was whether Java was faster than C++. In some areas Java is faster than C++. Nothing is faster than FORTRAN (which is the reason it is still used for time critical applications). This is due to FORTRAN's lack of things like pointer-aliasing that prevent some optimizations in C++. The paper supports my point :) ... and the JVM has only gotten faster in the last five years.

      I'm not arguing development time isn't important. I'm arguing what the word "fast language" is not about development time. Cars are important, refrigerators are important. The fact that a fridge is important does not make it a car.

      Sorry man, I don't grok the intent of the last sentence. Could you please clarify?

      you get development speed faster than C++ without taking order of magnitude performance hits and pick up mostly cross platform; I'd agree with you.

      That was my point. So, happily, we agree. For enterprise work the speed to develop is usually more important than the runtime performance (although that can't suck too much).

      The things that make Java safer than C/C++ for commercial development are the things that knock it out of the game for systems programming.

      Not really. The reason Java is not used for systems programming is that there are good enough languages already in systems programming and an enormous legacy codebase that you would need to integrate with. In theory you could write an operating system in Java (with a sprinkling of C/assembler for register access; just as the Linux kernel has a sprinkling of ASM, IIRC). The reason Java is not used is not because of performance, it is because replacing the millions of lines of C just to change development language is not sufficient.

      Just to pick a simple example where Java is a problem... C++ is far better at dealing casually with data structures at the bit level where the packing / unpacking needs to happen fast. I wouldn't want to try and write a router in Java.

      I've done lots of device control in Java where I had to do bit-level packing and unpacking (eg. controlling traffic speed radars, shift-register based LED signs, NTCIP signs, control the timing registers and readout of astronomically priced astronomical CCD cameras, control GPS clocks, etc). Java was perfectly fine and perfectly performant at this. You can't write any old Java and have it perform well. You do have to use the profiler to check you are not slowing anything down (fortunately the awesome JVisualVM comes free with the JDK, or can be downloaded separately from http://visualvm.java.net/).

      With the exception of pretty good cross platform, Java is a compromise. There is a lot of advantage in the standard language being pretty good at a lot of things and not fantastic at any of them. But let's not pretend this tradeoffs aren't happening.

      All engineering is about compromise. I'm not saying Java is the perfect language in any domain. I'm saying that it is a good-enough language for any domain that makes it sensible as a first 'go to' choice. IMHO you should won't go wrong if in your solution architecture you select Java as your choice of development language and only then consider other languages if Java is inadequate. The benefits of re-use of your existing Java code, and re-use of the huge number of libraries (for just about any problem domain) outweigh (IMHO) many of the alternatives. In my work I have never encountered a performance problem with Java

    49. Re:LOL Java by SplashMyBandit · · Score: 1

      Many thanks :)

    50. Re:LOL Java by jbolden · · Score: 1

      I believe the debate was whether Java was faster than C++. In some areas Java is faster than C++.

      The original claim was more broad. If you want to limit to C++ then the issue comes down to speed of libraries. C++ libraries can emulate the efficiencies of Java libraries but the reverse isn't always true.

      Sorry man, I don't grok the intent of the last sentence. Could you please clarify?

      The intent was that the term "faster language" or "better performance" applies only to runtime performance. That doesn't mean that only runtime performance is important, but the meaning of language is specific.

      For enterprise work the speed to develop is usually more important than the runtime performance (although that can't suck too much).

      I agree. For enterprise work most of the time the system is I/O constrained and runtime performance may not matter much at all. Further hardware costs are low relative to development and maintenance costs. Java is no question a better choice than C++ all other things being equal. Though I'd go much higher level than either one for enterprise applications.

      I'm saying that it is a good-enough language for any domain that makes it sensible as a first 'go to' choice.

      I would agree with that if you replace "any domain" with most domains. I think the lack of abstraction and isolation of state in Java is a serious problem for things like big data work or massive parallelism. It is far too difficult in Java in practice to see which operations are by nature associative. I think the lack of void pointers is a serious problem for low level hardware code, as I mentioned in the last post. I think the complexity of writing a Java compiler makes it a terrible choice for constructing DSLs.

      etc...

    51. Re:LOL Java by SplashMyBandit · · Score: 1

      I think the complexity of writing a Java compiler makes it a terrible choice for constructing DSLs.

      Well, you have a choice of Groovy or one of the other languages if you must invent a DSL for yourself. The performance hit of those generally is noticeable.

    52. Re:LOL Java by jbolden · · Score: 1

      Groovy isn't bad like most dynamic languages. Generally though for a DSL you want custom primitives on top of some sort of complex primitives hiding them. Ease of constructing the compiler, and the apply/eval loop, i.e. a Scheme. is more important than almost anything else.

    53. Re:LOL Java by viperidaenz · · Score: 1

      You're still talking about what happens in benchmarks, not real applications.
      Most code is *not* compiled by the JIT compiler.
      Some code may be compiled several times in different ways.

      Java is an application language. You build applications with it.
      C is a system language. It was designed to build operating systems.
      Use the right tool for the job. Gold makes a poor quality, easily broken hammer.

      No C++ compiler will produce code that takes advantage of technology that hasn't been built yet. A runtime compiler can. It also won't provide guarantees that the code I design and develop and test on my PC will run on a mainframe.

    54. Re:LOL Java by Anonymous Coward · · Score: 0

      That may be true, but you shouldn't write "equivalent" programs. They're very different languages and each has their own way of achieving performance.

    55. Re:LOL Java by wunderbus · · Score: 1
      "In terms of development time, Java gets crushed by much higher level languages."

      This is something I've seen over and over. Why do you think it's true?

      I don't expect some sort of mathematical proof, but I haven't even seen an *argument*. One day I read some comments on the internet and suddenly it had been declared: developing in Java is slow. What happened? I missed the part where we all figured this out.

      I've written web applications in Java and Ruby on Rails, among several other platforms. Ruby on Rails was *beautiful*! I had to type far fewer characters to implement simple web application behaviors in RoR than I had in Java. Its elegance was the cause of several changes in my employer's own internal Java-based web framework.

      But although I had to type fewer characters using RoR than in the Java framework I was used to, typing characters had never been the pain point. I know how to define simple value objects that represent rows of a database table. No problem. I know how to do SQL migrations. No problem. I know how to validate form submissions. No problem.

      And so on it went for every supposed advantage that Rails gave me. I had already solved that problem; I haven't spent significant development time on that problem for years. The real *meat* of the application (what separates it from CRUD apps) and *maintenance* were the pain points for every application. Rails didn't help me there at all. I've worked with other supposed "higher level" languages, and they didn't help with the meat or maintenance either. They all seem weirdly focused on saving characters.

      In the process of saving characters, many "higher level" languages sacrifice things like static typing that an IDE would have been otherwise been able to capitalize on. With a Java IDE I usually type a single character before it figures out what I meant (based on the context, which it could only infer because of static typing) and then I click my mouse or press some key to accept the auto-completion. Or maybe I wanted to define getters and setters for some fields, or do some other mundane task that's supposedly verbose in Java... it's most likely that the IDE has a keyboard shortcut for that.

      I'm pretty tired of hearing the "faster development time" argument. Put up some proof, or evidence, or anything.

    56. Re:LOL Java by Mr+Thinly+Sliced · · Score: 1

      > Did you perchance use JVisualVM to look at what your program was doing? what was it doing when spending time? sometimes the hotspot will become obvious

      Yeah with various tools (jprofiler, visualVM, sysprof, strace, latencytop etc).

      The problem with running Java profiling tools is that you have to leave UsePerfData on - and it's a cause of jitter in the VM itself.

      The code is as optimised as you can get - I'm bypassing the "helper" classes included with JavaJack and using the raw mapping to Jack C API.

      When running the program is at about 2% of CPU - so it's not a CPU starvation problem. I've run it under both regular and realtime linux - the linux thread priority is set by Jack itself as high - and I've tried setting the other threads in the VM to lower priority by native C calls. No dice.

      > What was the delay? It should have been sub-millisecond. It is definitely not the source of the 40 ms delay that you see.

      The problem I think is that it's competing with the compilation / profiling and housekeeping threads for CPU, and the VM can halt your thread whenever it feels like the profiling data or other things need updating.

      I should mention that I'm outputting two periods of 1024 samples - so Java is in effect failing to meet a 20 millisecond deadline every now and then.

      > I'm not sure whether you are aware of this, but to get low jitter you must yield.

      I'm not very happy with this being a solution - if anything it shows the model is broken itself.
      I can't even try this - the callback thread is created inside the Jack shared library - and "enters" the VM when it needs to do a callback. I can't block or do anything other than simply try and return the data needed by Jack in this thread.

      It's been an entertaining discussion - but I think we're at an impasse - I think I've demonstrated some scenarios in which Java either lacks expressive tools or fails to offer the same guarantees that native C++ can offer.

      Please don't forget - I am a Java developer - I'm not poo-pooing the language with bias - but realising the limitations of the tools we use is important in being able to identify the situations in which the tools are appropriate.

      Cheers

    57. Re:LOL Java by jbolden · · Score: 1

      This is something I've seen over and over. Why do you think it's true?

      Originally this came from early studies from IBM in the late 1950 and early 1960s. What they measured over and over is that developer productivity in teams, on average, was in lines of code almost regardless of language. The less lines of code needed to express a problem the faster developers were able to solve problems. That's why they went from advocating Fortran & COBOL for limited classes of programmers to instead advocating them for most programs regardless of class of programmer.

      There still are performance shootouts happen regularly, and people still see the same effects. The functional languages crush Java / C / C++. The dynamic languages crush Java / C / C++ in writing programs. There have been studies of developer productivity you see this all the time. I can start citing articles but people believe it because there is over 50 years of research repeated again and again showing it. What you are calling "less characters" really really matters.

      You wanted some evidence so just to pick an example, and you google and find dozens: http://sequoia.cs.byu.edu/lab/files/pubs/Delorey2007a.pdf

      They tested 19,000 code based from Sourceforge in 2000-7. And found the typical result statistically that programmers were more or less producing roughly the same amount of lines of code per programmer per month.

      And so on it went for every supposed advantage that Rails gave me.

      Rails isn't designed to make solving hard problems easier. It is designed to make solving easy problems easier. Where Rails makes solving hard problems is because of Ruby not because of anything particular to Rails.

      I've worked with other supposed "higher level" languages, and they didn't help with the meat or maintenance either. They all seem weirdly focused on saving characters.

      I think you need to separate those two issues out.

      Static typed variable languages are far easier better in terms of maintenance. The research here is clear cut, that there is a substantial long term maintenance penalty for dynamic. If you want to do a comparison for static, high level look at something like Haskell, OCaml / F#, Scala, Clojure...

      Now in terms of meat... here I would say Ruby is likely to be helpful providing the "meat" falls into Ruby's sweet spots. That is "meat" where the abstractions in the program work well with Ruby's abstractions. If they don't then of course Ruby isn't going to help. Worse, Rails pulls against this because it brings with it, its own set of abstractions that often limit Ruby. Rails is a bad fit for most complex projects.

      In terms of your personal experience, programmer experience matters. If you are much more experienced in Java your lines productivity will go way down at first in a new language. Moreover your productivity might take years to reach the same level in dynamic languages because your Java skills are well developed. Saying that programmer productivity is improved by a language is not the same your personal productivity will be improved. Productive programmers are something like 10x as productive as low productive programmers, on average. So I don't find it hard to believe you are able to generate 10 lines of Java in the time it takes you to generate one line of Ruby. And that's an average given individually it might be closer to 30 to 1, in which case something like Ruby's 4 to 1 lines advantage would be swamped easily.

      For you to see a difference you might have to try it in an area you are unfamiliar with. A type of program using abstractions you've never had to use.

    58. Re:LOL Java by SplashMyBandit · · Score: 1

      It's been an entertaining discussion - but I think we're at an impasse - I think I've demonstrated some scenarios in which Java either lacks expressive tools or fails to offer the same guarantees that native C++ can offer.

      ... and I agree with you. For low latency applications there is clearly an issue. While you are correct in saying Java is not good for everything, and have provided an example, it usually happens that most Slashdotters take the specialized requirements you describe and then decide Java is junk and C++ should be the first choice for modern development. In that way many developers do themselves as disservice.

      Next time I'll try and state more clearly that Java isn't good for everything, just most things IMHO (I believed I stated that up front, but will have to be more explicit).

      Thanks for your clear explanations and pleasant style. Well met Mr Thinly Sliced!

    59. Re:LOL Java by wunderbus · · Score: 1

      I'm blown away by how reasonable and thorough that response was. Thank you.

    60. Re:LOL Java by jbolden · · Score: 1

      Glad it was helpful.

    61. Re:LOL Java by Anonymous Coward · · Score: 0

      fyi; java's portability of floating point operations was undone some 14 years ago. A keyword (strictfp) was added for those cases when exact reproducability is required.

  7. New Features of Java 8 Summarized by PhamNguyen · · Score: 5, Funny

    Highlights of Java 8 include

    Green solutions. Advanced power management features, and automatic tracking of each thread's carbon footprint. An console allows users to see the carbon footprint of each thread in real time.

    Social networking. Users can share jar files on social networks, and like their friends jar files.

    Cloud computing. Java 8 will be the first VM built for the cloud.

    1. Re:New Features of Java 8 Summarized by Anonymous Coward · · Score: 0

      Please tell me this is a joke?

    2. Re:New Features of Java 8 Summarized by Anonymous Coward · · Score: 0

      Can we stuff 'friends' in a jar?

    3. Re:New Features of Java 8 Summarized by Anonymous Coward · · Score: 0

      Please tell me this is a joke?

      Darn it! Now I have to go read the article! I seriously hope this is not true. LMAO!

    4. Re:New Features of Java 8 Summarized by CptNerd · · Score: 1

      Most of my friends spend their time pickled, so why not?

      --
      By the taping of my glasses, something geeky this way passes
    5. Re:New Features of Java 8 Summarized by KZigurs · · Score: 4, Funny

      You forgot Big Data. Java 8 is built to support Big Data!

    6. Re:New Features of Java 8 Summarized by Anonymous Coward · · Score: 0

      Now if they could only make Netbeans as easy as Visual Studio to teach, this info sys professor would love them forever!!!!!

    7. Re:New Features of Java 8 Summarized by Anonymous Coward · · Score: 0

      You can share your jar, and lick your friends jars?
      Disgusting...

    8. Re:New Features of Java 8 Summarized by mark-t · · Score: 1

      I find that nobody takes Metbeans seriously... Android development, for instance, pretty much has to always be done in Eclipse if you want any hope of support, and even if you don't, I don't think that the NBAndroid plugin, which is the Android plugin for Netbeans, has any support at all for native code debugging on the device.

  8. Re:That's pretty amazing... by Intrepid+imaginaut · · Score: 1

    Summaries: I like them. Even such as we get around here.

  9. Re:That's pretty amazing... by Anonymous Coward · · Score: 0

    Then i'm amazed that you still read and post on /.

  10. Re:Java, is that still around? by Anonymous Coward · · Score: 2, Informative

    Get your head our of your ass. Java is one of the most widely used programming languages. Just because you don't notice it on your desktop doesn't mean it isn't used.

  11. The plugin is the only place ... by Anonymous Coward · · Score: 0

    you run untrusted code, so it's the only place being able to skirt the securitymanager matters.
    Actually, there may be security isolation in Java EE servers, but there isn't much payoff
    for sneaking around it.

  12. Improvements to interfaces? by Anonymous Coward · · Score: 0

    I thought it was already the best write once run anywhere programming language in the world. At least that's what all the cool kids tell me. What could be left to improve?

    1. Re:Improvements to interfaces? by Anonymous Coward · · Score: 0

      ICWUTUDIDTHAR!

      Kind of like how Flash is the best thing to ever hit the RIA world.

      lol

  13. How does this get mod'd up? by clay_shooter · · Score: 1
    Are there that many people that don't know the difference between the browser plugin and enterprise / portable services / apps?

    Its shrinking the say way as say the browser Silverlight plugin, the Adobe Flash plugin or the abomination called "Active X"

  14. Re:Java, is that still around? by Anonymous Coward · · Score: 0

    Judges: 2.3

    Jane: Ouch Ted, markhahn's got to be feeling that one!
    Ted: He sure is Jane. The judges have been placing much more emphasis on subtle trolling this year.
    Jane: The feigned ignorance of Java's popularity is certainly a good bait for trolling the Java fanboys, but it also makes him look out of touch with the industry.
    Ted: I agree. This troll may have scored higher on another Slashdot article, but trying it on an article about Java is just too obvious.
    Jane: He may still get his bonus points if anybody responds.
    Ted: I'm not sure Jane. I can't see even the dumbest Java fanboy sinking to this one.
    Jane: Well, Java is popular, and 50% of them have less than average intelligence for a Java user.
    Ted: Good luck to markhahn in the response-bonus round then!

  15. Re:Java, is that still around? by disambiguated · · Score: 1

    I don't (and wouldn't) have a JVM installed so that probably explains why I don't notice it on my desktop. It used to be useful on the server side, but every month that goes by it falls further behind. Java 8 is not going to be significant enough to change that. At this point, the only reason to use Java is because that's what you've always used.

  16. Java 8 ? Already ? Seriously ? by Kittown · · Score: 1

    In the next few years we will probably run a little experiment of moving from sun java 6 to oracle java 7. Perhaps the attempt will fail at first and we will postpone the upgrade for another year or so, and then try again. But Java 8 ? Let me call you back in 5 years... or maybe 7.

  17. Re:Java, is that still around? by Anonymous Coward · · Score: 0

    Just another asshole talking shit.

  18. Changes by phantomfive · · Score: 3, Interesting

    There is a real, major benefit of using Java over other languages, such as C or Haskell or Smalltalk, which is this: it lets you work with other mediocre programmers, and has limitations that prevents them from doing anything too crazy. That is, even if they write horrible code, it won't be so bad that you can't work with it (I'm sorry fellow Java programmers if that offends you, but think of where Java is used most).

    That said, I'm somewhat concerned about some of these changes. Lambda functions are great, but one of the benefits of functional programming is the lack of side effects. Under the Java 8 design, lambda functions allow you to modify member variables, which means that benefit is completely gone. This means lousy programmers will be able to write incredibly complex code, with strange side effects, that is hard to use.

    The new streams functionality is fine, but did they really have to call it streams? When there are already Streams in Java?

    String.join() is great. Finally.

    The new Date library looks fine. It better be good enough, because do you really want yet another Date system added into Java?

    --
    "First they came for the slanderers and i said nothing."
    1. Re:Changes by the+eric+conspiracy · · Score: 1

      Most decent Java programmers have been using Joda for years. This is just bringing in something that is standard practice.

    2. Re:Changes by KZigurs · · Score: 1

      Uhm. I think I'm a decent Java programmer and I haven't bothered to use Joda ever. Not every problem involves handling dates.

    3. Re:Changes by Anonymous Coward · · Score: 2, Insightful

      Lambda functions are great, but one of the benefits of functional programming is the lack of side effects

      What people want is to pass a callback to something and then play with members from within the callback, and do so --> WITHOUT <--- having to create a single use method with some pathetic name in some other place inside the class. Your supposed 'benefit' is exactly the opposite of the intent. ECMAScript 6 specifies 'fat arrow' functions for the same reason; lambda's that easily expose the outer context to the body of the lambda so we can all stop doing var that = this.

      Lambdas are perfectly legitimate beyond pure functional languages. They allow more concise, lexically meaningful code and reduce namespace pollution.

    4. Re:Changes by devent · · Score: 2

      This is what I like in Java in comparison to other languages: the language moves slow, the JDK moves slow, but you have for everything open source libraries and tools. Unlike C or C++ I can mix those libraries without any hindrance, because the basic types are fixed in the Java language: String, primitives, etc.

      Call me old-fashion, but I like that the language is evolving slow. In Java I can use Groovy, Scala, Python, Ruby, JavaScript, etc. if I want "modern" features, like closures, lambdas, etc. Plus I have like 391,000 open source libraries* to enhance Java. I have enterprise ready tools and IDEs, all free.

      Will I benefit from Java 8 features? Maybe. Is it important: No, not at all. Oracle could have Java 6 for another 10 years. The core language is fine.

      My wish list would be: more polish for Swing, new widgets in Swing, faster JVM, smaller JVM, better modularization support (like OSGi). I wish Oracle would offer an official GTK+ theme for Swing, and Oxygen theme for Swing on KDE.

      [*] http://mvnrepository.com/

      --
      http://www.mueller-public.de - My site http://www.anr-institute.com/ - Advanced Natural Research Institute
    5. Re:Changes by phantomfive · · Score: 1

      My wish list would be: more polish for Swing, new widgets in Swing, faster JVM, smaller JVM,

      Yeah, now those are some real changes that would be more practical.

      --
      "First they came for the slanderers and i said nothing."
    6. Re:Changes by Hentes · · Score: 1

      I agree. An often overlooked thing in language design is that less functionality leads to more standardized code that's easier to read. When I want to use complicated languages there's already a wide selection available.

    7. Re:Changes by rok3 · · Score: 1

      Wish I had mod points for this.

      I dislike using Java for work ( mid-sized web applications) but when I've been forced to deal with Java code I have enjoyed being able to quickly understand what a developer was trying to do regardless of their level of expertise.

      It's really good to have simple, slow-evoling, core elements to a language when it comes to learning, teaching, understanding, etc..

    8. Re:Changes by stenvar · · Score: 1

      Call me old-fashion, but I like that the language is evolving slow

      Java has been evolving quite rapidly, with major new language features in every major release.

    9. Re:Changes by stenvar · · Score: 1

      Yeah, now those are some real changes that would be more practical.

      People have wanted that for more than a decade; don't hold your breath.

    10. Re:Changes by Anonymous Coward · · Score: 0

      Lambda functions allow you to modify vars? I thought exactly the opposite was true - that everything passed into a lambda has to be effectively final?

    11. Re:Changes by phantomfive · · Score: 1

      I know, Java added a type of Lamba that allows you to modify vars.

      --
      "First they came for the slanderers and i said nothing."
    12. Re:Changes by wunderbus · · Score: 1

      Yes, the parent was exaggerating.

  19. Functional Interfaces by Anonymous Coward · · Score: 0

    If things like Kawa Scheme and Scala already run on Java, what advantages is there for functional interfaces? Will these projects be able to benefit from these advances? In what way?

  20. Re:That's pretty amazing... by Anonymous Coward · · Score: 0

    No, what's amazing is you think this is the hottest story on Slashdot.

  21. Re:So... by Anonymous Coward · · Score: 0

    Whoops, some Java fanboi negged me, bwahahaha

  22. You can Pry Java 6 off my cold dead fingers by Billly+Gates · · Score: 0

    Finally a version that is not loaded with security issues relatively and can run all the software out there. Java 7 was truly terrible and has too many updates. There is no time for that at work.

    Java 7 had 50 patches in just one month!

    Java 6 does not have nearly the amount of vulnurabilities and is right up there with XP. It works and is mature and I do not see a reason to change.

    I wonder what it will break next?

    1. Re:You can Pry Java 6 off my cold dead fingers by Anonymous Coward · · Score: 0

      To quote the cockroach alien in Men In Black: "Your offer is acceptable."

      (Hint: They've already stopped supporting Java 6, and you can bet there are unpatched 0-day exploits left in it, so your options are: (a) buy a $multimillion contract, or (b) uninstall Java 6 immediately.)

  23. Change versioning please by Anonymous Coward · · Score: 0

    If I'm running Java 8, I'd like the version number to actually be 8 instead of 1.8 please. It really confuses people to this day.

  24. Re:Java, is that still around? by Anonymous Coward · · Score: 0

    Falls further behind what server side?

  25. Why continue with Java by Lawrence_Bird · · Score: 1

    as all it seems to be doing now is playing catchup to something like Scala which has at least thought out the functional stuff maybe a bit more

  26. Destructor once and only once by tepples · · Score: 1

    The C++ compiler doesn't manage resources entirely for you. You need to do that yourself in your destructor.

    The destructor needs to be written once and only once, and for an object not created with new, the destructor automatically gets called once the object falls out of scope. In Java, you have to remember to finally { something.close() } or to try-with-resource every single time. Python is somewhere in the middle on this: because CPython's garbage collection uses reference counting, destructors get called automatically for anything that isn't held by a cyclic data structure, but Python also has with that acts somewhat like Java 7's try-with-resource.

    1. Re:Destructor once and only once by viperidaenz · · Score: 1

      and every object you create with new must be explicitly deleted or you'll not only leak all the memory, you'll also never release the resources.

    2. Re:Destructor once and only once by tepples · · Score: 1

      and every object you create with new must be explicitly deleted

      For one thing, there are ways to create an object other than new. Temporary objects created and used within the scope of one function are not created with new and are therefore automatically destroyed once they fall out of scope. For another, Boost and C++11 have reference-counted pointers, allowing destruction to happen automatically once the last reference falls out of scope.

      or you'll not only leak all the memory, you'll also never release the resources.

      Why is it preferable to treat memory as "special" and different from any other resource? Memory can be freed at end of scope; other resources can be freed at end of scope. Memory can be reference counted; other resources can be reference counted.

    3. Re:Destructor once and only once by viperidaenz · · Score: 1

      Because memory is special. It's isolated from other processes.

  27. Re:So... by Dahamma · · Score: 1

    Yeah, it's basically true... most of the major feature additions in the last couple releases really do seem to be to catch up to C# (and other, more dynamic scripting languages). C# as a language is great - it's major problem is being so tightly associated with .NET/Sliverlight/etc.

    At least Java has one thing going for it - a highly responsive owner/maintainer that listens carefully to all complaints and patches security vulnerabilities almost instantly!

  28. Could Project Lambda be axed? by jphamlore · · Score: 2

    Project Lambda from what I have gleaned has as its goal not necessarily feature parity with other programming languages, but instead speeding up certain multicore computations. It is therefore an experiment, and as its coding is not done yet, no one can be sure whether the experiment will be a success. What if the speed-ups simply don't happen once the implementation is finished? Given that Project Lambda may already be delaying some of Java 8, even though it was supposed to be the focus of Java 8, why couldn't Project Lambda be dropped if the experiment fails? There already seem to be so many compromises with the syntax compared to other languages that usage of Project Lambda may not be intended for general programming. Face it, the time to put in the equivalent of Project Lambda was near the dawn of Java, not trying to retrofit it at such a late stage. Perhaps it would be better to shelve it indefinitely as the community never had its heart in the concept.

  29. Re:So... by SplashMyBandit · · Score: 5, Insightful

    Java has one feature that C# doesn't. This one feature makes up for all the nice-to-have little C# features. That one feature is "portability", not only of the language, but even more importantly, *all* the standard libraries. Mono goes some way to alleviating this but there are some significant libraries that Mono haven't developed and also state (according to their own pages) that they will never develop. I don't know if you have noticed it yet, but the Microsoft is just one platform in the World - and the number of platforms is burgeoning. Apart from a few platforms Java is locked out of deliberately (iOS, Xbox) Java runs pretty much whereever you need to be - with very very little porting necessary (eg. through judicious use of libraries, like JoGL,JOAL, JInput a jet combat simulator I'm developing runs not only with unmodified source on Windows+Mac+Linux+[and some tweaks for Android]; but actually runs without needing a recompile ! [I know it is not true for everyone, but for me, "Write Once, Run Anywhere" really works - even for a very complex multithreaded OpenGL/GLSL real-time application]).

    I hope that sheds some light on why some of the Java devs still use it. The nice features of C# don't necessarily make up for Java's awesome portability of *all* its libraries.

  30. Re:Java, is that still around? by Anonymous Coward · · Score: 1

    I don't (and wouldn't) have a JVM installed so that probably explains why I don't notice it on my desktop. It used to be useful on the server side, but every month that goes by it falls further behind. Java 8 is not going to be significant enough to change that. At this point, the only reason to use Java is because that's what you've always used.

    What do you think has replaced Java on the server side? I would love to start using it!

  31. Java needs explicit operator overloading by mark-t · · Score: 2

    Ever since autoboxing was added, it's already implicitly overloading operators for all of the object wrappers around atomic types anyways, and it's always implicitly overloaded the + operator for the String object, so the objection that it adds complexity should not be an issue. The only real remaining objection about unreadability that always seems to arise when the subject of operator overloading on user-defined classes is raised is actually entirely isomorphic to complaints about function or variable naming practices where the identifer's name doesn't effectively convey any sense of what the identifier's real purpose is... Java doesn't stop a programmer from using global class name like qxj, for instance, so it makes no sense to prohibit operator overloading merely on the suggestion that the resulting program is harder to read or maintain (and even then, such an identifier may even have a legitimate purpose in certain contexts.... but then, so can operator overloading, which is my point)

  32. wrong - still supported and patched by rubycodez · · Score: 2

    Java 1.6 is the engine for java ee servers such as IBM websphere and tc server. there are still patches for 1.6 coming out, we just installed some at work recently for both the IBM and "Sun" (oracle) jdk

    in fact, java 7 is optional add-on for websphree 8.5

    1. Re:wrong - still supported and patched by rubycodez · · Score: 1

      should have added, that's only if you pay Oracle money. then you can get patches till 2016 from Oracle. For public patches for 6, you're SOL.

  33. imprecise Dates would have been nice by DulcetTone · · Score: 1

    I'd like to see a Date that can be missing some fields, such as "early january", or "2013" and have the objects be Comparable and yet not forget that their actual value is not exact. For instance, "early" in a month might mean the 5th in terms of comparison, but its toString() would say "early January", and a year without further specification might compare as June 30th.

    These sorts of things are helpful when you're recording researched data and don't want the persnickety exactness of the representation to hide the fact that you don't know all the fields.

    --
    tone
    1. Re:imprecise Dates would have been nice by Prof.Phreak · · Score: 1

      or similar stuff from Date::Manip in perl... so much more convinient to setup loops from "yesterday" to "last week"... as opposed to worring about actual dates, etc.

      --

      "If anything can go wrong, it will." - Murphy

    2. Re:imprecise Dates would have been nice by hey · · Score: 1

      I don't think that's mainstream enough. You can make a class to do that using java Date.

  34. Re:So... by Dahamma · · Score: 1

    Java has one feature that C# doesn't. This one feature makes up for all the nice-to-have little C# features. That one feature is "portability", not only of the language, but even more importantly, *all* the standard libraries.

    Uh... yeah, I completely agree, and said so in my previous post in a lot fewer words ;) C# language = great. Platform = sucks.

    [Though of course my maintainer comment was complete sarcasm... Oracle seems to be very good at buying companies with popular, often open source products and fucking them up.]

  35. Only thing I want to know is by rubycodez · · Score: 2

    does it break backwards compatibliity with 7, like 7 did with 6?

    that's been one of my major gripes about Java, write once, run anywhere until the jvm version changes, then you can be screwed.

    1. Re:Only thing I want to know is by phantomfive · · Score: 1

      How did 7 break backwards compatibility with 6?

      --
      "First they came for the slanderers and i said nothing."
    2. Re:Only thing I want to know is by s1lverl0rd · · Score: 1

      Classes compiled for Java 7 only don't run on Java 6 runtime environments. (The reverse isn't true - classes compiled for Java 6 run on Java 7 without a problem.)

    3. Re:Only thing I want to know is by phantomfive · · Score: 1

      Oh, that's forwards compatibility.

      --
      "First they came for the slanderers and i said nothing."
    4. Re:Only thing I want to know is by rubycodez · · Score: 1

      that is absolutely false, classes for 6 might not run on 7, backwards compatibility *was* broken.

    5. Re:Only thing I want to know is by rubycodez · · Score: 1
    6. Re:Only thing I want to know is by phantomfive · · Score: 1

      thx

      --
      "First they came for the slanderers and i said nothing."
  36. Re:So... by lgw · · Score: 1

    The only platform that matters is the one your customers run. Portability matters so rarely in business it's almost a non-issue. Now, skills-portability is a different matter, but unfortunately while Java the language is learn-once-code-anywhere, actual Java coding is as much about what libraries/frameworks you've learned as anything else.

    --
    Socialism: a lie told by totalitarians and believed by fools.
  37. Re:So... by Anonymous Coward · · Score: 0

    Will Java 8 finally bring unsigned integers? I find protocol parsing and buffer management infinitely easier in C, principally because of pointers and unsigned types.
    Array indexing is a tolerable alternative to pointers. But lack of unsigned types is just fscking painful.

  38. Re:Java, is that still around? by farble1670 · · Score: 1

    It used to be useful on the server side, but every month that goes by it falls further behind.

    every major programming index shows java at the top. oops. i'll let you google for "programming index" and click on the links.

    At this point, the only reason to use Java is because that's what you've always used.

    another reason to stick with it is because you like money and having a job. even if java was declining, you'd have steady employment in that space for the rest of your life.

  39. Re:So... by farble1670 · · Score: 1

    [Though of course my maintainer comment was complete sarcasm... Oracle seems to be very good at buying companies with popular, often open source products and fucking them up.]

    but the language is progressing nicely. java 8 has a lot of cool, requested features.

  40. Re:So... by Anonymous Coward · · Score: 0

    The only platform that matters is the one your customers run. Portability matters so rarely in business it's almost a non-issue.

    Then it's a good thing that all code everywhere is written for "customers" in a "business" environment, isn't it?

  41. Re:So... by SplashMyBandit · · Score: 1

    Thanks for the clarification. Fortunately with Java there are multiple implementations. OpenJDK is pretty much the same as Oracle (same 'DNA'), but is fully GPL and maintained by the community.

  42. Re:So... by lgw · · Score: 1

    Then it's a good thing that all code everywhere is written for "customers" in a "business" environment, isn't it?

    Well, it's a good approach to earning a living writing code. For a hobby, do whatever - sometimes doing it the hard way is the point of a hobby!

    --
    Socialism: a lie told by totalitarians and believed by fools.
  43. Re:So... by Dahamma · · Score: 1

    Definitely, and that's a great thing. Though Oracle still has a lot of control over the language - and suing Google for Android wasn't an encouraging move...

  44. Re:So... by SplashMyBandit · · Score: 1

    and suing Google for Android wasn't an encouraging move...

    Fortunately the suit is over and Oracle pretty much learned their lesson. OpenJDK is safe to use and rely on (no vendor can kill it).

  45. Yummy, yummy!

  46. But where's the bug tracker? by Anonymous Coward · · Score: 0

    Without a public, searchable bug tracker, I've no way to know whether the annoying SAX parsing bugs in JDK6 and JDK7 have been fixed or not. Has somebody reported these bugs? Are they being deliberately ignored or do they simply not know about them?

    Now that it's "Open"JDK, there's no good excuse not to have a decent (and public) bug reporting and tracking tool, is there?

    1. Re:But where's the bug tracker? by rubycodez · · Score: 1

      pointless, since you'll never know whether a bug was fixed, and you'd have no way of getting the fix, except you pay oracle $$$$.

      maybe use another language and platform?

  47. Re:rearranging deck chairs by jonathan.ahlbring · · Score: 1

    FUD:)

  48. Re:So... by Dahamma · · Score: 2

    Not over yet, actually. If Oracle had really learned their lesson they wouldn't have appealed. I doubt they will win, but as I said it's still not an encouraging move.

    But yeah, OpenJDK is not going anywhere, and the support behind it dwarfs even Google's resources...

  49. Re:So... by petermgreen · · Score: 1

    From a quick read it seems they are putting in all the hip new shit while still leaving out basics like structures without implicit pointers, parameter pass by reference/multiple results (no allocating an object on the heap only to throw it in the garbage immediately doesn't count), operator overloading, Unsigned primitive types (other than char) and so-on. Properties (no some stupid convention doesn't count) and so-on that have been in languages like object pascal for years.

    --
    note: i'm known as plugwash most places but i screwd up registering that here somehow in the past and now can't register
  50. java is DOA by Anonymous Coward · · Score: 0

    Java is DOA... no point. the Java Update scheduler nagged me for a month before i finally replaced my known weak build (with the well known vulnerabilities) and you know what the little shit did? it went and put the ask.com toolbar on all my browsers (UNASKED!) so now i know, it's more crapware, bloatware, and basically malware... Java is dead. rest in shit.

    1. Re:java is DOA by mark-t · · Score: 1

      What would be a highly desirable feature in a browser is a way for the user to have to approve any plugins which are installed from outside of the browser. Absolutely *ANY* plugin installed from outside of the browser should, by default, be disabled until the user manually enables it from inside the browser's own plugin manager tool.

  51. Re:So... by benhattman · · Score: 1

    I actually think all the C# language features are starting to be a problem, and one that will only increase over time. First, let me say that I see C# as being too quick to adopt language features. They often seem to throw things in for no other reason than because one other language they saw does it, and they don't always fully think through the ramifications of the language feature.

    Here's an example. Properties. I get why they are popular, after all if you've had it rammed into your skull a hundred times that you should not make member variables public (an overused trope in my mind) you'll love a one line statement that is both getter, setter, and member variable. Great. Except, Properties are neither methods nor member variables. I can't pass a property by reference into another function. I also can't pass a property around as a function pointer either. Sure, you can work around this using lambda expressions, but that doesn't change the fact that a property is actually disfunctional and worse in many ways than either of the two language features it's supposed to replace. Worse yet, as soon as you need to customize it, the resulting code ends up just as wordy as the getter/setter code would have been in the first place.

    My rub with C# is that today all these poorly considered features are manageable. But I see a time maybe 10-15 years out when the language will just be bloated with features that no longer fit together well enough for anyone to want to use it. Which, is of course not an argument to avoid C# today. rather it's an argument that C#'s model of rapid adoption migh not be ideal for other languages out there.

  52. OK then... by GPS+Pilot · · Score: 1

    You've listed some languages that mediocre programmers use; now would you please share your opinion on what languages great and exceptional programmers use?

    --
    That that is is that that that that is not is not.
    1. Re:OK then... by phantomfive · · Score: 1

      Whatever language they want. Exceptional programmers write good code in any language.

      It should be mentioned that mediocre programmers write code in any language too, but in Java the damage caused by their incompetence is limited.

      --
      "First they came for the slanderers and i said nothing."
  53. Java still has a long way to go to catch up to C# by Anonymous Coward · · Score: 0

    Java 8 still doesn't have properties, async/await, LINQ, dynamic, named parameters and so much more that C# has now.

  54. Re:Java, is that still around? by Anonymous Coward · · Score: 0

    Do you see these shiny Android phones all around the world?
    Guess what language they're programmed in...
    Samsung will laugh about your "sunken investment" all the way to the bank.

  55. Re:So... by Dahamma · · Score: 1

    Or as someone else put it: "one of Java's biggest strengths is that it limits how badly mediocre programmers can screw up the code" ;)

  56. Other things are isolated from other processes too by tepples · · Score: 1

    Because memory is special. It's isolated from other processes.

    How does that make memory any more special than file handles or network connections? Other processes can't see those either. The GUI is likewise isolated, as an application generally can't scribble over another application's windows.

    Let's go deeper: In a growing number of operating environments, the file system is isolated from other processes. At least four operating systems that I'm aware of create the equivalent of a separate user account for each application's private files: IOS on Wii, Sugar on OLPC, iOS on Apple devices, and Android. HTML5 likewise separates local storage and IndexedDB access per origin, and it is up to each origin how much cross-document messaging it will allow. When the device's owner chooses to uninstall an application, the user can choose to uninstall its private files as well.