Live data from Hacker News

Java 7 is now available

oracle.com

131–140 of 218 posts

Re: Java 7 is now available

#131

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…

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

#132

Earlier quoted context omitted.

>>No, it doesn't. If you can't write concise Java, you're doing something wrong. And if you can't read code well, go practice some more. Don't know why you are getting down voted. Even Joel Spolsky says that what really makes the difference is the programmer, not the language. If you suck in Java you will probably suck in other languages.

I know why he gets downvoted: There's a lot of kids on hacker news that only use ruby and/or javascript and they really don't want to hear about them being bad at something. hell they wrote a WEB APPLICATION. Now ain't that something.

That's just foolish. I write Java daily for a very large web company, and I downvoted him. Because his claim is nonsensical. I downvoted you too, because your claim is trollish and wrong.

I have been writing Java since I was 13. I am 23 now. I have been paid for code written in C#, Java, JavaScript, PHP, F#, and Python. My personal projects are written in Scala, C#, C++, and JavaScript. I emphatically do not use Ruby for personal or professional projects (unless forced, with regards to the latter). From this reasonably broad body of experience, I am quite certain that I would be vastly more productive if the language wasn't consistently getting in my way. As it is, I have an unhealthy number of vim macros to deal with all the boilerplate that Java foists upon a developer. It is insufficiently expressive without them, and once those macros are applied the resultant boilerplate code (method objects, for example) greatly decrease readability and increase potential failures, due to more difficulty in conceptualizing and reviewing the code.

His posts also belie a lack of perspective. He doesn't "write with anyone else," yet I would venture to guess that the primary use case of Java, today, is in environments with more than one developer. He doesn't "use 3rd party libs", which suggests a lack of familiarity with his own ecosystem of tools, let alone those that provide these features that others (including myself) have indicated are part of what makes Java unpleasant to use. (Seriously--if you're not using Apache Commons at the very least, there is a credible argument that you're probably reinventing wheels and Doing It Wrong.) And he has a critical lack of perspective about what are generally considered basic programming constructs: if you think closures and first-class functions exist to "make some developers happy," you are ignorant of why they exist in the first place. Do you think that now-very-standard tools like map, fold, etc. would be generally adopted if the only way to use them was Java-boilerplate code-vomit?

.

pivo said it nicely upthread: "I'm tired of visually parsing 20 lines of a Java method and filtering out all the boilerplate iteration junk just to find the one or two lines that actually do something. Often this kind of thing can be reduced to a few simple, relevant lines when you have closures, for example." And he is right. Because this is what Java makes you do. In 2011, it has been surpassed in terms of flexibility, expressiveness, and utility by other JVM languages that allow you to pull in Java objects and work with them, but write your code in a way that is much more pleasant.

.

But no--clearly we're all kids, writing Ruby and JavaScript. Except that this kid almost certainly writes more, better Java than you do, and still finds it a regular source of frustration simply because it isn't good enough.

Perhaps you should be less upset when people demonstrate that you are lacking in perspective about your favorite toys.

Re: Java 7 is now available

#133

Earlier quoted context omitted.

Yes, it is harder to come up with the actual design, architecture, algorithms, testing of your program than the actual coding. You should definitely use what makes you more comfortable but criticizing/hating a language because it is not adding whatever is currently hot under the Sun is also obnoxious and arrogant. C++ is a lot older than Java and can be also a pain to write programs in and yet for whatever reason peo…

I don't hate Java. The language is good and the JVM is great.. but I became increasingly displeased with the fact that the evolution of the language seemed to become slow and aimless. Couple that with where the tools were going, and I felt like it was getting harder and less fun to write applications in Java.. so I kind of bailed. There really is not much you can do to Java at this point Because it's basically perfec…

>The frameworks are ridiculously heavy... I agree with you on this part. I kept scratching my head when I was first introduced to Enterprise java beans. It all smelled like BS to me but because more experienced people than me and with more status were evangelizing about it I couldn't really call them on it. In the end I just ignored all of that and used the pieces that I like. Kept everything as simple as possible. I'm not directing this at you but just in general: Nothing wrong with moving to knew languages but criticizing any language because it is missing some simple feature like X and claiming that without it you just cannot work seems to me lazy and full of BS. All languages have issues. The difference is made by the programmer.

Re: Java 7 is now available

#134

Earlier quoted context omitted.

>>No, it doesn't. If you can't write concise Java, you're doing something wrong. And if you can't read code well, go practice some more. Don't know why you are getting down voted. Even Joel Spolsky says that what really makes the difference is the programmer, not the language. If you suck in Java you will probably suck in other languages.

Then why did he wrote his own language for his product? Oh right, because languages do matter. Sure, what makes one a great programmer is language independent, but that doesn't mean you can have the same code quality in every language. There's a reason why professionals in every field buy top quality tools and not cheap disposable crap.

>>There's a reason why professionals in every field buy top quality tools and not cheap disposable crap.

Agree But Java is not cheap disposable crap. At this point it is more a matter of taste. You don't like Java fine, but other people are able to be just as productive as you using Java and probably more depending on the programmer itself. At the end of the day it is the programmer that makes the difference.

Re: Java 7 is now available

#135
post #98
post #55

Earlier quoted context omitted.

I don't think I would say it's floundered. I came back to Java last year after 10 years of C++, and was really pleasantly surprised: Programming in Java now is a nice experience. I would say it has matured, not floundered.

You're comparing one circle of hell to a deeper circle of hell, though. The comparison isn't Java to C++. It's Java to C#, Scala, even Python or Ruby. And against C# and Scala in particular, Java does very poorly.

By very poorly I would guess it would depend on how your comparing them. In my experience working with Java, C#, Scala, Python and Ruby all of them were fantastic. The only time I have ever considered a language a "deeper circle of hell" was with (large team) php and perl projects.

Re: Java 7 is now available

#136
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…

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…

[deleted]

Re: Java 7 is now available

#137
post #108
post #40

Earlier quoted context omitted.

IntelliJ IDEA strongly suggests to turn those Strings into constants. And then to turn those constants into an Enum. Oh wait, we could also switch() on Enum values! I'm sure this is useful in some cases though :-)

Wouldn't it be better to configure the switch options in an xml configuration file?

I would like to vote you up for the chuckle, but this being Java, I can't tell for sure if you're joking...

Re: Java 7 is now available

#138

Earlier quoted context omitted.

I know why he gets downvoted: There's a lot of kids on hacker news that only use ruby and/or javascript and they really don't want to hear about them being bad at something. hell they wrote a WEB APPLICATION. Now ain't that something.

That's just foolish. I write Java daily for a very large web company, and I downvoted him. Because his claim is nonsensical. I downvoted you too, because your claim is trollish and wrong. I have been writing Java since I was 13. I am 23 now. I have been paid for code written in C#, Java, JavaScript, PHP, F#, and Python. My personal projects are written in Scala, C#, C++, and JavaScript. I emphatically do not use Ruby…

You are basically saying that people cannot write good code in Java. You are generalizing and that makes you sound like and troll even though I know that is not your intention. You can write good or bad code in Java. I personally have never really had an issue with Java so I don't really understand the hate.

Yes, there are sucky frameworks out there but you do know that you don't have to use them? Either I'm writing really simple code that Java never gets in the way, Java is not really a problem, or I'm a super programmer. I don't think I writing simple code, I don't think I'm a super programming, so it has to be that Java is not really a problem for me. And I write similar code in Objective-C, C++/C, JavaScript and even had to write a lot of code in VBA. Had even to write code in PL-SQL several years ago.

Every language has its own nuances, you just find the best way to work with them, ignore the junk, and adapt. Which is why I really don't get where all this hate is coming from. You never hear this for C++ and it can also be a pain in the ass but you do hear it for Java.

Is almost like it is cool to hate on Java.

Re: Java 7 is now available

#139
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…

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/

Re: Java 7 is now available

#140

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.

In certain situations, professional carpenters have found nail guns more effective.

They require more resources to run, but they tend to get the job done a lot faster.

Post reply on HN