Abstracting to Service Classes for Cleanliness and Reusability

As a Junior Engineer at Zaengle, I’ve learned that writing good clean code is one of the most important aspects of being a developer. There are many places in code where logic can get out of hand quickly. One such place is in the controllers. We sometimes think that the controller is simply a place to dump any logic we don’t quite know what to do with.

Continue Reading
Written By Logan Fox
Posted on

Refactoring Techniques: Extract Method

The Extract Method is probably a technique you use on a daily basis; if not, it should be. It really isn’t any more complicated than the title would suggest. It’s looking through a method and determining what lines of code could easily be grouped together into another function.

Continue Reading
Written By Jesse Schutt
Posted on

Replace Conditional with Polymorphism

If you've ever done any research into refactoring, or programming in general, you've most likely heard the term "polymorphism". When I first came across it, I have to admit, I was intimidated. Now that I've become more familiar with the concept, I can assure you, the word itself is more complicated than the underlying principle!

Continue Reading
Written By Jesse Schutt
Posted on

Simplifying Conditional Expressions

As I’ve been reading through Refactoring by Martin Fowler, I’ve found it helpful to rewrite some of the examples from the book in PHP in order to cement the concepts into my mind. While Martin’s examples are primarily in Java, I’ve found an overwhelming majority of the concepts apply to PHP, which is where I spend most of my programming time.

Continue Reading
Written By Jesse Schutt
Posted on