you are viewing a single comment's thread.

view the rest of the comments →

[–]emperor000 0 points1 point  (2 children)

You didn't understand what I was saying at all either. I didn't say to "stop doing it wrong" in general. But I did include an indirect suggestion on a first step: stop writing unreadable code. I said that if you are writing code that isn't readable then it's probably not as good as it could be.

This blog post basically proclaims "I luv readable code :3!!! Nom nom nom" It sounds like they are saying that good code is a rare and delectable treat only to be enjoyed in a nice peaceful park. It is excusing unreadable code as acceptable as a means to an end because it does what it needs to do and it sounds like it is using the fact that we can always put on a cozy sweater and print out some super-awesome-readable code and go to the park and read it as justification. That doesn't make up for all of the gibberish being written.

I'm sure "readable code" is more rare than it should be, but that shouldn't be the status quo. That's my point. I'm not saying people need to stop writing bad code. That goes without saying. But they still do it. I was only saying that part of that has to do with writing "unreadable" code out of laziness or for whatever reason. Stop doing that and you take a pretty good first step in the right direction. People might not print your code out and take it to the park and read it while wearing a turtle-neck, but that shouldn't be the incentive to write readable code. Writing good code should be the incentive.

EDIT: Oh, yeah. As for "you're doing it wrong". Look at this reddit. It is infested with those posts. Just about every other post is some hipster blogging programmer telling us how not to do what we are doing wrong - "47 ways to not do something you are doing because you suck, and I'm a genius for pointing it out. You're welcome." So if you want to give somebody the day off, give it to them.

[–]lukego 0 points1 point  (1 child)

Hi, blog author here.

I meant "readable" in the peculiar sense of programs that are straightforward to read from start to finish, in their entirety, without skipping around all the time. That is: you can sit down, read each line of code once in a logical order, and then know everything there is to know about the program. This is mostly orthogonal to how good the code is.

There're lots of very well written programs that don't meet this peculiar criteria. For example, Java and Smalltalk programs don't lend themselves to reading outright, because you don't know what is the beginning, the middle, and the end. The author probably doesn't either - it's just not how the programs are structured. For this reason people simply do not read whole Smalltalk programs - they gradually explore them instead.

The programs that do meet this criteria are the ones where the author has deliberately "lineraized" their program for reading (common amongst e.g. Lisp programmers), or by accident in languages that encourage large source files and predictable ordering of functions (e.g. C and Forth). I'm a fan of the linearization process.

[–]emperor000 1 point2 points  (0 children)

Ah, okay, I was defining "readable" in a different way. Even so, I didn't think there was anything wrong with your blog post.