6 ms·
Hey CS Paper writers, please show your code
- chime 15y agoI'd be happy with just pseudo-code.
- j2labs 15y agoI would like more code simply to prove the things described in the papers. The exploration just feels incomplete to me if I can't run some code and hack on it to test how it changes behavior.
- xyzzyz 15y agoI really don't think that it's easier to understand algorithm by reading its implementation than by reading its description. It's actually opposite -- frequently the idea behind algorithm is really hard to decipher if you only have access to code and not words. If you don't believe me, take an algorithm you don't know, read sample implementation (there are quite a lot on the internet these days) and try to understand how it works. I suggest trying KMP and Boyer-Moore for text matching, or Miller-Rabin and AKS for primality testing, or even RSA -- RSA is terribly simple in theory, but if you don't have a clue how it's supposed to achieve its goal, and you don't have background in number theory, then your chances of understanding it just by reading the code are infinitesimal.
- chime 15y agoWhy can't we have all three when relevant? Description + formulas + code? I understand why some algorithms (AKS, RSA) would not make sense if you just spit out the C code raw but I think it would make the paper much easier to understand if there was some code to go along with the formulas and descriptions, especially if the description is hard to decipher like "analyze the performance of the differencing algorithm on random instances by mapping it to a nonlinear rate equation."
- xyzzyz 15y agoIn most (if not all) papers I read there was already pseudocode, which is actually better than real programming language, because it lets you express your algorithm in a concise way without all the real world overhead, like initialization, allocation, etc. If you cannot implement algorithm yourself by reading its description and pseudocode, it means that either you don't fully understand what you just read, or your programming skills need some polishing, and you should be rather reading textbooks than research papers for a while. Also keep in mind that papers are written for the colleagues in the field to read, and not for the laymen, so it's no surprise that authors use the terminology familiar to people in the field. It makes no sense to write research papers with laymen in mind, because 99.999% of them don't care and the remaining 0.001% will learn terminology soon enough. Also, you really should not expect that reading research papers will be as easy as reading newspapers, don't you agree?
- KaeseEs 15y agoOftentimes, it is easy to overlook whether that real-world overhead affects the asymptotic performance of your algorithm in either an ideal sense or a pragmatic one. If memory allocation were free or memory were infinite, true constant time rather than amortized constant time push back on dynamic arays/vectors would be possible, etc. Also, initialization often affects correctness, so it's much less frequently skipped even in pseudocode for an algorithm.
- jedbrown 15y agoThere are some famous examples of tweaks that don't make the paper, but are actually critical to successful methods. Antony Jameson's aerodynamic codes are prime examples. He made good money for decades because Boeing and some other majors couldn't reproduce his code on their own, but his code gave better predictions compared to the wind tunnel, so they used it to design several generations of aircraft.
- william42 15y agoIf the code is that different from the paper, why was that paper published?
- jedbrown 15y agoReviewers don't get to see the code and most don't have the time or inclination to reimplement based on what is described in the paper to check whether it tells the whole story or not. Yes, this is different from a theorem which should come with a rigorous proof. This is a great talk on the subject: http://www.amath.washington.edu/~rjl/talks/LeVeque_CSE2011.pdf http://www.amath.washington.edu/~rjl/talks/LeVeque_CSE2011.p...
- bigiain 15y ago"Generally, academic software is stapled together on a tight deadline; an expert user has to coerce it into running; and it's not pretty code. Academic code is about "proof of concept." These rough edges make academics reluctant to release their software. But, that doesn't mean they shouldn't. " From: http://matt.might.net/articles/crapl/ http://matt.might.net/articles/crapl/
- cperciva 15y agoWho says that we actually have code? I think it took most of a decade before anyone implemented the algorithm from my first paper.
- alnayyir 15y ago>before anyone implemented the algorithm from my first paper Link to both please? I am lazy and incapable of basic Googling. I sit in shame, but also hope that you will fulfill my request. A beer awaits you in SF regardless!
- blaenk 15y agoHis username lent itself to searching, so I doubt he'll mind me posting: http://www.daemonology.net/papers/ http://www.daemonology.net/papers/
- zohebv 15y agoMost often they don't have any code. Most of the action takes place inside the head and not inside the computer. What they have are proofs of correctness, invariant enforcement, complexity bounds etc. I doubt that reading the code will improve understanding of the algorithm anymore than a thorough description of the algorithm.
- socratic 15y agoUnfortunately, Jacques needs to answer a pretty basic question in order to get his wish: why? Why should CS paper writers show Jacques (or anyone else) their code? We have discussed this topic on HN a number of times, for example: http://news.ycombinator.com/item?id=2735537 http://news.ycombinator.com/item?id=2735537 http://news.ycombinator.com/item?id=2006749 http://news.ycombinator.com/item?id=2006749 Many of the comments in those threads do a better job summing up than I ever could. However, briefly, literally all of the incentives are aligned against publishing code and data. If a writer's code is wrong, they are embarrassed (and there is no culture of being embarrassed by not publishing code). If a writer publishes their code and it is actually good, someone else can scoop their follow-on results. If a writer does not publish their code, and it is actually any good, they can potentially commercialize it thanks to the Bayh-Dole Act. If a writer publishes their code and people intend to use it, the writer needs to clean it up, check it for correctness, and handle support requests. These activities are probably more time consuming than writing the code in the first place. If the writer publishes their code, and other people in the writer's field do not, the writer is usually at a disadvantage. Others will appear to have more publications, the basic currency of academia. (Many people have great reasons for not publishing their code or data, especially researchers embedded at large companies making changes to large proprietary systems.) So overall, yes, it would be great if CS paper writers gave out their code. What they are doing is not reproducible science in the philosophy of science sense. But what is Jacques (or anyone else) doing to fix this system of incentives, and what could anyone do?
- bartl 15y agoIt is all for science. Other people can validate you didn't make any blatant errors.
- felipemnoa 15y agoFor validation purposes is probably better that the researches doing the validation write their own code from scratch.
- _delirium 15y ago
- cpearce 15y agoThis won't fly in the real world. If an academic writer includes a link to their code in their paper, when it goes through peer review before being published, it will no longer under be a blind review; the reviewer will know who wrote the code by virtue of the github account or domain it's uploaded to. Blind reviews are important, as if you know you're reviewing a paper by someone who rejected your paper, you're more inclined to reject it. That really happens, people are that petty. Additionally there's the risk that the reviewer will reject the paper, and download the code and publish a paper about it quickly in some other journal/conference.
- xyzzyz 15y agoYour counterpoints are irrelevant. You can obviously attach code to the article, so that there's no need to include any link or other similar thing. If a reviewer wants to do the thing you described, the actual possession of the code is not a big help for him -- what actually keeps him from doing that is honesty, decency and the respect he has among his colleagues he would instantenously lose.
- andreasvc 15y agoSolution: you anonymize the link for peer-review, and only include the real link in the final version. This way the code is not peer-reviewed of course, but peer review can look at the pseudo-code given in the paper. Your last point really has nothing to do with given away code, nor with peer review: you can plagiarize just about anything. This generally doesn't happen because scientists care a lot about giving credit and recognizing priority.
- pwaring 15y agoWhy not just fill in the link after review but before publication? Presumably that happens with other information which identifies authors, such as their names and email addresses. Although 'blind' reviewing is something of a misnomer in small research fields where the reviewer can probably guess at least one of the authors.
- baddox 15y agoIt seems to me like most CS research projects wouldn't necessarily have much code behind them. Obviously, data structures and algorithms could, but implementations are generally trivial once you've got the academic paper.
- tobiasu 15y agoBut... computer scientists don't write code! That's not what they're studying, it's not their job! Writing code is what women do. "Computer Science is no more about computers than astronomy is about telescopes."
- mayanksinghal 15y agoWhile I do not agree to the fashion in which the above comment was made, I do agree with the sentiment. I know a few computer scientists who are really good at algorithms and theoretical computer science but will not write/be-willing-to-write code. There are, many times, constraints because of lack of proper representation in the language or because of added complexity in actual code than in pseudo code (because of edge cases - unnecessary boilerplate code to just make the code run etc.). Additionally, many a times the paper might be presenting part of a larger algorithm/solution and that part in itself might not be useful/compilable. I think that pseudo code fulfills the need for most of the cases; at times when it doesn't peer reviewers would ask for code and the same will be provided if possible. [edit: typos]
- mayanksinghal 15y agoOh and papers without implementation make up a significant part of a lot of undergraduate course projects. I am actually looking for an interesting research paper to implement for Digital Image Processing.
- robryan 15y agoI would be interested to see more CS research happen in a more open source like way, like how we see projects work on github where it is easy for anyone with an interest in an area to get involved, run the code and contribute. Obviously this wouldn't be possible in all branches of CS research and there is the danger that these kind of projects would get stuck local maximas without a few minds driving the research and the ability to understand it well enough to make large scale changes. Still a lot of good could probably come out of it, plenty of smart CS minds that while they don't have time to commit to the reading and work required to drive their own research project have the expertise to contribute to small parts of other peoples.
- xyzzyz 15y agoThat's funny, because, you see, actual research really works like this. Instead of Github you've got journals, and seminars on universities. The smart minds contributing small parts to other people's research are graduate students. The thing is, actually contributing in the cutting-edge research is much harder than helping FOSS projects. Most researchers I know think of their problems day and night, while to be helpful in community software projects it's enough to spend few hours on weekends.
- phzbOx 15y agoNot to be harsh, but the code I've seen taken from "scientific" papers were the worst code I've ever seen. One function of a couple of thousand lines in C++ (But using a mix of C and C++ functions) using variables named with 1 or 2 letters.. without comments, gasp.. I still do nightmare about that (I had to refactor that code.) But I do agree with Jacques that I so much prefer a graph with a summary than a couple pages of unreadable mathematical expression. A high-level pseudocode of the general idea might also be great. Sometime, I feel like the paper wasn't written for people to understand.. but as a way to make it seem difficult. It's not rare that I talk with an author of a scientific paper and can easily summarize an entire paragraph with a couple of simple sentences..
- xyzzyz 15y agoOf course it wasn't written for people to understand -- it was written for their colleagues in their field, and all they care about are these pages unreadable mathematical expressions. It's not rare that I talk with an author of a scientific paper and can easily summarize an entire paragraph with a couple of simple sentences.. And when I talk about math with my friends over a lunch, much, much more information can be conveyed than by spending the same amount of time on reading papers. However, it does not prove that papers are written in unintelligible way, only that human-to-human communication is much more effective than paper-to-human.
- deleted 15y ago[deleted]
- petercooper 15y agoI read a lot of CS papers and am not particularly strong on formal math (that is, I have a lot of gaps) but I'd rather not have actual code to demonstrate concepts. Instead, I prefer it when they use pseudocode because it forces them to boil their implementation down to the simplest parts possible than cut and paste code into a paper.
- NY_Entrepreneur 15y agoSorry. A peer-reviewed research paper in computer science is supposed to be an original contribution to knowledge meeting the usual criteria of new, correct, and significant. Okay, how do we present knowledge? Text? Yes. Text with math as in, say, a book on math or mathematical physics? Yes. Code? Nope! Sorry 'bout that! Yes, coming from the programming side, many programmers have accepted that code, especially with mnemonic identifers, actually is meaningful and a substitute for good text possibly with good math. Sorry, guys: In principle, it just ain't. In simple terms, the code is meaningless; code with mnemonic identifer names and careful indenting is still meaningless and at best a puzzle problem to solve to identify the intended meaning. Sorry 'bout that. Yes, often in practice, with enough context from outside the code, can get by with just mnemonic names and pretty printing. Still, it's just ain't knowledge. Really, for being knowledge, the code should be like the math in, say, a physics text, that is, surrounded by text. The math does not, Not, NOT stand alone and by itself is just meaningless. E.g.. F = ma is no more meaningful than a = bc. For either equation, the meaning has to come from surrounding text where the equation becomes just a nice abbreviation for what is in the text. So, for code, the comments play the role of text in a physics book and the code plays the role of the math in a physics book. As in a physics book, the text (comments) are MORE important than the math (code). Again, code just AIN'T knowledge. Sorry guys.
- spacemanaki 15y ago"Really, for being knowledge, the code should be like the math in, say, a physics text, that is, surrounded by text..." You kind of set yourself up for the rebuttal here. I don't think many people would suggest that presenting code devoid of context would be useful. Usually, really good writing about code, whether in papers or in books, is written in a kind of literate style, a la Knuth. Even if it's not formally done using literate tools, in many cases the code is accompanied and surrounded by text, just like mathematics. This isn't some kind of pissing match between code and math, as you seem to want to make it out to be. Someone publishing a CS paper presumably has some interest in communicating something to the reader. The OP is just suggesting that for some subset of the readership, code might aid in that goal.
- 15y ago
- ggchappell 15y agoI agree with the writer, in many ways. But it's going to be a huge uphill battle. I'm on the other side of this, too, as a researcher in algorithms. Earlier this year, I submitted the first paper I've ever written, in which I would consider some related code to be an essential part of my research. Now, consider what this means. - I had some spend a lot of time getting the code into shape. Documentation, general clean-up, etc. This was time I could have spent writing other papers. Publication output is a huge determining factor in academic tenure & promotion decisions. Seriously, the way things are now, you're asking people to risk not getting tenure, in order that you might have their code. - The idea of a published paper, is a permanent record of the research. Repositories for code that are of a similar permanent nature, are few & far between. Some journals are starting to allow arbitrary attachments to papers, which can them be obtained online. I submitted my paper -- along with the code -- to such a journal. But this greatly restricted the list of journals I could submit to. And it pretty much left out all of the truly prestigious ones. Again, a problem.