«« Next » « Previous
«« Next » « Previous

Link Details

It's so much easier than programming. Login and vote now.
Link 81227 thumbnail

By htowninsomniac
via concurrentaffair.org
Published: May 15 2008 / 16:44

I’ve come across two blog posts that leave me perplexed: “When Should You Jump? JSR 308. That’s When.”, and “What Hath Java Wrought”. I don’t understand why there is such much animosity towards JSR 308. Programmers can completely ignore annotations if they don't like them, and I believe the benefits by far outweigh the costs of a more complicated syntax.
  • 15
  • 2
  • 1368
  • 452

Comments

Add your comment
User 255959 avatar

yardena replied ago:

0 votes Vote down Vote up Reply

I find JSR-308 proposal far from perfect, but recent negative reaction was an exaggeration, IMO.

User 53369 avatar

behrangsa replied ago:

2 votes Vote down Vote up Reply

"As for generics, I gladly trade in the more complicated syntax for better static typing."

The problem with generics is not that it is a bad feature per se, but the current implementation is half-baked and has lots of ugly edge cases. I hate type erasure and its side effects for example. If for the sake of backward compatibility, it is not possible to add a feature elegantly to the language it is better not to add it at all rather than adding a half-baked and broken implementation if it.

"Annotation processors can do the same for non-null values, mutability, problems with equality and identity. They can bring linear types into the language, and make pretty much every kind of program analysis I can think of easier."

Java is Java. We don't want Java to become something else! If someone likes a very strict static typed language it is better for her/him to choose a language that's been designed like that since day one, rather than proposing adding some features to the Java language that by looking at history, suchlike additions to the Java language, have been, as I said previously, have all been half baked and broken: Generic, Enhanced For Loop, and Auto Un/Boxing.

"I’m definitely not a fan of how generics were implemented using erasure, and I believe there are shortcomings both in the annotations provided with Java 1.5 and JSR-308 (see LAPT-javac, xajavac and blog posts), but I’m a firm believer that programmers have benefited a lot from generics, and that they will benefit in a similar way from annotations."

Ok, I see that you are kind of on the same side as me. However, maybe adding one broken feature to Java didn't hurt it so much, but adding ten broken features to the language makes it as ugly as C++. Then people will jump off the Java bandwagon...

To sum it all, I am not against syntactical additions or extensions of syntactical features of the language per se, but I prefer to wait 5 years and see them implemented elegantly rather than 2 years and find out that they are broken and you know, when a syntactical feature is introduced in the language it is much much harder to change/fix it in case it had some problems compared to API additions to the language...


User 255959 avatar

yardena replied ago:

0 votes Vote down Vote up Reply

Do you really think that people who "don't want Java to become something else" will "jump off the Java bandwagon"? Where will they go? Back to C++? C#? C# is not the way to escape "new" Java features :-), besides it runs only on Windows. And will the companies that these people work for let them jump?... So they may not upgrade to newest Java version or avoid using new features, which many people do already, but "jump off"? I don't think so.

User 233358 avatar

fmoidu replied ago:

0 votes Vote down Vote up Reply

"besides it runs only on Windows"

the mono project is a fairly well done implementation of a lot of the .net framework in a non-windows environment.

User 169096 avatar

fijimf replied ago:

-1 votes Vote down Vote up Reply

"As a programming language researcher, . . . "

'Nuff said.

Add your comment


Html tags not supported. Reply is editable for 5 minutes. Use [code lang="java|ruby|sql|css|xml"][/code] to post code snippets.