John Cox

Blogs · @wyome

Tagged coding · everything

Maximizing the value of your Claude Code sessions | Claude by Anthropic

Claude Code charges per token used in a session, with input tokens costing less than output tokens and cached tokens costing far less than fresh ones—meaning the same task can cost different amounts depending how you run it. The post explains that token costs multiply based on model size and effort level, then get amplified by prompt caching behavior: every turn resends the entire conversation history (cheaply, from cache) plus whatever is new, so keeping conversations focused and clearing between unrelated tasks saves money by preventing irrelevant context from accumulating. Practical tactics like @-mentioning files, using /clear and /compact strategically, and suppressing verbose command output all reduce what stays in the context window, which compounds savings across multiple turns.

Permalink

10+ JavaScript Shorthand Coding Techniques | jQuery4u

This comprehensive guide collects 19+ JavaScript shorthand techniques designed to reduce code verbosity and improve coding efficiency, presenting each technique with both longhand and shorthand examples. The shortcuts covered range from ternary operators and null-checking with logical OR to object literal notation, assignment operators, RegExp shortcuts, and alternative approaches to switch statements using lookup tables. The post serves as a practical reference for developers seeking to write more concise, readable JavaScript while maintaining functionality.

Permalink

Mensch -- A coding font

Apple's Snow Leopard introduced Menlo, a modified version of the Linux font DejaVu Sans Mono, as its new monospace typeface. The author, dissatisfied with several design choices in Menlo (particularly the slashed zero and the oddly-proportioned lowercase L), used FontForge to create a custom variant called "Mensch" with about a dozen tweaks including a circular zero, friendlier punctuation marks, larger angle brackets, and improved letter distinctiveness. The modifications maintain the open-source spirit of the original Bitstream Vera license while optimizing the font for code readability and aesthetic preference.

Permalink