Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Every Paradigm Has its Place (atalasoft.com)
8 points by Rickasaurus on July 20, 2009 | hide | past | favorite | 4 comments


The corollary to this is extremely important: Every paradigm has a place where it doesn't belong. OO, FP and whatever flavor of the month all have places where they shine, and places where they don't. And arguably, it's more important to know where a paradigm doesn't work, than where it does.

Don't believe the hype. OO isn't perfect everywhere, and neither is any other tool. Learn a bunch of different tools so you can apply the proper one.


I feel like this is a really good point but am having trouble coming up with many concrete examples. For example, I've felt like every declarative attempt at game AI has been absolutely horrible.


One easy example is FP in low level, performance sensitive code. There are many algorithms where there is an FP implementation that is almost as fast as the imperative, mutable state version, but there are several algorithms with no known equivalent speed FP version. Also, even when the speeds are equivalent, sometimes the imperative mutable version is simpler.

Conversely, FP shines compared to imperative mutable state in things like concurrency. I have clojure code where I can replace a call to 'map' with a call to pmap (parallel map), and take advantage of multiple cores just by adding one character. Try doing that in C.


Of course, if you find this article interesting, look at CTM (Peter Van Roy and Seif Haridi's _Concepts, Techniques, and Models of Computer Programming_ (http://www.info.ucl.ac.be/~pvr/book.html)) The papers it links to are excerpts from the book.

One of the best books on programming I've ever seen, IMHO.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: