Readability
Llewellyn Falco
isidore at setgame.com
Wed Dec 22 10:51:31 PST 2010
great! So in both of your examples you choose to get rid of the reverse
polish notation.
So, at least we can agree that the normal method is hard to read.
Brian didn't address it, so assuming he is either on board with use site
extension methods, or just believes oracle will provide all the ones you
actually want to use.
Mark suggested using a Builder paradigm for your query object. which is
interesting. But a more complex object to write (much more complex actually,
what if you have 2 where clauses with an orderby inbetween?). And
isn't compossible with other methods. in otherwords it only works if the the
above path doesn't have any other steps.
For example lets say I wrote a unique() function that I wanted inbetween
select and where. It wouldn't compose. the monad that you are creating now
is a Query object instead of a List<T>
You also both included the importance of whitespace to counter-act the
confusion of lambdas.
The issue I have with this is my code is automatically formatted by eclipse
on-save.
so now I have to forego consistent, automatic, company wide formatting to
gain readability.
again, java is late to the party with lambdas. they need to be "at least at
good" as other languages. I keep getting responses on this list of "here's
a smarter way to code up that solution".
Even when it's pointed out that oracles own manuals teach a method you
disagree most people will use, the response is "well some people are dumb,
not everyone will be".
I actually believe the opposite, because so many people who "get" lambdas
have already left. They got tired of waiting since 2007. they moved on to
c#, scala, ruby, groovy, etc...
Lambdas are slated in java for 2 more years.
We need to be better.
Llewellyn
More information about the lambda-dev
mailing list