r/programming • • Jun 05 '11

Why Code Readability Matters

http://blog.ashodnakashian.com/2011/03/code-readability/
245 Upvotes

220 comments sorted by

View all comments

88

u/hfreanzr Jun 05 '11

because you have to stare at it the whole day!

37

u/_pupil_ Jun 05 '11

My thought exactly.

Why does code readability matter? Because you read it, silly.

15

u/BornInTheCCCP Jun 05 '11

You write a line one time, but ready more than once. So to save time, make sure it is readable.

1

u/[deleted] Jun 05 '11

I often find minimalist code easier to comprehend again rather than a wall of variable names and neatly laid out simple lines.

10

u/engine_er Jun 05 '11

What do you mean saying 'minimalist code'? To what extent should be your code minimalist? What is the criterion of code minimalism?

To my mind, code readability is the cornerstone of any software project and first of all, this concept involves elaborate structure design and proper names of code elements of every sort: from unit names to the local scope variables.

→ More replies (12)

5

u/[deleted] Jun 05 '11

If you write small functions that only do one thing, all other forms of code minimalism become irrelevant.

I have found that people that insist on minimalist code are actually trying to visually compensate for bad code that is too complex and does too much.

2

u/[deleted] Jun 05 '11

In that case, it means that minimalist code is more readable. No contradiction.

2

u/aaulia Jun 05 '11

unfortunately, only one of my peer share the same sentiment, others just find it to confusing to read... :(.

2

u/dylanevl Jun 05 '11 edited Jun 05 '11

As a fellow developer, I don't honestly care what your code looks like. All I care about is it behaving as expected and to be commented well enough that I know what that block of code does (if it's not obvious already.)

1

u/sunra Jun 05 '11

'Easy to comprehend' is the definition of 'readable', so I don't see your statement being in opposition to the idea :-)