4 ms·
>will say that, when I see object-oriented code that branches on the particular subclass of a value at run time, it's often one of the earlier sign that the cod
by hardware2win 3y ago
>will say that, when I see object-oriented code that branches on the particular subclass of a value at run time, it's often one of the earlier sign that the code is getting messy.
Suppose you have AST which has Node and its various subclasses like ExpressionNode, which then has e.g ConstantExpressionNoee
And so on, many, many other
How would you then avoid branching basing on type?