Cedric Buest responds to Next-gen Java Programming Style(beust.com)
beust.com
Cedric Buest responds to Next-gen Java Programming Style
http://beust.com/weblog/archives/000517.html
7 comments
Yes, when I read his critique of fluent interfaces I realized that he is just disagreeing with everything to be contrary. "fluent interfaces are setters in disguise. So, Stephan, which one is it?" - he is not actually critiquing the fluent interfaces, just nitpicking the inconsistency. Its usually a mistake to be overly concerned with consistency.
Yes you can come up with a case where every one of those guidelines are wrong, but I think that there are a lot of cases where they make sense.
Yes you can come up with a case where every one of those guidelines are wrong, but I think that there are a lot of cases where they make sense.
As was pointed above, I'm not opposed to fluent interfaces and we use quite a few at my work (Google).
I was just observing that you can't argue against mutators and then encourage people to use fluent interfaces since they are basically the same thing.
I was just observing that you can't argue against mutators and then encourage people to use fluent interfaces since they are basically the same thing.
Right, I think the point of the original article is that you can gain a lot by using the proper syntactic sugar.
He got the same impression that I got, Java is not functional programming language.
Functions are just goto in desguise. switch/case is just an if/elif/else in diguise. Objects are just structs with some fancy function calling semantics. So which one will you use? Fluent interfaces may just be setters in disguise, but they add quite a bit of value.