Please create an account to participate in the Slashdot moderation system

 



Forgot your password?
typodupeerror
×
Java Programming

Everything About Java 8 233

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."
This discussion has been archived. No new comments can be posted.

Everything About Java 8

Comments Filter:
  • The important bit (Score:0, Insightful)

    by Anonymous Coward on Wednesday March 27, 2013 @05:22PM (#43296705)

    Will it be more secure?

  • by SplashMyBandit ( 1543257 ) on Wednesday March 27, 2013 @06:33PM (#43297571)

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

  • Re:Changes (Score:2, Insightful)

    by Anonymous Coward on Wednesday March 27, 2013 @07:27PM (#43297979)

    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.

  • by MightyYar ( 622222 ) on Wednesday March 27, 2013 @08:02PM (#43298287)

    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.

  • Re:So... (Score:5, Insightful)

    by SplashMyBandit ( 1543257 ) on Wednesday March 27, 2013 @08:05PM (#43298309)

    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.

  • by SpazmodeusG ( 1334705 ) on Thursday March 28, 2013 @01:32AM (#43299985)

    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.

He has not acquired a fortune; the fortune has acquired him. -- Bion

Working...