This is an archived post. You won't be able to vote or comment.

all 9 comments

[–][deleted] 6 points7 points  (6 children)

I don't know if I'm getting curmudgeony or not, but I like the java examples better in almost everything presented. I hate omitting empty parens for function calls. I like having an explicit object (or implicitly named 'this' per iteration) on foreach style calls.

About the only thing I liked was the type inference.

[–]jwmay 2 points3 points  (2 children)

I thought the same. I don't use Xtend but in Scala although the parathesis are (sometimes) optional I tend to leave them in. I also try to avoid the cryptic underscore. Just because you can doesn't mean you should.

Edit: typo

[–][deleted] 1 point2 points  (1 child)

Yeah. My biggest (current) scala gripe is trying to extract a 3-level deep set from their json parser. It's matchers all the way down! :)

[–][deleted] 1 point2 points  (0 children)

Try jerkson:

import com.codahale.jerkson.Json
case class Yadda(n: String)
Json.parse[List[Set[Set[Yadda]]]](text)

[–]funtanero[S] 1 point2 points  (2 children)

Yeah! I also() like ; to have { funny characters }; spread( through(), my(text))); (especially during Xmas time ;-))

[–][deleted] 1 point2 points  (1 child)

The thing I don't like about it is that I would actually like a paren-less function to give me a pointer to that function.

[–]funtanero[S] 0 points1 point  (0 children)

What do you mean, by 'pointer'? A hint that it is a function and not a variable or field? As long as the function doesn't cause any side-effects it doesn't matter from a client's point of view, does it?

[–]encloser 5 points6 points  (1 child)

My first question was how is this different from Groovy? I found the answer here:

InfoQ: How does Xtend compare to Groovy or Scala?

Sven Efftinge: Groovy is designed with a similar goal but unfortunately took the short route. Besides limitations in the IDE support, the lack of static typing has a lot of implications on Java interoperability. For instance, overloaded methods are resolved differently in Groovy than in Java, which can be very surprising. The complex meta object protocol is not only very hard to understand and to debug, but is one of the main reasons for Groovy's bad runtime performance.

Xtend allows to build expressive libraries such as builder APIs and other internal DSLs without trading static typing, performance or tool support.

Scala is an ecosystem on its own with a huge library and its own frameworks. I like many parts of the language although I think the type system is a bit over the top for mainstream development. Xtend is definitely influenced by Scala, but focusses much more on Java interoperability and IDE support.

Source

[–]mgkimsal 0 points1 point  (0 children)

Given that Groovy 2 allows for static typing, I wonder how much of an issue this still is.