Code quality and design

67 posts
Avoiding Conditionals, an example

Avoiding Conditionals, an example

I didn’t like the code I wrote for a particular feature. It was “notify users when someone comments in a discussion” with these requirements: * Notify discussion author, if not the comment creator * Notify users assigned to the parent model that is associated with the discussion, except: * the discussion author...

Commands, events, global functions and testing

Commands, events, global functions and testing

The other day I was listening to the FullStackRadio episode 34 which is about dealing with dependencies in Active Record models. This is a very interesting topic and they suggest a few solutions for it. I liked the suggestions and I tried to implement it differently (first try and second...

*AwareInterfaces: simple interfaces with getter and setter

*AwareInterfaces: simple interfaces with getter and setter

Sometimes you see simple interfaces with a getter and a setter for a specific type of object. Some examples are league/event‘s EmitterAwareInterface and league/container‘s ImmutableContainerAwareInterface. Also Zend Framework 2 has a ton of *AwareInterfaces like (but not limited to) these: These packages often come with a...

Why You Should Avoid Over-Abstracting

Why You Should Avoid Over-Abstracting

Some time ago I started working on an existing project, so I read the documentation before diving in. At the top of the contributing.md file there was this sentence: “Abstract when possible”. Quickly I learned the project contained more abstract classes than a normal project. This leads to too...

You’ve successfully subscribed to madewithlove
Welcome back! You’ve successfully signed in.
Great! You’ve successfully signed up.
Success! Your email is updated.
Your link has expired
Success! Check your email for magic link to sign-in.