Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I doubt CLOS would serve as a crutch for old habits, I found it to be pretty different from the OO style in C++/Java/Python, and very interesting. I don't understand all the details, but I would recommend Peter Seibel's Practical Common Lisp. If you are reading <em>On Lisp</em> without much trouble, you should be able to dive into <a href="http://gigamonkeys.com/book/object-reorientation-generic-functions.html">the chapters introducing CLOS</a> in PCL. Also, I'd recommend his <a href="http://www.youtube.com/watch?v=VeAdryYZ7ak">Google Tech Talk</a> comparing Java and Common Lisp.</p> <p>Here's a few more recommendations to make this a more full-fledged answer:</p> <p>The classic text <a href="http://mitpress.mit.edu/sicp/"><em>Structure and Interpretation of Computer Programs</em></a> covers quite a few examples in chapter 3 of building modular systems using closures (and addresses issues with introducing state and mutability). Chapter 2 includes some generic and data/type-directed programming which could be helpful for motivating study of CLOS. This book really needs no introduction though, it's a towering work, and I've only been reading it slowly since the spring. Highly recommended if you are interested in Scheme.</p> <p>While SICP is a great book, it's not without its flaws: A really interesting look at these is the essay <a href="http://www.ccs.neu.edu/racket/pubs/jfp2004-fffk.pdf">"The Structure and Interpretation of the Computer Science Curriculum"</a> which elaborates on a few criticism of SICP, and is written by the authors of <em>How to Design Programs</em> (I haven't read HTDP but I hear it's very good). While this essay won't teach you specifically what you are looking for - comparing functional and OO programming - it is really interesting anyway. Their freshman undergraduate course starts with a first semester introduction to functional programming using Scheme (I think, PLT/Racket) and is followed by a semester of OO programming with C++ or Java... at least that's the course they describe in the essay.</p> <p>These slides from Peter Norvig address some of the design patterns common in OO programming and show why they are missing or unnecessary in dynamic, functional languages like Scheme and Lisp: <a href="http://norvig.com/design-patterns/">http://norvig.com/design-patterns/</a></p> <p>I <em>cautiously</em> recommend the book by the same authors as the Little Schemer books: <em>A Little Java, A Few Patterns</em>. I can't say for sure if this is a really a good book or not, it was incredibly strange and there are some really bad typesetting decisions (italic, serif, variable-width, superscript doesn't belong in a text on programming), but it might be interesting to take a look at. You can probably find it cheap, anyway. Don't take this recommendation that seriously. I think it would be better to stick to the Scheme texts.</p> <p>p.s. I have to disagree with one comment stating that functional programming is not as complicated at OO programming, I think that's grossly misstating it. Functional programming in all its breadth is truly mind-boggling. When you go beyond map/filter/reduce and first-class functions, and take a look at other things in the functional realm like lazy evaluation, avoiding side effects and mutation, and the strong, static-typed languages, it gets pretty interesting, and is certainly just as complicated as <em>traditional</em> OO programming. I've only just scratched the surface myself but have discovered a great deal of new ideas. Programming is complicated business, whether OO or functional.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload