{'fraction_non_alphanumeric': 0.018158236057068743, 'fraction_numerical': 0.0, 'mean_word_length': 5.380165289256198, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
When to inherit a type

Meaningful applications of inheritance are critical in devising good object-oriented solutions. Yet, not being able to use effectively and correctly inheritance in problem solving is perhaps the most significant impediment for students to become competitive object-oriented thinkers. This article provides a summary of common uses of type inheritance. It also describes the situations where type inheritance can be inappropriate or, at least, subject to reevaluation. More importantly, it brings an attention to the distinction between the mechanics and the semantics of inheritance. The article closes with an example that illustrates the use of inheritance in light of other alternatives. Finally, the article briefly discusses the implications.