Validating Models With Ruby

Most ORMs out there include model validations as part of the features they provide. I think that’s kind of cool and very useful, but sometimes it’s better to abstract that responsibility away from the model, especially in cases where validations are tightly tied to other factors or flows.

Continue reading...

Tired of conditionals? State pattern could help

When writing code, our classes often go through a series of transformations. What starts out as a simple class will grow as behavior is added. And if you didn’t take the necessary precautions, your code will become difficult to understand and maintain. Too often, the state of an object is kept by creating multiple boolean attributes and deciding how to behave based on the values. This can become cumbersome and difficult to maintain when the complexity of your class starts to increase.

Continue reading...

Is Swift production ready?

I began working on an iOS app called Healthy Baby at the end of 2014. At the time Swift 1.0 was already released and Apple was iterating on it rapidly, adding features and also changing the syntax of the language with each release of the SDK. It looked like the perfect time to start a new Swift project.

Continue reading...
Are you okay with optional cookies?
By clicking "Accept", you agree to the storing of cookies on your device to enhance site navigation, analyze site usage, and assist in our marketing efforts. View our Privacy Policy for more information.