Lessons from Cat Island

Lessons from Cat Island

Fukashima Island, also known as Cat Island, is home to more cats than humans. NHK World (Japan) released a great documentary about the island and its inhabitants titled “Raising a Family on Cat Island“.

Centuries ago, this island was a bustling fishing village. Today, less than 20 people remain, and their numbers continue to dwindle each year because of emigration or old age. Due to the lack of children staying in the island, the schools already closed decades ago, and children have to go to the mainland by boat in order to continue their studies. Continue Reading

A Poor Man’s Guide to Handling Application Logic – Part 2

In Part 1 we created a simple library called KantanLogicthat we can use to manage application logic in lieu of other popular libraries. Our library has these main features:

  • Uses Success and Failure result objects for the class output
  • Handles error conditions gracefully
  • Has consistent behavior for the main class and all dependency classes

In our last example, we have a class called CreateAccount that creates a user account and sends a welcome email. When using KantanLogic, the service looks like this: Continue Reading

A Poor Man’s Guide to Handling Application Logic – Part 1

In the Ruby programming language, there are many libraries that can be used to manage business or application logic. Some of the popular ones are dry-rb (framework-agnostic) and ActiveInteraction (used within the Rails framework). The strengths and weaknesses of these libraries are explored in more detail on another article.

While these are great libraries to use and provide enormous benefits to your code architecture, some consideration is needed before using them: Continue Reading

Comparing ActiveInteraction and dry-monads

Rails is an awesome web application framework and it used by a lot of companies to ship features fast and iterate quickly. Developers also love the ecosystem and the stability that the framework offers. But it is not without its criticisms. One of them, which I experienced in my professional work as well, is its lack of direction on how to structure business logic.

The introduction of Concerns provided another layer where this logic can be extracted from models and controllers, but I think that this is still lacking, especially as the complexity of the application grows over time. Continue Reading

Life Problems and Money Problems

Life Problems and Money Problems

A common cause of relationship and family problems is money. Even if you get along well with others, friction can still exist if there is a financial aspect to an issue (more often due to lack of money). In fact, a lot of issues in the world are money problems.

But there are problems that are not about money. If you or a loved one got afflicted with a disease that has no cure, no amount of money can afford you the medicine, as it doesn’t exist (yet). Once you lose your family or friends, they cannot be brought back regardless of your wealth. If your relationship with someone reaches a breaking point, money alone cannot get it back to the way it were. Continue Reading