Java Plus Plus

From EggeWiki
Revision as of 05:58, 6 March 2007 by Brianegge (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Java++ is my yet to be implemented language which add features from C++ to Java. The language could be implemented either as a pre-compiler or it could create it's own byte-code. In either case, it would run in existing JVMs and can integrate into an existing Java code base.

Java was purposefully kept simple, and that makes the syntax easy to learn. However, after a while, it becomes so tedious typing long Java programs because you are limited by the language. This is one of the reasons why many Java programmers have switched to Ruby. Java++ is intended to be the language of choice for experienced Java developers who must code in Java.

Here are my language features. If I get time, I might even implement the language.

Operator Overloading

It has always struck me as arrogant that Sun allowed java.lang.String to have overloaded operators, but no other classes. This is the benevolent dictator approach, which says if you have the power to do something, you will surely abuse it, and so they take it upon themselves to protect their people.

Consider the Money class:


public class Money {
  Money add(Money rhs) { /*...*/ }
  Money multiply(Money rhs) { /*...*/ }
}