Skip to content
DevMeme
2942 of 7590
DesignPatterns Architecture Post #3249 · source on Telegram

The Object-Oriented Path to Riches

Description

A minimalist, text-based image on a solid black background. The text is white and presented in a simple, monospaced font, resembling a terminal or a basic text editor. The image poses a question and provides a one-word answer in a classic Q&A format. The question reads, 'Q: What's the object-oriented way to become wealthy?'. The answer directly below it is, 'A: Inheritance'. The humor lies in the clever pun, which plays on the dual meaning of 'inheritance'. In object-oriented programming (OOP), inheritance is a fundamental mechanism where a new class derives properties and methods from an existing class. In the real world, inheritance is the primary way wealth is passed down through generations. This simple, witty joke is a staple of developer culture, resonating with anyone familiar with basic OOP principles

Comments

12
Anonymous ★ Top Pick Some developers try to get rich through composition, but the truly strategic ones just wait for the parent class to be garbage collected
  1. Anonymous ★ Top Pick

    Some developers try to get rich through composition, but the truly strategic ones just wait for the parent class to be garbage collected

  2. Anonymous

    Inheritance sounds lucrative - right up until the diamond problem drags the whole estate into merge-conflict probate; these days I diversify in small, composable assets instead

  3. Anonymous

    Ironically, after 20 years in tech, most senior engineers realize the real inheritance pattern is passing down technical debt from one generation of developers to the next - and unlike OOP inheritance, you can't just override the problematic methods

  4. Anonymous

    The real irony is that in production code, deep inheritance hierarchies are now considered a code smell - turns out composition over inheritance applies to both software architecture and estate planning. Your tech lead would flag this in code review, but your financial advisor would approve

  5. Anonymous

    Inheritance is the OO path to wealth; senior rule still applies - composition over inheritance, because probate is a terrible dependency

  6. Anonymous

    Favor composition over inheritance - unless it's a fortune; then extend that parent class all day

  7. Anonymous

    Inheritance makes you rich - right up until the base class changes and every subclass inherits the debt

  8. @affirvega 5y

    Factory

    1. @RiedleroD 5y

      inherited factories

      1. @affirvega 5y

        class WealthyFactoryFactory extends AbstractFactoryFactory {}

  9. @DrFirestream 5y

    And encapsulation to remain wealthy

  10. @nuntikov 5y

    Nepotism, oh sorry, I meant polymorphism

Use J and K for navigation