News for hackers. Stuff that matters.
Re:Wizards and warriors, part five by inglor on Monday November 16, 2015 @04:05AM (#10573383)
I don't understand this post at all. He started with wanting compile time validation of the invariant ("A wizard cannot wield a sword") - then talked about how runtime solutions were not good and then ended up with a solution that does not verify that invariant in compile time at all.

He just ended up with a language where all code is written in a specific language programmers have to learn and errors are in another language.

The generic constraint solution he had in the middle (part 2) was actually pretty decent because hey: if Wizards and Warriors can't yield the same weapons - and the weapon is a property of the supertype then __they are not interchangeable as players__. You need a different interface.

There are no comments on this comment yet.