Today, doing a little task in R, I had cause to look up the following “warning” that appeared after compiling a script:
Warning message:
In readLines(file) : incomplete final line found
I couldn’t figure out what this warning meant, because the script ran fine, so I did a web search and I came across this exemplary example of why working with R really sucks: the help files are completely useless, the warning messages are cryptic and meaningless, the inbuilt editor is broken, there is no standardization of externally-developed editors, and the people who provide help online are some of the rudest people you will ever meet in computer science. This simple warning shows it all at once. I’ve complained about the dangers of R’s cryptic and meaningless warning messages again, but this example should really serve to show how they also cry wolf in a really unhelpful way.
The linked page is a message board of some kind (I think a reproduction of the “official” R boards on a another site) where a person called Xiaobo.Gu has posted up a request for help in decoding the above warning message. The request is polite enough though not voluminous, asking “Can you help with this?” but the first response (from someone with 7328 posts on this board!) consists entirely of the following:
Help with what? You got a warning. And it had information that should
tell you how to edit the file if the warning bothers you.
What is the point of a reply this rude and dismissive? This person actually took the time to reply to a post, in order simply to say “I won’t help you.” On a message board explicitly intended to help resolve problems with R. In addition to being rude it’s arrogant: there is no information abou thow to edit the file, just a pointer to the final line. We will shortly see the cause of the error, and it should be clear that no one in their right mind would consider the warning to have provided “information” of any form.
The next reply admonishes the original poster for failing to follow the posting rules (though doesn’t say how they were breached – so is essentially another contentless reply!) and then includes a little sneering aside about the way Windows encodes ASCII text that makes me think the developers of R have an elitist refusal to engage with Windows’s flaws. It then reveals that the warning is harmless and only appears in R version 2.14.0 (unpatched).
Why bother putting such a warning into a program? Whose idea was it to put a harmless warning in a single version of R, and why and how can a warning be a warning and also be harmless? Either something risky is going on, or it’s not. If it’s not, don’t waste my time with red text.
Finally another person comes along to sneeringly answer the question and provide actual information:
A warning message such as this could not be clearer.
It means that the last line of the file does not end with a <newline> sequence ==> the final line of the file is incomplete.In an editor go to the end of that line and press <Enter> or <Return>
And save.Alternatively configure your editor to always terminate the last line of a file with a <newline> sequence.
This is a sparkling gem of passive-aggressive “help.” I can see a simple way in which the warning could be “clearer:” It could say “you did not press enter or return.” Then, it would be clearer. As it is, there is no information about what is missing in the final line: it just says it is “incomplete.” How can anyone claim that a warning such as this could not be clearer?
But then, just to top it off, this commenter has suggested that the poster configure their editor to “always terminate the last line of a file with a <newline> sequence.” This might seem to be reasonable advice, except that I get this warning in every script I write and I am using the built-in editor! This means that some muppet at C-RAN shipped a version of R with an editor configured to write scripts in such a way that they would trigger a warning. By default. Then, the very first patch they released got rid of the warning. wtf!? Is this what passes for quality control at C-RAN?
This is why wherever possible I use Stata for my work. I need software I can trust to produce the same results every time I run it, that isn’t going to waste my time with meaningless warnings and threats in glaring red, that isn’t configured to do things wrong by default, and that performs all calculations correctly. In order to trust that my stats software will perform all calculations correctly, I really need to know that the designers have some degree of basic quality control. When I see stuff like this – simple programmatic failings in things like the default settings of the script editor – I find it really hard to believe that the correct attention has been paid to, say, the way that the program performs adaptive Gaussian quadrature.
I also expect that the people who design this stuff will be polite when answering questions. I don’t need some passive-aggressive guy on the internet telling me off for failing to understand an extremely vague warning message that is only troubling me because C-RAN don’t have adequate quality control. The replies on that thread should have been polite requests for more information followed by an apology and a promise to fix this problem – or, if these people aren’t directly involved in C-RAN (and we know one of them is … one of R’s designers is on that thread) then a suggestion about how to alert the developers to the problem. Sneering and bullying – no thanks. I don’t get that when I contact Mathworks for help with Matlab, no matter how stupid my request.
This is why when I teach my students about stats packages I tell them a) you can’t trust R and b) it has a nasty community. I teach them its value for automation and experimental stats, and warn them away from using it for anything that has to be published in serious journals.
I think R is just another example of how dangerous it is to run your business on open source software, though I’m sure there are times when it’s safe. And I think it would be fascinating to see a detailed textual analysis comparing the message boards of an open source community (linux, R, latex) with a proprietary product like Stata, because in my experience there’s a world of difference between the two communities. Why that difference exists would not only be a fascinating anthropological study, but would no doubt be of relevance to the scientific study of neckbeard behavior, because I have a strong suspicion that neckbeards are the dominant species in the open source world. Will an anthropologist somewhere take on the task?
June 17, 2012 at 8:18 pm
As a data point, I am a software developer and I instantly knew what that warning meant. I definitely not saying that your experience was invalid or that all the other stuff you said was not correct, but there is a subset of people (and not just experienced R users) for whom that warning makes sense.
June 17, 2012 at 10:05 pm
well and good, Fanguad, but R is not a serious programming language and its users are intended to be statisticians and researchers, not programmers. I’ve never received formal training in programming and very few people who use R have – it’s intended as a tool, not a development package. Which is all the more reason not to swan in with nasty, sneering “advice” when someone asks a question about something that is supposed to be “obvious” – the someone in question could be a psychologist, for example, who has no prior experience in programming and is training themselves in R so that they can implement some experimental statistical method or automate a multivariate statistical process for a large dataset. That person is a legitimate user of R, but they can’t be expected to understand why not putting a carriage return at the end of a program should invoke a warning (which, btw, for my own edification, why should I give a toss?)
Also, regardless of its viability as a warning in programming languages in general, it obviously isn’t very important in R since the replies dismissed it as “harmless” and observed that it only existed in one version of R and disappeared after patching. And whether it’s important or not, telling someone to configure their editor when the basic built-in editor for the software package does it, is … rich, to say the least. And doing all that in a rude tone as if to suggest that the problem is with the user rather than the extremely idiosyncratic decisions of the developers? That’s priceless behaviour, that is.
June 17, 2012 at 10:06 pm
That use of “swan in” was about the people in the thread, not your contribution here (which I don’t think is rude or sneering in anyway, just in case you were confused by my reply).
June 18, 2012 at 12:21 pm
It’s possible that the (nasty) nature of support for open source software is due to the relationship of the people supporting it to the software itself. For Open Source software, the people supporting it frequently had a hand building it. That makes them invested in the program and questions about it are regarded as an assult on them.
By contrast, professional softwarre houses are more likely to have separate development and support teams. The Support team is far less likely to take a question about the software as an insult to them and it’s also much more likely to be trained and experienced in dealing with “dumb” user questions.
The final aspect that applies for both groups is I can assure you that many questions about software really are blindly stupid and that tends to make people doing support pretty dismissive towards their users. There’s a reason that “Is your computer plugged in” is the first question support lines ask – it elminates a significant portion of the problems [1]. This doesn’t excuse the attitude, but does help highlight that being trained in “Not being snarky to your users” is actually a critical skill to train your support staff in.
[1] For the system I work with, most queries are “I submitted X and it isn’t working” leading to a conversation of “We’ve told you (personally) that doesn’t work a couple of times now. I’ll cancel off this one. Please don’t do it again.”