There is a good amount of stuff to get excited about in this release. - Try-with-resources-Catch-Block [0] - Fork/Join libraries from Doug Lea (author of Executor framework) [1] - Inferred/Simpler generics in declarations (should have been in Java 5) - NIO2, brand new/robust filesystem APIs [2] - NIO2, treat ZIP/JAR files like directories of files for R/W [3] - SDP support [4] - String-in-switch (NOTE: check on perfo…
Java 7 is now available
141–150 of 218 posts
Re: Java 7 is now available
#142Did they always have this clause in the Java license, or is it new to Oracle's release? "These Supplemental License Terms add to or modify the terms of the Binary Code License Agreement.... A. COMMERCIAL FEATURES. You may not use the Commercial Features for running Programs, Java applets or applications in your internal business operations or for any commercial or production purpose, or for any purpose other than as…
Re: Java 7 is now available
#143Earlier quoted context omitted.
Syntactic Sugar: Collection literals List people = {"Frank", "Mary", "Satan"}; I find it breathtaking this isn't core yet. I was writing test fixture support code for 1.4 to easily and DRYly generate lists of up to 10 items, which required 10 copy-paste functions each with a different number of arguments. 1.5 came along and made it possible to easily do it with one function thanks to varargs, but it's 6 years later a…
If you use the Google library [1], this becomes a bit more convenient that the built-in Java way: List people = ImmutableList.of("Frank", "Mary", "Bob"); There's also ImmutableSet and many other goodies, to say the least. For instantiation of these generic types, you can do: List people = Lists.newArrayList(); Map scores = Maps.newHashMap(); and so on. [1] http://code.google.com/p/guava-libraries/
List people = Arrays.asList("Frank", "Mary", "Bob");
[1] http://download.oracle.com/javase/1.5.0/docs/api/java/util/A...Re: Java 7 is now available
#144Earlier quoted context omitted.
I recently had the great displeasure of working on a 20,000 odd line class. You cannot keep 20,000 lines in your head, it's an extreme challenge. Each method only had tiny differences but spotting them, as pivo's original comment argues, is a total nightmare. Refactoring brought it in at 1,500 lines. Now you can glance at any method and see the actual difference to the default that they do. Are you seriously suggesti…
Java does no such thing as "encourages 20,000 line behemoths filled with dross". Bad programmers do. If you're creating several methods that only differ a little bit, you're doing something stupid. In any language. Bad programmers create bad code. The language is totally irrelevant.
Re: Java 7 is now available
#145Earlier quoted context omitted.
I recently had the great displeasure of working on a 20,000 odd line class. You cannot keep 20,000 lines in your head, it's an extreme challenge. Each method only had tiny differences but spotting them, as pivo's original comment argues, is a total nightmare. Refactoring brought it in at 1,500 lines. Now you can glance at any method and see the actual difference to the default that they do. Are you seriously suggesti…
Java does no such thing as "encourages 20,000 line behemoths filled with dross". Bad programmers do. If you're creating several methods that only differ a little bit, you're doing something stupid. In any language. Bad programmers create bad code. The language is totally irrelevant.
There's a reason that people aren't programming in COBOL or BASIC.
Re: Java 7 is now available
#146There is a good amount of stuff to get excited about in this release. - Try-with-resources-Catch-Block [0] - Fork/Join libraries from Doug Lea (author of Executor framework) [1] - Inferred/Simpler generics in declarations (should have been in Java 5) - NIO2, brand new/robust filesystem APIs [2] - NIO2, treat ZIP/JAR files like directories of files for R/W [3] - SDP support [4] - String-in-switch (NOTE: check on perfo…
> I like being a pedantic programmer. Try Scala! (So do I ;)
Try Scala! (So do I ;))
then?
Re: Java 7 is now available
#147You can now finally use a string in a switch statement, hurray (it's the little things that make me happy)! http://download.oracle.com/javase/7/docs/technotes/guides/la...
God, I seriously hope string-switching doesn't catch on. In a prev job, I saw this block of code - ------- public int getDaysInMonth( String month ) { if( month.equalsIgnoreCase("january")) return 31; else if( month.equalsIgnoreCase("february")) return 28; else if( month.equalsIgnoreCase("march")) return 31; else if( month.equalsIgnoreCase("april")) return 30; ... } ------- My eyes bled. I said folks, just map the mo…
Re: Java 7 is now available
#148Meh. The world turns. I spent a decade developing primarily in Java, and the last few years were really disappointing. The community splintered, the language and platform really lost any ability to maintain momentum. I might have been stoked about Java 7 three years ago (when it should have come out).
> The community splintered, the language and platform really lost any ability to maintain momentum. This is the mindset I've never understood. Do you stop using a hammer to bang in nails because the hammer "community" has splintered, or the development of hammers has stagnated? No, you still use it to fulfill a job it solves.
Java is still an excellent tool for getting stuff done EVEN if it isn't cool anymore. Which of these is more important to you says a lot about where your head is at as a developer.
Re: Java 7 is now available
#149There is a good amount of stuff to get excited about in this release. - Try-with-resources-Catch-Block [0] - Fork/Join libraries from Doug Lea (author of Executor framework) [1] - Inferred/Simpler generics in declarations (should have been in Java 5) - NIO2, brand new/robust filesystem APIs [2] - NIO2, treat ZIP/JAR files like directories of files for R/W [3] - SDP support [4] - String-in-switch (NOTE: check on perfo…
Re: Java 7 is now available
#150Earlier quoted context omitted.
I think it is. If people haven't learnt yet that the single most important skill you need as a programmer is being able to read any code, in any language, and take a good guess at what it does, be able to hold abstract programming concepts in your head, and match them up to random code listings you have never seen before.... Before you can write code, you need to know how to read it.
I recently had the great displeasure of working on a 20,000 odd line class. You cannot keep 20,000 lines in your head, it's an extreme challenge. Each method only had tiny differences but spotting them, as pivo's original comment argues, is a total nightmare. Refactoring brought it in at 1,500 lines. Now you can glance at any method and see the actual difference to the default that they do. Are you seriously suggesti…
You say that you refactored it to 1500 lines from 20,000. Clearly it was written badly in the first place. Are you seriously suggesting that there is some other language where a bad programmer can't write bad code?
Java does NOT 'encourage 20,000 line behemoths filled with dross compared to a concise 1,500 line program'. That's an outrageous strawman argument.