Chapter 11

Calling Yourself

WHAT’S IN THIS CHAPTER?

  • Recursion in C#
  • Tail Recursion
  • Accumulator Passing Style
  • Continuation Passing Style
  • Indirect Recursion

In functional programming languages, recursion is a tool with a lot of tradition. Many of the original functional languages didn’t have any loop constructs, and recursion was used for all cases where looping is typically used in imperative languages. Even though some functional languages have extended syntax today that allows for imperative looping, recursion is, for many programmers, still the preferred approach.

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.