Lambda Functions – Acceptability in Business Software

lambda

I've noticed posts on here demonstrating the use of delegates\lambda functions to solve the hole in the middle idea without a lot of repetition: http://www.markhneedham.com/blog/2009/04/04/functional-c-the-hole-in-the-middle-pattern/

The problem seems to be that junior developers and others don't necessarily understand what the function pointer\delegate\lambda function concept is, which seems to make reading (and possibly debugging) the code more difficult.

Should we avoid or severely limit the use of this tool in writing business software, especially in small team or sole developer shops?

Or is it acceptable to use it with appropriate comments and expect that when I'm no longer around that the next developer will understand or learn about lambda functions?

Best Answer

The problem seems to be that junior developers and others don't necessarily understand what the function pointer\delegate\lambda function concept is

Quite frankly, that's their problem. That's what you ensure they have training for. You can't not use a good technique just because some people might not understand it. If they need help with it, they can come ask the author. More importantly, lambda functions are becoming extremely common language features.

Should we not use inheritance because some people don't understand it? Hell, some people refuse to believe in science or germs or any manner of ridiculous things. You have to be able to move on and not let the possibility that others won't be able to keep up with you stop you from writing the best code you can. Lambda functions are a great feature and greatly help in writing code, and you should take all the help you can get.

A developer should know how to use the language they're in- junior or not. If they don't, then fire them and find someone who does, or train them up so they do.

Related Topic