osiire’s blog


without objects!?




When we first tried switching over from VB to C#, one of the most disturbing features of the language for the partners who read the code was inheritance. They found it difficult to figure out which implementation of a given method was being invoked from a given call point, and therefore, difficult to reason about the code. It is worth mentioning that OCaml actually does support inheritance as part of its object system. That said, objects are an obscure part of the language, and inheritance even more so. At Jane Street, we almost never use objects and never use inheritance. We use standard functional programming techniques and code reviewers find that style more comprehensible. In particular, they can reason by following static properties of the code (module boundaries and functor
applications) rather than dynamic properties (what class an object is).



なんか、FP vs OOの構図でOO嫌いといいたいのかもしれないけど、こーゆー激しく誤解を生みそうな話を広めないでほしい。JSCの人々はせっかくすばらしい仕事して影響力あるんだから。