Embrace Language Idioms

July 12, 2018

Embrace the idioms of your language and tools. Write Swifty code with Swift, ObjC-like code with ObjC, Pythonic Python, idiomatic C++. Use git like git, not like Subversion.

If you are multilingual (both human and computer languages), you’ll often find yourself reaching for an elegant concept from another language which is not found in the language you’re using. You might be tempted to implement a solution using that concept, transliterated into the language you’re working with; but that would be as silly as transliterating a Chinese phrase directly into English, and expecting your listeners to have no difficulty understanding you.

For programmers, the recipients of your communication are the future maintainers of your code. Writing in a language’s native idioms makes it easy for them to understand and update your code.