So I lean back all relaxed and sh*t, refurbishing my design patterns knowledge, everything going fine and dandy, as I wait for the weekend adrenaline to kick in. My life couldn't get any smoother. Next thing you know... I get the biggest realization of my life day.
Why do we need Iterator Pattern? Or better phrased as
Do we even need Iterator Pattern in today's age?
Since I'm a native PHP
speaker. No-brainer, I was going through this official DOC.
So through various Rube Goldberg-ish examples the documentation goes on to create various objects, only to eventually iterate over them using foreach()
or a while()
so my question is where in the grand scheme of things does this pattern fit in, or as always ....
Am I missing something?
Aucun commentaire:
Enregistrer un commentaire