logo
Kurashizu Blogwhere ideas flow
  • Home
  • News
  • Blog
  • About
  • Home
  • News
  • Blog
  • About

© 2026 Kurashizu. All rights reserved.

Admin·New Post·Service Status
Powered by Cloudflare·31.10.26
← Back to news

Small Programming Tricks

Original article
will-keleher.com|129 points|80 comments|by signa11|Sep 16, 2026

The Power of Small Programming Tricks

A significant portion of an engineer's daily productivity isn't derived from massive architectural shifts, but from small nuggets of knowledge. These are high-leverage bits of information—like knowing a specific language feature, understanding that a TCP lag is likely due to Nagle's algorithm (and thus requires TCP_NO_DELAY), remembering the exact git command to fix a mistake, or mastering a sed trick for file editing.

While it's obvious that all knowledge is built from smaller parts, some "nuggets" are uniquely valuable because they provide immediate utility without requiring a massive amount of supporting mental infrastructure.

Example: You don't need to be a Python expert to run python3 -m http.server to instantly host a directory; the effort is minimal, but the convenience is high.

🛠️ The Technical Toolkit

Below is a collection of these high-leverage tricks across different domains.

Terminal & Shell Optimization

The evolution of command history can drastically change your workflow:

  • Basic: Ctrl + r for searching history.
  • Better: Install fzf to turn Ctrl + r into a fuzzy search.
  • Best: Use atuin to replace your history with a searchable SQLite database.
  • Niche: per-directory-history allows you to toggle between global history and commands specific to your current folder.

Use standard grep →\rightarrow→ Use rg (ripgrep) for significantly faster searching.

FeatureCommand/ToolPurpose
Recursive Globs**/*.mdFind all Markdown files recursively
Bash Globbingshopt -s globstarEnables ** patterns in Bash
Git Pickaxegit log -S patternFind commits that added/removed a string
Git Move Searchgit log -G patternSimilar to -S, but includes line moves
Git Togglegit checkout -Switch back to the previous HEAD

Database & Regex

  • Query Tuning: Both MySQL and PostgreSQL offer EXPLAIN ANALYZE. Unlike a standard explain, this actually executes the query to provide real-world performance metrics.
  • Regex Boundaries: Use \b (the word boundary assertion) to precisely target the start or end of words.

JavaScript & Node.js

Modern JS has introduced several quality-of-life methods:

  • Array.flatMap
  • Object.entries
  • Promise.withResolvers

In Node.js, you can maintain persistent connections to external resources by utilizing an https.Agent: fetch(url, {method, agent})

When dealing with metrics, using logarithms helps visualize the distribution of values: bucket=log⁡10(value)\text{bucket} = \log_{10}(\text{value})bucket=log10​(value) const bucket = Math.log10(val); increment("my_metric", { bucket });

Zsh Configuration

To unlock advanced autocompletion in Zsh (especially when using Homebrew), you can add this to your config:

if type brew /dev/null; then 
    FPATH="$(brew --prefix)/share/zsh/site-functions:${FPATH}" 
fi 
autoload -Uz compinit 
compinit

Programming Productivity

🏢 Knowledge in the Workplace

In a corporate environment, these "nuggets" are often organizational rather than technical. They take the form of:

  • "To debug PROBLEM,lookatPROBLEM, look at PROBLEM,lookatDATA_SOURCE."
  • "PERSONistheexpertonPERSON is the expert on PERSONistheexpertonAREA; they are happy to help."
  • "The documentation for HARDTHINGislocatedHARD_THING is located HARDT​HINGislocatedOVER_HERE."

The "Trick a Day" Strategy

Inspired by the writing of Julia Evans, I previously implemented a system where I shared one technical or company-specific trick on Slack every day.

Why this works:

  • It avoids overwhelming the team.
  • Even if someone knows 90% of the tricks, the 10% they didn't know can save hours of work.
  • It encourages a culture of continuous, small-scale learning.

If you are a senior engineer, consider adopting this practice. As Julia Evans suggests, small bits of knowledge are powerful!