2014 Retrospective: A Year Of Lotus

This has been a great year for Lotus. At the beginning of 2014 I decided to open source this less invasive and simple framework for Rack. Back in the day, it was just a software stored in my hard drive. An experiment that turned to be a fresh take for web development with Ruby. It had in it the seminal work of what is Lotus today, but it required patience for its blossoming. »

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. »