Crell,
@Crell@phpc.social avatar

Training exercise:

Try to replace all $foo->isBeep()/$foo->canBar() etc. calls with an instanceof check. $foo instanceof Beepable, $foo instanceof Bars, etc.

What does that do to your data model? If you leverage parameter types instead of manual instanceof checks, how does that simplify your logic flow?

I don't expect it to work for every use case, especially in PHP, but it would be a valuable exercise to try.

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