A System for Growth

Episode Summary

This week we talk about dealing with complicated models, organizing large codebases, and taming stylesheets.

Episode Notes

A weekly podcast about programming, development, and design through the lens of amazing books, chapter-by-chapter.

A System for Growth

Dealing with complicated models


"When you need to implement password recovery, and do not have a clear, single place to put the logic, it will still find its way into your code. It will spread itself across existing classes, usually making those classes harder to read and use.”

Example problem: Want to send a welcome email when a user is created via a public form but not when an admin creates a user via a backend interface

A home for interaction specific code

Core models should only have the absolute minimum to exist:

Core models should NOT have these things: (these things belong in multiple, interaction-specific form models)

Extracting service objects (lol)

Organizing large codebases with namespaces

class Invoice < ActiveRecord::Base
  has_many :items

class Item < ActiveRecord::Base

Why not just:

class Invoice::Item < ActiveRecord::Base

and move the file to: app/models/invoice/item.rb

Taming Stylesheets

The recommendations are a lot like BEM - A front-end development methodology - learn more at:

Abstracts (Sizing, Boarders, Spacing)Base (Grid, Colors, images, Typography)Components (Buttons, Cards, Alerts)Page Specific CSS