When writing object oriented code, a pretty useful technique is delegation–letting one object figure things out by sending messages to another object.

  • Solemarc@lemmy.world
    link
    fedilink
    arrow-up
    0
    ·
    1 month ago

    First of all, I don’t know what language this example is written in, but am I crazy for thinking that the bad imperative example is shorter and easier to read then the delegation?

    I would go a step further and say you don’t need a VideoService class, just make that a function