Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.

  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

14. Ramping Lisp Up a Notch with Functio... > Why Functional Programming Is Crazy

Why Functional Programming Is Crazy

We already know one reason why functional programming is crazy: Functional programs can’t really do anything, since they can’t have side effects. As Simon Peyton Jones, a well-known functional programmer, likes to say, “All you can do without side effects is push a button and watch the box get hot for a while.” (Which isn’t technically true, since even the box getting hot is a side effect.)

We’ve seen that we can work around this limitation of functional programming by adding a dirty section to our programs, which is kept separate from the rest of the code and contains all our code that is imperative and not in the functional style. However, recall the problem with the functional style: It can cause code to be extremely inefficient.


  

You are currently reading a PREVIEW of this book.

                                                                                                                    

Get instant access to over $1 million worth of books and videos.

  

Start a Free 10-Day Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint