Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Theere are two quite a widespread classes of not readable code:

Some code is not readable by _anyone_. That's not readable code.

Some code is readable by its author only (be it AI or a human). That's also not readable one.

Saying readability is not a concept is really strange.



Readability to a certain degree is heavily influenced to the reader's experience and familiarity.

If somebody has spent lots of time in specific patterns he/she'll find them natural to read and mentally process.

To others, they'll be unreadable.


I'll have to disagree.

Developers coming from functional programming and developers coming from C programming, for instance, have very different definitions of "readable", and neither is obviously wrong.

Similarly, developers used to channel-based, async-based or mutex-based concurrent programming will all have very different criteria for "readable" code, again none of them obviously wrong.


Those are just paradigms, ways of solving problems. There’s a difference between familiarity and readability. Sometimes you have to learn stuff before understanding them. Readability is how easy it is to do that, given familiarity with the base concepts that the code use.


You are correct.

Yet it's pretty easy to find people who consider that `map()` or `filter()` are simply not readable – or, on the other side of the aisle, that having a loop variable is detrimental to readability.

And of course, these criteria change with time, industry and programming language used.


I have a formal proof for you that it is a non-concept. If code can be read and interpreted by a computer, it means it can in principle be read by a human. There are of course some edge cases like obfuscated JavaScript or binary executable that some people are able to read and understand.

The question comes down to being reasonably readable and we are back to square one: "reasonable" is very relative. In my early days I could read 8086 binary code (in hex) and understand what it does, it was literally at the very edge of readability but it wasn't unreadable.


You are using a different definition of readable than most people are. Most people are using it to mean "the target audience can read and understand the code, and do so in a way/context that allows them work with it". Your definition seems to be "can read the symbols on the screen".

I can read Assembly. I can, in some cases, figure out what that Assembly is doing. I can not, however, work productively with it. I can read Assembly but would not consider it readable.


Sure, but we do agree that Hello World is MORE¹ readable in Python compared to the equivalent program in say Brainfuck?

  print("Hello World")  
  
vs

  ++++++++[>++++[>++>+++>+++>+<<<<-]>+>+>->>+[<]<-]>>.>---.+++++++..+++.>>.<-.<.+++.------.--------.>>+.>++.  
  
¹: more readable means easier/faster to read for most human beings that know the language


I can't reasonably read whether this comment agrees or disagrees with the parent




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: