preface

 

Programming is one of the rare disciplines in which you can create something from absolutely nothing. You can create whole worlds that behave exactly as you want them to behave. The only thing you need is a computer.

When I was in school, most of my programming classes focused on imperative programming—first on procedural programming in C, and then on object-oriented programming in C++ and Java. The situation didn’t change much at my university—the main paradigm was still object-oriented programming (OOP).

During this time, I almost fell into the trap of thinking that all languages are conceptually the same—that they differ only in syntax, and that after you learn the basics such as loops and branching in one language, you can write programs in all others with minor adjustments.

The first time I saw a functional programming language was at the university, when I learned LISP in one of my classes. My gut reaction was to use LISP to simulate if-then-else statements and for loops so that I could actually make it useful. Instead of trying to change my perspective to fit the language, I decided to bend the language to allow me to write programs in the same way I used to write them in C. Suffice it to say that back then, I saw no point whatsoever in functional programming—everything I could do with LISP, I could do with C much more easily.