In PHP the implementation of collections is quite popular now. This makes map and reduce a breeze. It also makes it more readable.
However I am curious to know why not many people know about and have implemented a Duff’s Device.
This is probably the most optimized way of iteration over items. My take is because it is less readable or understandable.
I have implemented this approach both in JavaScript and PHP. And it is quite faster than normal iterations. I think it can be implemented in any language that supports a while loop.
However only use it where optimizations are needed.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
In PHP the implementation of collections is quite popular now. This makes map and reduce a breeze. It also makes it more readable.
However I am curious to know why not many people know about and have implemented a Duff’s Device.
This is probably the most optimized way of iteration over items. My take is because it is less readable or understandable.
I have implemented this approach both in JavaScript and PHP. And it is quite faster than normal iterations. I think it can be implemented in any language that supports a while loop.
However only use it where optimizations are needed.