AGILE PROGRAMMING METHODOLOGIES

After parallelization, a second interesting consideration is that of functional modularization — that is, modularization on the level of individual functions. In object oriented languages, there are typically classes and methods within classes. There are languages that allow the nesting of methods, but many do not — in C#, for instance, methods can’t be nested. But the use of anonymous methods and lambda expressions allow the creation of functions that are local to methods, which opens the door to modularization on the algorithm level.

This notion fits in very well with the application of modern software development methodologies like Agile. One of the main ideas in this space is an evolutionary approach in which programmers work along simple requirement specifications and, in a nutshell, do only what’s necessary in each step to satisfy these requirements. Refactoring becomes an important part of the concept, and modularization, with the implied reuse resulting from it, can be very useful as a technique on a method or function level when the introduction of new methods on the class level seems like too large a step to take. Just like in the area of techniques for parallelization, functional programming doesn’t offer a magical solution here, but there’s a lot to learn from functional techniques that have employed functions as reusable building blocks for a long time.

Get Functional Programming in C#: Classic Programming Techniques for Modern Projects now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.