Live data from Hacker News

Java 7 is now available

oracle.com

141–150 of 218 posts

Re: Java 7 is now available

#141
post #72

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…

ECC excites me - no need to have to ship BouncyCastle anymore.

Re: Java 7 is now available

#142

Did 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…

Without the definitions (especially of "Commercial Features", this doesn't really mean much. I'm sure restrictions and rules on distribution have always existed, since we ran into issues with redistributing tools.jar back in 1999/2000.

Re: Java 7 is now available

#143
post #139

Earlier 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/

Since 1.5 you can use the `Arrays` built-in [1]:

    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

#144

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

[deleted]

Re: Java 7 is now available

#145

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

It's really not irrelevant.

There's a reason that people aren't programming in COBOL or BASIC.

Re: Java 7 is now available

#146
post #122
post #72

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…

> I like being a pedantic programmer. Try Scala! (So do I ;)

shouldn't that be

Try Scala! (So do I ;))

then?

Re: Java 7 is now available

#147
post #51
post #16

You 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…

Hope I never have to maintain pseudo-mathematical code like the one you were (thankfully) asked to revert.

Re: Java 7 is now available

#148

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

This is the difference between engineers and fashion conscious newbs. Some of us are trying to get stuff done, some are wanting to be cool.

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

#149
post #72

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…

Oh sweet jesus finally collection literals. Why did it take more than 10 years to decide to bring in something so convenient? One reason I sometimes find Java repulsive is the fact that it takes so much redundant code to do something so simple. Why do they hold back on such syntactic sugar?

Re: Java 7 is now available

#150

Earlier 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…

That's a huge strawman! I've seen utter rubbish written in C++ but I don't go around claiming that C++ is broken on that basis. What you are claiming is utterly invalid.

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.

Post reply on HN