As an OO developer, maybe I have difficulty seeing its value. What added value do they give? Do they fit in an OO world?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Closures don’t give you any extra power.
Anything you can achieve with them you can achieve without them.
But they are very usable for making code more clear and readable.
And as we all know clean readable short code is a code that is easier to debug and contains fewer bugs.
Let me give you short Java example of possible usage:
Would be replaced (if Java had closures) with: