Software Writer

striving to write software, well

class_eval vs. instance_eval in Ruby

January 15, 2022

This post explains the difference between class_eval and instance_eval methods in Ruby. If you keep getting confused between them when reading or writing Ruby code, it should clarify things a little.

Read more

Ask Your Developer

January 12, 2022

Last year, when I was building Virtual Inspections, a product that lets city inspectors have virtual meetings with inspectors in the field using Twilio Video, I read Jeff Lawson’s book Ask Your Developer. Jeff is the CEO of Twilio, a company I love and admire. Their communication APIs have enabled so many developers to build amazing applications and businesses. So when Jeff wrote this book, I immediately bought it and devoured it in a few days.

Read more

A Brief Introduction to Hotwire

January 3, 2022

This post introduces Hotwire, the suite of front-end frameworks shipped with Rails 7. It starts with a brief overview of the existing approaches to building web applications, introduces Hotwire, and wraps up with a short description of the different sub-frameworks that make Hotwire. We’ll also see how these frameworks fit together to provide a cohesive solution for the front-end ecosystem.

Read more

Refactoring UI

December 24, 2021

I started reading the Refactoring UI book by Adam Wathan, the creator of Tailwind UI. I have hardly read like 20% of the book, and already my notes and highlights have started overflowing. It’s packed full of user-interface design wisdom, and if you are a designer, it’s a must-read. Here’re my notes so far, I will update them as I continue reading.

Read more

How Rails Concerns Work and How to Use Them

December 19, 2021

Many Rails applications, including the framework itself, make heavy use of concerns. However, if you are just getting into Rails, concerns can be confusing to understand. Why do we need them, how do they work, and when do we use (or not use) them? When I started learning Rails a few months ago, concerns were one of the topics that took a long time for me to understand.

Read more

How to Setup Tailwind 3 on Rails

December 13, 2021

Even though the official Tailwind documentation has installation instructions for various client-side frameworks, it is missing one for Rails. Most of the tutorials work with the older versions of Tailwind. With version 3 released a few days ago, I thought it’d be nice to have an up-to-date guide for Rails developers trying to set Tailwind 3 on a Rails app, so here it goes.

Read more

Tailwind CSS

December 12, 2021

I’ve been hearing about Tailwind CSS in the developer circles for quite some time now. However, my first few attempts to learn Tailwind failed as I always balked after seeing the cryptic class names and the resulting HTML. Here is an example that shows the contrast between the two approaches.

Read more

All the Database Tasks in Rails

December 8, 2021

Once you start programming in Rails, you inevitably come across db:migrate, which applies the migration to your database. Then you make a mistake and learn about db:rollback to revert the previous migration.

Read more