What's Idiomatic?

by · ·2 min read ·354 words

idiomatic (programming): Following the conventions of the language, or doing things in the common way for the language, rather than code that is ported from another language and therefore may not follow the common conventions.

— idiomatic, Wiktionary, licensed under CC BY-SA 4.0

A lot of solutions in software development are re-implementations of existing patterns. They don’t necessarily require a novel approach or even a lot of creativity. You can make the solutions novel and/or creative, but that can become a distraction from the root problem for you and for whoever ends up using your product down the line. When I’m creating UI (like nav bars, menu items), I want things in the place where I’d naturally expect them to be. Kind of like how I expect stairs to be a certain height, a fuel gauge to show me when something’s close to empty or a revolving door to move counter-clockwise.1 The same goes for things deeper in the stack, where the user may not see them, but where other humans or LLMs might expect them to be.

featured

"Desire path" by Metro Centric is licensed under CC BY 2.0 .

I find that Claude will quite happily come up with solutions to whatever problem I’m trying to solve without necessarily going with the obvious choice. I like to ask “what’s idiomatic?” as a way to reframe the problem and prioritize solutions. I’ve found over the past few months that this helps to generate predictable (boring?) solutions that are less likely to get in the way because they are somehow surprising. I like my software to be boring in the same way I like a visit to my auto mechanic to be boring. No surprises, please.

Related posts:


  1. “In right-hand traffic countries, revolving doors typically revolve counter-clockwise (as seen from above), allowing people to enter and exit only on the right side of the door. In left-hand traffic countries such as Australia and New Zealand, revolving doors revolve clockwise, but door rotations are mixed in Britain.” (Revolving door, Wikipedia, licensed under CC BY-SA 4.0) ↩︎