3 ms·
Do put your object in classes, but don't put behaviors there. Use classes to allow static type checking so that functions taking them can guarantee certain fiel
by chongli 13y ago
Do put your object in classes, but don't put behaviors there. Use classes to allow static type checking so that functions taking them can guarantee certain field exist.
Why not just use algebraic data types and modules? Classes are such a verbose, jumbled, complected mess compared to those simpler tools.
- lightblade 13y ago> ...algebraic data types and modules Sorry, I not familiar with that term. Can you explain that more?
- chongli 13y agoI would, but I'm afraid my explanation would pale in comparison to the one on Wikipedia. Why not check it out?: http://en.wikipedia.org/wiki/Algebraic_data_type http://en.wikipedia.org/wiki/Algebraic_data_type