J
jhc0033
I'm an experienced and multilingual programmer who, until now, avoided
becoming too familiar with Java.
While I'm very impressed with the Eclipse IDE for Java and the
performance improvements JVM has apparently made, I'm unimpressed by
the amount of error-prone boilerplate code that programming in Java
still requires.
Firstly, there is the pervasive repetitiveness of Java code. For
example, for most classes, it makes sense to define, say, clone(),
equal(), toString(), toXML(), fromString, fromXML() for all of them.
All of these operations follow a very simple pattern that can be
easily formalized. However, Java programmers have to implement each of
these methods by hand for every class. Another common example is the
trivial getters and setters.
Whenever there is repetitiveness, there is boredom, error-proneness,
job-dissatisfaction (on the part of anyone who's not a mindless drone)
and low productivity. One might argue that code generators can help
with this, but they don't help you read and modify the code.
Secondly, there is the relatively minor issue of verbosity. Consider
this fragment:
Bar b = new Bar(x, y);
Why not
b = new Bar(x, y);
If b is a member or a local variable - assign to it. If it isn't,
declare it (Note: I'm not proposing automatic member declaration, like
in Python) Following the capitalization of classes convention, one
might even trim this down to
b = Bar(x, y);
Thirdly, there is the general issue of language extension. If the
creators of the language did not implement a certain policy, such as
the automatic generation of clone(), equal(), toString(), toXML(),
fromString, fromXML(), and I would find it very useful in my project,
how could I extend the language to do these and other things for me?
(For Lisp programmers reading this, I'm basically thinking of
defmacro)
Can AspectJ address these issues?
If it can, can it do so without compromising the runtime performance
compared to writing the equivalent code by hand?
Also (and this is unrelated to the performance question), can AspectJ,
or at least its compile-time functionality be used with GWT (a Java
source to JavaScript compiler), which is my main motivation for
looking at Java?
becoming too familiar with Java.
While I'm very impressed with the Eclipse IDE for Java and the
performance improvements JVM has apparently made, I'm unimpressed by
the amount of error-prone boilerplate code that programming in Java
still requires.
Firstly, there is the pervasive repetitiveness of Java code. For
example, for most classes, it makes sense to define, say, clone(),
equal(), toString(), toXML(), fromString, fromXML() for all of them.
All of these operations follow a very simple pattern that can be
easily formalized. However, Java programmers have to implement each of
these methods by hand for every class. Another common example is the
trivial getters and setters.
Whenever there is repetitiveness, there is boredom, error-proneness,
job-dissatisfaction (on the part of anyone who's not a mindless drone)
and low productivity. One might argue that code generators can help
with this, but they don't help you read and modify the code.
Secondly, there is the relatively minor issue of verbosity. Consider
this fragment:
Bar b = new Bar(x, y);
Why not
b = new Bar(x, y);
If b is a member or a local variable - assign to it. If it isn't,
declare it (Note: I'm not proposing automatic member declaration, like
in Python) Following the capitalization of classes convention, one
might even trim this down to
b = Bar(x, y);
Thirdly, there is the general issue of language extension. If the
creators of the language did not implement a certain policy, such as
the automatic generation of clone(), equal(), toString(), toXML(),
fromString, fromXML(), and I would find it very useful in my project,
how could I extend the language to do these and other things for me?
(For Lisp programmers reading this, I'm basically thinking of
defmacro)
Can AspectJ address these issues?
If it can, can it do so without compromising the runtime performance
compared to writing the equivalent code by hand?
Also (and this is unrelated to the performance question), can AspectJ,
or at least its compile-time functionality be used with GWT (a Java
source to JavaScript compiler), which is my main motivation for
looking at Java?