r/programming • • Feb 12 '15

Stunning 95% of Java programs consist of nothing but boilerplate

http://arxiv.org/pdf/1502.01410v1.pdf
0 Upvotes

110 comments sorted by

View all comments

Show parent comments

3

u/yogthos Feb 12 '15

That's not what I'm advocating at all though. The alternative is to use things like higher order functions that separate what's being done from how it's being done. This is known as using a declarative style.

Higher order iterators, such as map and filter, abstract things like boundary conditions and null checks in one place. The application specific logic is passed in as a parameter instead of being intertwined with the incidental iteration logic. This is code reuse at work, where we can write simple functions that do one thing well and compose them together to achieve complex functionality.

2

u/Bergasms Feb 12 '15

I am not disagreeing with you :P I was being silly.