Little Snippets
summary
Real examples from Ruby and ActiveRecord show concrete swaps that save time or bugs: use sort...last → max instead of sorting, prefer String#include and Regexp#match (the latter is about 2–3x faster and has no regex side‑effects) instead of =~, use \A and \z for exact anchors (not ^/$), prefer require_relative over File.expand_path, use $stdout not STDOUT for testable output, remove redundant self, name units like threshold_in_seconds, and favor concise, specific APIs for clearer intent and better performance.
AI-written summary · about
chapters (8)
- 0:00Introduction and personal story
- 7:49Opinions and subjectivity in code
- 13:57Writing concise code
- 25:57Writing readable code
- 35:50Ordering code naturally
- 43:45Being precise and accurate
- 55:03Code style and consistency
- 1:00:05Q&A on hash literals








