sarah,
@sarah@phpc.social avatar

I strongly prefer composition over inheritance.

If you can compose objects of other objects and use interfaces over concretions, you make it much easier to modify your app in future.

Ultimately the time you take to design your app will be spent now (in design) or later (in maintenance). Since most apps spend most of their life in maintenance, don’t make the mistake of saving time now and spending it later.

afilina,
@afilina@phpc.social avatar

@sarah I don't think I used inheritance anywhere other than PHPUnit's TestCase in the last few years. I wish we could have a way to write tests without extending.

  • All
  • Subscribed
  • Moderated
  • Favorites
  • php
  • Durango
  • DreamBathrooms
  • thenastyranch
  • magazineikmin
  • tacticalgear
  • khanakhh
  • Youngstown
  • mdbf
  • slotface
  • rosin
  • everett
  • ngwrru68w68
  • kavyap
  • InstantRegret
  • megavids
  • cubers
  • GTA5RPClips
  • cisconetworking
  • ethstaker
  • osvaldo12
  • modclub
  • normalnudes
  • provamag3
  • tester
  • anitta
  • Leos
  • JUstTest
  • lostlight
  • All magazines