Write Idiomatic Code - Deepstash

Explore the World's Best Ideas

Join today and uncover 100+ curated journeys from 50+ topics. Unlock access to our mobile app with extensive features.

Idiomatic code

Idiomatic code

Idiomatic refers to the most common way to write something in a language. Writing idiomatic code means following the conventions of the language, and solving problems the way they are meant to be solved in that language, not by porting programming patterns from other languages.

Idioms vary widely across languages.

6

102 reads

Benefits of idiomatic code

Benefits of idiomatic code

Learning and internalizing the idioms of a language greatly improves your reading abilities. You are able to focus on understanding what the code does instead of wondering why the code is written in an awkward way.

Projects that use idiomatic code benefit from:

  • Higher maintainability - Idiomatic code is clear, maintainable, and bug-free
  • Faster code reading & Lower cognitive load - People are no longer stopping at every line, trying to figure out what it does, while struggling to keep in mind what came before
  • Faster debugging - It's easier to spot bugs in idiomatic code

7

65 reads

Use the standard library

Use the standard library

Writing idiomatic code implies relying on the standard library to solve problems, and not reimplementing functionality that is already maintained by core developers.

This has two main benefits:

  1. Others will find it easier to read and maintain your code because you use packages familiar to them
  2. You save time by not having to implement functionality from scratch

7

53 reads

CURATED BY

ocpodariu

Alt account of @ocp. I use it to stash ideas about software engineering

CURATOR'S NOTE

šŸ“– Writing Idiomatic Python

ā€œ

Read & Learn

20x Faster

without
deepstash

with
deepstash

with

deepstash

Access to 200,000+ ideas

ā€”

Access to the mobile app

ā€”

Unlimited idea saving & library

ā€”

ā€”

Unlimited history

ā€”

ā€”

Unlimited listening to ideas

ā€”

ā€”

Downloading & offline access

ā€”

ā€”

Personalized recommendations

ā€”

ā€”

Supercharge your mind with one idea per day

Enter your email and spend 1 minute every day to learn something new.

Email

I agree to receive email updates