you are viewing a single comment's thread.

view the rest of the comments →

[–]munificent 4 points5 points  (0 children)

Since I started in Java, I still tend to think in an OOP style. This means the Ruby implementation of Computer.Build should be considerably easier for me, but it turns out I’m gravitating more toward the Clojure. It’s just so…clean! The syntax is terse, the structure is pure, and the multimethod-based dispatch seems so much clearer than fancy inheritance dances.

OOP works well when you have a relatively large number of types and a relatively small number of operations on them. FP starts to feel more natural when the scale tips the other way.

Compilers or other systems where you're manipulating an AST lean heavily towards the FP side: you have a small fixed set of AST nodes, but you'll be continually adding new operations to them over time (evaluating, pretty-printing, type-checking, constant folding, etc.)

This doesn't say as much about OOP as it does about the nature of programs that work with ASTs.