Chapter 5

Functions

Earlier in the book we made the statement that programming was all about problem solving. It is basically the art of giving a computer a set of instructions to solve a problem in terms that the computer can understand. One of the key foundational elements of good problem solving is problem decomposition. The idea of problem decomposition is that good solutions of large, complex problems are built out of solutions to smaller, more manageable problems. This is especially important in programming because the problems can be arbitrarily complex and, at the base, we have to break them down to the level where we can communicate them to the computer, which is fundamentally quite simplistic.

One of the key elements of problem decomposition ...

Get Introduction to the Art of Programming Using Scala 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.