Introducing Lotus::Validations

Data validation is an important piece in software architecture. It guarantees that the successive layers will operate on correct input. In the existing Ruby frameworks we’re used to see this responsibility flatten down into models. The problem with this approach is that we end to mix a lot of validations for different use cases in a single place. When the application grows in complexity, we add new validations. If often happens that some rules are incompatible with others, then we introduce nasty conditionals to trigger only a subset of them. »

Meaningful Exceptions

Writing detailed API documentation helps to improve software design. We already know that explaining a concept to someone leads us to a better grasp. This is true for our code too. This translation process to a natural language forces us to think about a method from the outside perspective. We describe the intent, the input, the output and how it reacts under unexpected conditions. Put it in black and white and you will find something to refine. »

Introducing Lotus

A year and a half ago I felt frustrated by the state of the art of web development with Ruby. Secretly, in my spare time, I started hacking with new ideas, taking nothing for granted, destroying and starting from scratch several times, until the software was distilled in a beautiful API. It took me a decade to get here, by following a process of subtraction of what isn’t essential. Countless refinements to achieve modularity, to balance elegance with performance, and convenience with solid design. »

Three Things To Know About Composition

A few days ago Aaron Patterson wrote a in interesting article about composition vs inheritance with Ruby. He says that when inheriting our classes directly from Ruby’s core objects such as Array, our public API for that object will become too large and difficult to maintain. Consider a powerful object like String which has 164 public methods, once our library will be released, we should maintain all that amount of code. »

Rails Is Not Dead

A few years ago, my lead develop of the time, told me: “Beware of the coupling that you’re introducing in your models”. My answer was: “Hey, you don’t know what you’re talking about, this is ActiveRecord”. I was an unexperienced developer fascinated by the innovation that Rails introduced. After all, my technology was able to get rid of all that configurations, and all that boring stuff from the past. We all have been there. »