News for hackers. Stuff that matters.
Re:OOP Is Dead, Long Live OOP by noblethrasher on Thursday October 18, 2018 @03:51PM (#18251549)
Or… if you're talking about languages like C# and Java (and presumably C++), just make sure all of your classes are either sealed or abstract. This turns classes into proper algebraic data types.

To wit, implementation inheritance gives you a sum type (e.g. a Shape is either a Circle, or a Square, or…) whereas interface inheritance gives you a product type (class Foo : IBar, IBaz means that Foo is an IBar and an IBaz).

Re:OOP Is Dead, Long Live OOP by confusius on Monday October 22, 2018 @04:36AM (#18273067)
"languages like C# and Java" Not particularly your post, because compared to e.g Haskell you could say that, but I usually cringe when people say "C# and Java", and often list a hsot of bad attributes that are more particular to Java. Java is such an utterly verbose, dull, ugly, clumsy to use language that falls over its own feet all the time, expecially when adding new features that are at best half as useful as they could be because of early design problems... Whereas C# is, comparably, such a joy to use... ;)
Re:OOP Is Dead, Long Live OOP by rienbdj on Friday October 19, 2018 @11:54AM (#18257607)
Nice idea, but without match expressions (checked by the compiler) it’s just not as good as a true FP language.