3 ms·
One easy example: no higher-order functions like `map`, `select`, and `inject` because of no lambdas, so I wind up repeating the same looping code all over the
by pjungwir 14y ago
One easy example: no higher-order functions like `map`, `select`, and `inject` because of no lambdas, so I wind up repeating the same looping code all over the place.
I took a look at a few "functional programming in Java" libraries, but their solutions were still pretty verbose, and it didn't seem worth adding a dependency for a tiny smartphone app.
- pjungwir 14y agoEDIT: After thinking about it some more, there are several places where two methods are almost the same except for one line stuck in the middle. I don't know how to turn them inside-out in Java without spawning a bunch of tiny classes, and it's just not worth it. But with Ruby I could turn them into a single method, throw a yield in the middle, and then call it with a block. So again it comes down to no lambdas. (Hmm, this was supposed to be an edit, but somehow I did a reply instead.)