logoalt Hacker News

Guarded Methods in OCaml

28 pointsby birdculturelast Monday at 4:15 PM1 commentview on HN

Comments

msdztoday at 9:29 PM

Nice article, but I don’t fully understand why the author argues for such an aversion to static functions.

> Moreover, it breaks the systematic approach of sending messages to an instance (often presented as one of the key arguments in favor of object-oriented programming).

Is this just a matter of “the code will become spaghetti once too many classes/methods/implementations exist”? And, conversely, is a non-static method with a constrained, i.e. somehow different type (or also the approach of moving a method outside of the class proper) not more confusing?