Xtend – a better Java with less "noise"
Xtend is a statically typed language and it uses the Java type system, including Java generics and Java annotations. Thus, Xtend and Java are completely interoperable.
Most of the linguistic concepts of Xtend are very similar to Java, that is, classes, interfaces, and methods. One of the goals of Xtend is to have a less "noisy" version of Java. Indeed, in Java, some linguistic features are redundant and only make programs more verbose.
The Xtend Eclipse editor supports the typical features of the Eclipse Java editor, including templates. Thus, we can create a main
method inside the previously created Xtend class as shown in the following screenshot, using the content assist template proposal:
Let's write the "Hello World"
print statement in Xtend:
package org.example.xtend.examples class XtendHelloWorld { def static void main(String[] args) { println("Hello World") } }
You can see that it is similar to Java, though the removal of syntactic noise...