By puredanger
via sdtimes.com
Published: Sep 02 2008 / 09:31
The upcoming Java 7 shows all the signs of being a major release, on the order of Java 5. It has numerous features that will make Java easier to develop with, and that will lead to cleaner, better code. Let’s look at some of them.
Comments
cbang replied ago:
Ehmm yes ok that's all nice and we've heard it before, but when will we actually see a language JSR? Java 6 took 18 months from JSR to realization and it didn't even have any language changes.
Jacek replied ago:
No closures???? After all these years of discussions, still no closures???? Unbelievable.
Nick Brown replied ago:
That surprised me as well. When was that announced? Last I heard Gafter had finished the BGGA prototype, so I thought they were pretty close to something.
cbegin replied ago:
Anyone else wonder how someone can say this: "The upcoming Java 7 [...] has numerous features that will make Java easier to develop with", and then this: OSGi, ForkJoinExecutor, asynchronous I/O, and invokedynamic bytecode.
How about just a simple multi-line string? That would make Java easier to develop with. Sun and the JCP need fewer engineers focused on building app servers and making themselves sound smart, and look for more application developers who understand the real issues Java is facing.
cbang replied ago:
You're spot on about that. Ok so SUN never did grok what KISS is about but still, with all the emerging languages one would think there's basis for some NIH coming to the average corporate developer (and please, no more misuse of annotations, fix the language instead!).
Nick Brown replied ago:
Isn't that possible with the + operator?
String aVeryLongString = "This is a very, very, very " +
"very long string";
And before you say something along the lines of wasting memory by creating multiple strings, the compiler is smart enough to combine them into one at compile time.
cbang replied ago:
Umm have you ever tried working with JPQL, embedded SQL or any other DSL buried in String tokens? Copying and pasting between the IDE and a database tool? Then I think you would understand.
cbegin replied ago:
That's not a multi-line string. That's multiple strings. Big difference. I recommend trying out a few other languages, C#, Ruby, anything. Not to replace Java, but learning them will make you a better Java developer. If you can't think of 10 ways to make Java a better programming language, then you're living in a pretty stale and constrained box. Your 10 ways don't have to be the same as mine, but you should be able to see at least 10 things you would change about any programming language that you use. I can think of 10 that don't even require JVM changes.
Nick Brown replied ago:
"That's not a multi-line string. That's multiple strings."
Not as far as the compiler is concerned. It considers it a single string. What exactly is the problem you are trying to solve here? If it is something other than wanting to be able to create long strings without being constrained to a single line, please elaborate as that is the problem I usually hear when people mention a desire for "multi-line strings".
"I recommend trying out a few other languages, C#, Ruby, anything. Not to replace Java, but learning them will make you a better Java developer. If you can't think of 10 ways to make Java a better programming language, then you're living in a pretty stale and constrained box."
I've studied plenty of other languages and can think of dozens of improvements that could be made for Java. But being able to write long Strings on multiple lines is not one of them.
cbegin replied ago:
>>Not as far as the compiler is concerned
This is not a compiler issue. Nobody is talking about performance here. It's a human issue. Code readability is the subject.
cbang already elaborated here. If you can't see the problem with using string concatenation as a solution, then I'm sorry. You're a different kind of developer from those that I've known. None that I've known would prefer Java's approach.
#Ruby
cbegin replied ago:
DZone deleted my examples... you'll have to enlighten yourself with Google searches.
Ignacio Coloma replied ago:
Nick, when writing even the simplest SQL code into java, you will end up copying the strings from your SQL tool of choice and spend the next ten minutes formatting into the multistring thing (putting " + in place, indenting, etc). What they are asking is that the compiler does all the work.
It only happens if you work with big strings, but when it does, it's a major issue.
samizaka replied ago:
I agree with cbegin ...
Furthermore, I can't see the positive aspect when Sun releases three versions of Java in 5 years ...
Jacek replied ago:
Ah yes, multi-line string...what I would do for that...
,
kenallen999 replied ago:
Maybe it is time to stop complaining and start changing the language
kenallen999 replied ago:
anyone for 'T'
Voters For This Link (22)
Voters Against This Link (7)