Live data from Hacker News

What does code readability mean?

typicalprogrammer.com

131–134 of 134 posts

Re: What does code readability mean?

#131
post #47
post #34

Earlier quoted context omitted.

That is a strange and "unnatural" (for me) use of the word "complicated". Cynefin[1] defines 'complicated' as "known unknows" and 'complex' as 'unknown unknowns'. The idea is that complicated things are non-obvious, but they are understandable (with expertise, you get the relationship between cause and effect). With complex, full cause & effect cannot be known apriori, it's just observable after the fact. That somewh…

I'd say don't try to use Cynefin's definition to understand what the PEP authors means. (Un)known unknowns is a pretty terrible definition of those words, it doesn't really match the common definitions at all. Complex and complicated are, according to the dictionary, basically synonymous, and they mean something intricate or tricky that is composed of many interconnected parts. I think the PEP authors were trying to…

In a uni course a while back they did define complex as something that can't be understood, and complicated as something that is understandable but hard.

So I agree with the above poster that the PEP makes no sense here.

Re: What does code readability mean?

#132
post #116

Earlier quoted context omitted.

In your first example, both are exceptional, so really "which is better" is irrelevant. In the second, the difference is so big that it's obvious for anyone which is better, but that still doesn't make it useful for getting better at painting. "Paint more like a Van Gogh and less like a kindergarten kid" is not useful advice. People do have art critics and manuals that attempt to write down exactly what made Van Gogh…

Maybe I read too much into your original comment, but it reminded me of a pitfall that I see too many engineering types fall into, namely that because something can't be formalized then it must be arbitrary, unimportant, or both. In particular, this seems like a counterproductive way to frame the issue: > If I have no objective criteria, then it must be subjective, and then all that "simple" means is that "this is ea…

> There is no objective definition of simple.

Oh, I agree with that. What I meant was that "this doesn't mean there can't be objective criteria about what is simple and what is not; or that it's futile to attempt objective definitions of 'this is simple/this is not' ".

"Easiest for me right now", in my experience, only leads to simplicity in trivial cases. Simplicity requires intense thought & explorations, it's never easy (except, again, in trivial circumstances).

Re: What does code readability mean?

#133
post #130

Earlier quoted context omitted.

> would you say TDD (or any other requirements-driven design process) would avoid that kind of oversimplification? I haven't thought too much about how such things relate, but my first thought is that TDD seems biased towards oversimplification, since we do 'the simplest thing which makes the tests pass'. If we're testing that Bob's user profile shows the name "Bob", then the simplest thing is to have all profiles ha…

TDD should give you the simplest solution conforming to your spec (your tests). So it's all the necessary complexity without any unnecessary complexity to fulfill your testsuite, and ease of refactoring in case you need to change something more fundamental about your code. At some point you need to specify which edge cases you need.

> it's all the necessary complexity without any unnecessary complexity to fulfill your testsuite

As I said, it doesn't solve the problem of overcomplication/simplification, it just shifts the burden on to the test suite instead of the program.

Re: What does code readability mean?

#134
post #131
post #47

Earlier quoted context omitted.

I'd say don't try to use Cynefin's definition to understand what the PEP authors means. (Un)known unknowns is a pretty terrible definition of those words, it doesn't really match the common definitions at all. Complex and complicated are, according to the dictionary, basically synonymous, and they mean something intricate or tricky that is composed of many interconnected parts. I think the PEP authors were trying to…

In a uni course a while back they did define complex as something that can't be understood, and complicated as something that is understandable but hard. So I agree with the above poster that the PEP makes no sense here.

Complex does not mean something that can't be understood. Like Cynefin, your uni course might also using bad definitions, if they meant those definitions for the general context. If they were giving you domain specific definitions, like in a math course or something, then your applying it to this situation might be your misunderstanding. We have dictionaries for just this purpose, so that we all agree what words mean. Words also have multiple meanings, so while it may be true that what the PEP authors said makes no sense to you, it's best if we avoid egg on our faces by calling someone else wrong if the problem is that we didn't take the time to understand what they meant, or assumed incorrectly that our understanding is the only one possible.

The common definitions of complex and complicated are that they're synonymous, there is no strong or fundamental distinction between them in the way you're trying to suggest. That's the main problem with the PEP statement. Trying to assert there's a difference is likely to result in miscommunication, this uni course and the PEP authors are both making the same mistake.

adjective 1. composed of elaborately interconnected parts; complex: complicated apparatus for measuring brain functions.

http://www.dictionary.com/browse/complicated

https://en.m.wiktionary.org/wiki/complex

https://en.m.wiktionary.org/wiki/complicated

https://www.merriam-webster.com/dictionary/complex

https://www.merriam-webster.com/dictionary/complicated

https://dictionary.cambridge.org/us/dictionary/english/compl...

https://dictionary.cambridge.org/us/dictionary/english/compl...

Post reply on HN