God save us from ->

by Robert Cooper

I hope this is wrong. I have already stated my views on the XML-in-the-language, but I really would hate to see -> come to Java.

4 Comments

Stefan
2006-12-07 23:27:26
At first shorter property access may look sweet, but I feel it's just more hassle as a programmer. When you type "get" to get your content-assist, you know you will get properties. You can browse all getters as well, which is nice if you do not know what you are looking for. Without this prefix, the list becomes much larger.


And there is no obvious way of knowing if there is both a get/set for that property without checking docs or try out the property (may be an IDE problem).


I just don't get it, what is wrong with writing get/set -ers!.

Tom
2006-12-08 07:03:39
Groovy does XML creation using builders and it is much cleaner and more readable.


Really they should save "rich" features for a whole separate language (i.e. Groovy/JRuby/Python). That would keep the Java purists happy, and avoid having these things bolted on the side of Java. Even Generics seem like an ugly bolt because of lame-o type erasure.


I mean, use the right tool for the job. Don't take the Java (the hammer) and try to turn it into a screwdriver/ratchet/jigsaw. Leave Java as just a hammer. Focus on first-class JVM support for dynamic languages instead. .NET already has it. Try to keep up, Sun.

cooper
2006-12-08 10:23:21
I am not opposed to having a property notation, but I just hate -> as a construct. Hated it in C++, would hate it in Java.


How about ":"? myBean:someProperty seems like a perfectly reasonable counterpart to myBean.someAttribute and it doesn't require 2 keystrokes in offputting keyboard positions. Since the other uses of ":" as a token are in pretty explictly narrow contexts (for and case) it doesn't seem like this would introduce undue complexity.

DerekSunshine
2006-12-08 13:37:10
Maybe if we implemented a union between text smilies and OOP, we could create a truly visual programming language.


Example -


We could replace the "instanceOf" operator -
if(foo :-) Bar)


Invoke the default constructor
foo = new Bar :p;


Override the toString method
String foo = bar:-(;


Seriously, I'm generally not fond of using sequences of punctuation in any language. It's what makes Perl and C/C++ so easy to obfuscate. It usually ends up fairly idiosyncratic between languages.