Refactoring Loops and Conditionals

Earlier this week, a developer asked the Rails subreddit to help refactor some code they had written for an interview.

It was a nice and small little problem so I ported the original solution to PHP and took a stab at refactoring it in screencast format.

Check it out and let me know what you think!

Refactoring-to-collections

Enjoyed the post?

I recently released a full book and video course covering other refactorings you can do with collections.

If you'd like to check out a chapter sample, subscribe below and I'll email it to you!

Powered by ConvertKit