on mutable states) • Same result for the same arguments • Testability • Easier to expect result • More room of optimization • Side effect or state is essential in some cases (I/O, GUI)
material benefits - that a functional programmer is an order of magnitude more productive than his conventional counterpart, because functional programs are an order of magnitude shorter. Yet why should this be? The only faintly plausible reason one can suggest on the basis of these “advantages” is that conventional programs consist of 90% assignment statements, and in functional programs these can be omitted!
"Richard Waters (1979) developed a program that automatically analyzes traditional Fortran programs, viewing them in terms of maps, filters, and accumulations. He found that fully 90 percent of the code in the Fortran Scientific Subroutine Package fits neatly into this paradigm."
X B) • sum types (A | B) Noodle Food = Ramen (Noodle (Thin | Thick) x Soup (Salt | Soy sauce)) | Pasta (Noodle (Thin | Thick) x Sauce (Tomato | Basil)) | Pho (Noodle (Thin | Thick) x Soup (Salt | Soy sauce)) Complicated type can be represented