• 0 Posts
  • 8 Comments
Joined 2 months ago
cake
Cake day: December 11th, 2025

help-circle
  • Only if you’re going by the strict UML definition of composition, which doesn’t really apply here, since the industry has moved on a bit since UML was king.

    Either way, you can use DI to do composition in the strictest UML way, provided every single dependency is transient and creates a new instance every single time. Even then though, when most devs talk about composition, they aren’t referring to the strict UML definition.


  • If you’ve used Dependency Injection before, you’ve used the principle of composition over inheritance. So, if you’ve ever used .Net (C#), Spring Boot (Java) or Laravel (PHP), you’ve likely used it. Modern C++ also has the DI pattern.

    Rust and Go force you to use composition and don’t support inheritance at all, so if you’ve used either of those languages, you’ve followed the practice, though Go doesn’t support DI out of the box. Functional languages like Haskell also use composition over inheritance.





  • “passive consumers of unthought thoughts” is an apt way of putting it. With AI, it’s so easy not to think and have it think for you, even in things that you should really want to think about because it’s entertaining.

    For example, I’ve been re-watching Game of Thrones, and I wondered how things would have changed if Joffrey had a father figure in his life that wasn’t Robert, say a teacher in swordsmanship. I could spend a lot of time thinking about how Cersei would see this teacher as a rival and want him dead, whether Robert would protect that teacher because he’s making Joffrey into more of a ‘man’, whether Joffrey being trained as a swordsman would make him braver, and even if everything happened as written up to the Blackwater, would Joffrey find his courage and go out into battle, and ultimately get killed by one of Stannis’ soldiers? What would happen to Sansa?

    Or… I could just ask ChatGPT, get a quick answer, and forget all about it.