FirstDEV blog

⚞ Well, Blog First!

  • Home
  • Ruby
  • Ruby On Rails
  • Tips
  • Solutions
  • About
Subscribe
Rails

Turbo Native — Wrapping Your Rails App in an iOS and Android Shell

A native app is three codebases: the web app, the iOS app, and the Android app, each reimplementing the same screens and drifting apart. Turbo Native takes a different position — your Rails

Rajan Bhattarai Rajan Bhattarai 11 min read
Developer tips

Writing Changelogs That Developers Actually Read

Most changelogs are a dump of commit subjects. “Merge pull request #412 from feature/fix-thing”, “wip”, “address review comments”. Nobody reads them, so nobody maintains them, so they get worse — and the one

Rajan Bhattarai Rajan Bhattarai 11 min read
Ruby 3

Frozen String Literals in Production — Real Wins and the Gotchas Nobody Mentions

The # frozen_string_literal: true magic comment sits at the top of nearly every file in a modern Ruby codebase, added by RuboCop, accepted without much thought. It’s a genuine optimization — measurably fewer

Rajan Bhattarai Rajan Bhattarai 11 min read
Developer tips

The Pull Request Description Nobody Writes (But Everyone Needs to Read)

Most pull request descriptions say some version of “fixes the bug.” The diff is four hundred lines across eleven files. Your reviewer opens it, has no idea what problem you were solving or

Rajan Bhattarai Rajan Bhattarai 11 min read
Rails

counter_cache and touch — Derived Data in Rails Without the Extra Query

An index page listing fifty posts, each showing a comment count, issues fifty-one queries. The fix is well known — counter_cache — and it’s usually applied incorrectly, either by forgetting the backfill, by

Rajan Bhattarai Rajan Bhattarai 11 min read
Developer tips

Async Code Review — How to Collaborate Without Blocking Each Other

You open a PR at 4pm Kathmandu time. Your reviewer is asleep in Lisbon. They review at 9am theirs, leave four questions, and go into meetings. You answer at 6pm yours. They respond

Rajan Bhattarai Rajan Bhattarai 11 min read
Ruby 3

Ruby's Object Model — Eigenclasses, Method Lookup, and What super Really Does

You can write Ruby for years without knowing what an eigenclass is. Then one day a gem defines a method you can’t find with grep, super calls something you didn’t expect, and define_method

Rajan Bhattarai Rajan Bhattarai 11 min read
Rails

ActiveRecord::Store — Structured Data in One Column Without a Migration Per Field

Some data doesn’t deserve a column. User interface preferences, per-account feature toggles, the last three filters someone applied to a report — attributes that are read constantly, queried almost never, and change shape

Rajan Bhattarai Rajan Bhattarai 10 min read
Developer tips

Environment Variables Done Right — dotenv Patterns and Production Pitfalls

ENV["STRIPE_KEY"] returns nil in production and the app boots anyway, quietly using no key, until the first payment fails four hours later. Environment variables are the simplest configuration mechanism available and the one

Rajan Bhattarai Rajan Bhattarai 10 min read
Developer tips

Reading a Stack Trace Like a Senior Engineer

A junior developer sees a stack trace and copies the top line into Google. A senior developer sees the same trace and knows within fifteen seconds which of their own files to open.

Rajan Bhattarai Rajan Bhattarai 10 min read
Ruby 3

Memoization at Depth — Where ||= Works, Where It Quietly Breaks

@value ||= expensive_call is the first optimization most Ruby developers learn and the one they keep using long after it stops being correct. It works beautifully for a non-nil, non-false result computed from

Rajan Bhattarai Rajan Bhattarai 11 min read
Rails

Background Job Architecture — Retries, Dead Queues, and Idempotency in ActiveJob

ChargeCustomerJob.perform_later(order) looks like a function call and behaves like a distributed system. It runs on another machine, at an unknown time, possibly more than once, possibly never. Most job bugs come from writing

Rajan Bhattarai Rajan Bhattarai 11 min read
Developer tips

Load Testing Locally With wrk — Know Your App's Ceiling Before Deploy

“It’s fast enough” is a claim about a single request from one browser on a warm cache. It says nothing about what happens at fifty concurrent users, which is the number that actually

Rajan Bhattarai Rajan Bhattarai 10 min read
Rails

Strict Loading in Rails — Eliminating N+1 at the Framework Level

Every Rails team has the same conversation eventually. Someone adds bullet to the Gemfile, fixes the twelve N+1 queries it finds, and six weeks later there are eight new ones. Detection tools tell

Rajan Bhattarai Rajan Bhattarai 9 min read
Developer tips

Git Bisect — Find the Regression-Introducing Commit in Under 10 Minutes

Something worked last month. It doesn’t work now. Between then and now there are four hundred commits, three of them yours, and nobody remembers touching that code. The instinct is to start reading

Rajan Bhattarai Rajan Bhattarai 10 min read
« Newer Posts Page 3 of 10 Older Posts »
FirstDEV blog © 2026
Proudly published with Jekyll & using Jasper2
Latest Posts Twitter
FirstDEV blog

Check viewARU - Brand Newsletter!

Newsletter to DEVs by DEVs - boost your Personal Brand & career! 🚀