hn.today

Small Programming Tricks

will-keleher.com259 points145 comments
Screenshot of Small Programming Tricks

This collects a variety of small, practical programming tricks and explains how each one saves time with minimal mental overhead. Concrete examples include improving shell history search with fzf, atuin, and per-directory-history; SQL conveniences like SELECT without FROM and using EXPLAIN ANALYZE for real query profiles; regex word-boundary \b; bucketing metrics with logarithms; modern JavaScript helpers such as Array.flatMap, Object.entries, and Promise.withResolvers; keeping Node.js connections warm via https.Agent to reduce latency; git techniques like git log -S (pickaxe) and git checkout - to return to the previous HEAD; using shell globs (with shopt -s globstar in bash) and ripgrep instead of find/grep; and enabling zsh autocompletion via FPATH and compinit. Each tip is presented as an immediately usable, low-friction improvement.

The central argument is that lots of engineering productivity comes from accumulating and sharing these small nuggets of knowledge, including company-specific rules of thumb (e.g., which data source to use for a given debugging problem or who knows a subsystem). Sharing one compact trick a day strikes the right balance between usefulness and information overload, often saving time for many people and sparking useful discussion among engineers.

Read on will-keleher.com145 comments on Hacker News

Summary generated by AI from the linked article. hn.today is not affiliated with Hacker News or Y Combinator.

More in Programming

The daily digest

Today's best Hacker News stories, summarized and screenshotted, one email a day.