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."
Will it be more secure?
I can't wait!
Did you Ctrl+F the linked page for "secu" too? I didn't find anything.
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.
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
Has it stopped being an overly-verbose, memory-hogging, slow pain the ass?
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.
Summaries: I like them. Even such as we get around here.
Then i'm amazed that you still read and post on /.
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.
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.
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?
Its shrinking the say way as say the browser Silverlight plugin, the Adobe Flash plugin or the abomination called "Active X"
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!
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.
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.
Just another asshole talking shit.
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."
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?
No, what's amazing is you think this is the hottest story on Slashdot.
Whoops, some Java fanboi negged me, bwahahaha
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?
http://saveie6.com/
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.
Falls further behind what server side?
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
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.
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!
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.
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.
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!
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)
File under 'M' for 'Manic ranting'
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
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
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.]
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.
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.
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.
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.
[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.
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?
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.
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.
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...
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).
Yummy, yummy!
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?
FUD:)
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...
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
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.
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.
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.
Java 8 still doesn't have properties, async/await, LINQ, dynamic, named parameters and so much more that C# has now.
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.
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" ;)
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.