Every story and comment from the Hacker News API, in a layout borrowed from 2001.
A comment on Flags Are a Code Smell (2014). Parent comment
The switch/jmp table can be optimized to be inline, vtable will likely incur a stack frame, plus usually 3 indirections.
When you have a closed set of types, then you know all cases for branching, in polymorphism you lose this power -- it's open ended.
This is another reason why languages should have exhaustive pattern matching with sum types.
There are no comments on this comment yet.
The switch/jmp table can be optimized to be inline, vtable will likely incur a stack frame, plus usually 3 indirections.
When you have a closed set of types, then you know all cases for branching, in polymorphism you lose this power -- it's open ended.
This is another reason why languages should have exhaustive pattern matching with sum types.