Caveman
link
fedilink
105M

Using classes is nice tbh. Using inheritance usually isn’t. Inheriting from inherited class should be forbidden.

Inheriting from inherited class should be forbidden.

so an interface with state?

Caveman
link
fedilink
15M

Those are nice. Services that manage data are an example. Having the class also declare how to interact with the data is nice.

My most OOP pattern I like using is implementing an interface with an abstract class for “standard” implementation. Then implement abstract methods for a concrete thing.

Create a post

Post funny things about programming here! (Or just rant about your favourite programming language.)

Rules:

  • Posts must be relevant to programming, programmers, or computer science.
  • No NSFW content.
  • Jokes must be in good taste. No hate speech, bigotry, etc.
  • 1 user online
  • 64 users / day
  • 250 users / week
  • 420 users / month
  • 2.88K users / 6 months
  • 1 subscriber
  • 1.53K Posts
  • 33.9K Comments
  • Modlog