-1
$\begingroup$

Currently I'm writing my thesis and I made the assumption that all programming languages are made for humans and humans alone. There's no reason to make compromises to fit the machine needs. Developers should care about readability for humans, not for machines.

I don't want to discuss whether I'm right or not, because the main topic is about REST (just an architecture for web services) and not about programming languages.

Even though I would like to add a book reference for this assumption. I know that some blogs and articles agree with my opinion, but it's hard to find a serious source or even a book for this point.

All I found is:

"Underlying this fact is that all of these languages serve the same purpose: to turn human thoughts into the 1’s and 0’s that the computer understands."

To clearify, this is what I wrote exactly (translated to english):

Source code written by developers will only be read by humans. That's said it's clear that maintainabilty is directly related to readabilty. (talking about why refactoring is needed)

$\endgroup$
  • 2
    $\begingroup$ Welcome to Computer Science Stack Exchange. Please read cs.stackexchange.com/tour, if you have not yet done so. When posting a question, make sure to give enough context, and show how you tried to answer it on your own, so as to be very precise regarding your problem. This helps better answers. --- In this instance, what is REST, can you provide a link. $\endgroup$ – babou Aug 10 '15 at 13:27
  • $\begingroup$ @babou, thanks for your feedback. I just added it, even though the main topic has literally nothing to do with programming languages. That's why I didn't explain it (because it's no necessary for giving a book reference). $\endgroup$ – 0lli.rocks Aug 10 '15 at 13:32
  • $\begingroup$ You can probably find quotes of well known authors saying about anything, and the opposite too (maybe not the same person). I have seen some, but forgot where. However, "Syntactic sugar" conveys the idea that things remain essentially the same, but are simply a bit more readable. This is more or less the case with assembly. But you can hardly make such a statement for advanced programming languages that introduce sophisticated concepts that do not even exist at the harware level. I do not like too much the quote you have: languages are for expressing algorithms, compilers translate. $\endgroup$ – babou Aug 10 '15 at 13:40
  • $\begingroup$ Syntactic Sugar ? This is of course in jest. But maybe it says something. $\endgroup$ – babou Aug 10 '15 at 13:46
  • 1
    $\begingroup$ I find the question very odd. You state something which can hardly be true, refuse to discuss (though of course StackExchange is not a discussion forum) and then ask for a reference. Machine language, assembly language, and C, for instance, were designed trading-off between the human and the machine. In the first case, in favour of the machine, in the latter case more in favour of the programmer. Choices were made to favour the machine to allow writing efficient programs. More modern languages favour humans, but you can hardly say that all languages were designed for humans and humans alone. $\endgroup$ – Dave Clarke Aug 11 '15 at 11:25
5
$\begingroup$

"Underlying this fact is that all [programming] languages serve the same purpose: to turn human thoughts into the 1’s and 0’s that the computer understands."

That statement is clearly wrong. Malbolge, for instance, was specifically designed to be counter-intuitive.

The purpose of all soucre code written by developers is, that other human beings are able to read it easily.

That is also wrong. There are many other possible goals, including

  • to "just work",
  • to result in especially efficient machine code (given a certain compiler),
  • to teach the reader something, or even
  • to be hard to understand.

The lesson here is to be very careful with unconditional, universal statements: they are rarely true. Stick to a statement that you can prove and is just strong enough to support your narrative.

The question of whether there is one that fits both criteria in your case, I can not answer; I suspect there isn't, though.

If readability were the dominant goal in the software industry, many things would be better than they are. But that's just my layman opinion; you should go to programmers.SE for this.

$\endgroup$
  • 1
    $\begingroup$ The point of this answer is to show that there is no such reference, since the claim is false. If occurs to be that this may be a non-sequitur. Sadly. $\endgroup$ – Raphael Aug 10 '15 at 14:18
  • $\begingroup$ I agree with your points. I think the main problem are my bad translation skills. My statement is at the beginning of the "refactoring" chaper, therefore you can be sure that one of the goals is readability (does purpose mean main goal?). I would like to express that the source code itself has to maintained, therefore you need readabitly. And that there's no reason too care less about it, because the source code itself (the text), will only be read by developers. The machine don't care. Talking about readability as a goal implies, that we don't care about efficiency. $\endgroup$ – 0lli.rocks Aug 10 '15 at 14:25
  • $\begingroup$ I tried to improve my translation to fit the original text. $\endgroup$ – 0lli.rocks Aug 10 '15 at 14:32
  • $\begingroup$ @Olli1511 You changed your claim to a much weaker one, thus invalidating my answer. It stands for the statement I quote. $\endgroup$ – Raphael Aug 10 '15 at 14:41
  • $\begingroup$ I think your answer is correct, if readability was the main goal of every source code, but, as you stated out it's not. Maybe I should add my original german text to my question. $\endgroup$ – 0lli.rocks Aug 10 '15 at 14:44
2
$\begingroup$

I would check out this book: Refactoring by Martin Fowler. Even though your question isn't specifically about refactoring, this should be a good resource making an argument for why readability is important since the beginning chapters talk about why refactoring is important. If readability to a human wasn't important, then refactoring wouldn't be important. So the arguments he makes for the importance of refactoring should support your argument as well.

$\endgroup$
2
$\begingroup$

From the preface to Structure and Interpretation of Computer Programs:

First, we want to establish the idea that a computer language is not just a way of getting a computer to perform operations but rather that it is a novel formal medium for expressing ideas about methodology. Thus, programs must be written for people to read, and only incidentally for machines to execute.

https://mitpress.mit.edu/sicp/front/node3.html

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.