Live data from Hacker News

Why scientific programming does not compute

nature.com

91–100 of 170 posts

Re: Why scientific programming does not compute

#91
post #68
post #57

Earlier quoted context omitted.

Greg Wilson once commented that the subversive way to get scientists to use source control was not to pitch it as a code history tool, but rather as a nifty way to sync up code between their work machines, home machines, etc. He said he had a lot more traction with that than trying to lecture them about having code history.

Dropbox has invalidated this pitch.

Not completely. Git is better at merging.

Re: Why scientific programming does not compute

#92
post #42

there's not nearly enough open source academic projects, nor is there any sort of pervasive culture that encourages one.. besides the litany of examples that could be put together to show that open source + academia does exist and does work, I've read way too many computational physics or computational chemistry or computational anything academic papers that simply do not publish source code, and imo there's no good…

There is an important factor discouraging publishing source code - fear that there indeed are bugs and they will be exposed. This is blatantly "security through obscurity", but I fear it's a common attitude. If there are bugs and code is secret, even if someone else later points out that the results contradict their own findings, it's (presumably) not difficult to sweep the thing under the rug and cool it down. On th…

Won't you get a citation, whenever somebody uses your code?

Re: Why scientific programming does not compute

#93
post #62
post #7

Earlier quoted context omitted.

Actually it's a science thing. In a scientific context "code" is understood to mean "program". For example: http://scholar.google.com/scholar?q=%22population+synthesis+... I'm not sure why this is though.

Because most scientists write code in Fortran '77, which is interpreted, meaning that "code" == "program".

From my experience, the most used languages in scientific programming are Fortran 90, C/C++, and Matlab with a considerable number of legacy codes written in FORTRAN 77.

Also, FORTRAN 77 is most definitely not an interpreted language.

Re: Why scientific programming does not compute

#94
post #84
post #72

Earlier quoted context omitted.

I'm a M.S. student in mechanical engineering facing a similar situation, except I haven't put any code on Github (my advisor wants to keep it proprietary, but I probably would not bother putting it up even if he were ok with it). I've written around 15000 lines of MATLAB for my research and only a handful of people will ever need to see it. Some is well-structured and nicely commented, but other parts are incomprehen…

I wonder whether our priorities for research are misguided. Isn't research about extending the knowledge of humanity? Writing and passing on readable code would probably advance us further in total, than everyone starting basically from scratch. (I'm not faulting you, you just react to the incentives.)

Well, I went to a lecture by one of the most prominent scientists here in Brazil, where he explicitly said that the answer to your question is NO. Research as it stands today exists to feed the system. According to him, you:

* Publish, so you can get grants

* Use that grant so you can publish more

* Get more grants;

* Get tenure somewhere in the middle.

I have to confess I was very disgusted by him saying that in front of such a large audience of scientists and graduate students.

EDIT: Formatting

Re: Why scientific programming does not compute

#95
post #72

I'm a PhD student in Electrical Engineering. I'm currently working on a Monte Carlo-type simulation for looking at the underwater light field for underwater optical communication (no sharks!). I'm doing the development in MATLAB and I recently put all my code up on Github ( https://github.com/gallamine/Photonator ) to help avoid some of these problems (lack of transparency). Even if nobody ever looks/uses the code, I…

I'm a M.S. student in mechanical engineering facing a similar situation, except I haven't put any code on Github (my advisor wants to keep it proprietary, but I probably would not bother putting it up even if he were ok with it). I've written around 15000 lines of MATLAB for my research and only a handful of people will ever need to see it. Some is well-structured and nicely commented, but other parts are incomprehen…

"my advisor wants to keep it proprietary"

This concerns me. Is this kind of thinking pervasive in public academic institutions? Avoiding the copyright ownership issues that tend to accompany such discussions, would it not be better to be more open about the code in an attempt to gain peer review?

I understand your personal motivations about not publishing, but the statement about your advisor is what I'm worried about.

Re: Why scientific programming does not compute

#96

For all the talk of "best practices" and "training" the depressing truth is that guaranteeing correct software is incredibly difficult and expensive. Professional software engineering practices aren't nearly sufficient to guarantee correctness with heavy math. The closest thing we have is NASA where the entire development process is designed and constantly refined in response to individual issues to create the checks…

I've spent a bit of time on the inside at NASA, specifically working on earth observing systems. There is a huge difference between the code quality of things that go into control systems for spacecraft (even then, meters vs. feet, really?) and the sort of analysis/theoretical code the article talks about. Spacecraft code gets real programmers and disciplined practices, while scientific code is generally spaghetti IDL/Matlab/Fortran.

There is a huge problem with even getting existing code to run on different machines. My team's work was primarily dealing with taking lots of project code (always emailed around, with versions in the file name) and rewriting it to produce data products that other people could even just view. Generally we'd just pull things like color coding out of the existing code and then write our processors from some combination of specifications and experimentation.

I'd agree that "unit tests" and trendy best practices are probably not the full answer, but the article is correct in emphasizing documentation, modularity, and source control. Source control alone would protect against bugs produced by simply running the wrong version of code.

Re: Why scientific programming does not compute

#97
post #84

Earlier quoted context omitted.

I wonder whether our priorities for research are misguided. Isn't research about extending the knowledge of humanity? Writing and passing on readable code would probably advance us further in total, than everyone starting basically from scratch. (I'm not faulting you, you just react to the incentives.)

Well, I went to a lecture by one of the most prominent scientists here in Brazil, where he explicitly said that the answer to your question is NO. Research as it stands today exists to feed the system. According to him, you: * Publish, so you can get grants * Use that grant so you can publish more * Get more grants; * Get tenure somewhere in the middle. I have to confess I was very disgusted by him saying that in fro…

I agree it's a problem, but I think you have to fix the incentives to make meaningful change. When people are thrown into a cut-throat competitive environment, with tenure clocks, multiple junior professors per tenure slot, requirement to bring in grants to fund your research or you get shut down, etc., it doesn't encourage people to be altruistic and sharing.

Re: Why scientific programming does not compute

#98
post #95
post #72

Earlier quoted context omitted.

I'm a M.S. student in mechanical engineering facing a similar situation, except I haven't put any code on Github (my advisor wants to keep it proprietary, but I probably would not bother putting it up even if he were ok with it). I've written around 15000 lines of MATLAB for my research and only a handful of people will ever need to see it. Some is well-structured and nicely commented, but other parts are incomprehen…

"my advisor wants to keep it proprietary" This concerns me. Is this kind of thinking pervasive in public academic institutions? Avoiding the copyright ownership issues that tend to accompany such discussions, would it not be better to be more open about the code in an attempt to gain peer review? I understand your personal motivations about not publishing, but the statement about your advisor is what I'm worried abou…

Yes it is. Often it's not for nefarious reasons - it happens a lot where I work because we use data from collaborators that is unpublished, and it's considered unethical to jump over them by releasing code or results based on it.

Of course, the problem is that it can sometimes take years to get large datasets published and this means that the code gathers dust and gets forgotten in the meantime. By contrast, the papers and results aren't, because those are the things by which academic careers are measured.

I would personally support a wholesale change in culture in this area. Code and data/results/conclusions are not as inseparable as most scientists would like to believe, and often should be published as a unit. There has been push in this direction for a while in the engineering sciences, but other informatics disciplines like biology lag badly in this respect.

Re: Why scientific programming does not compute

#99
post #57
post #45

From personal experience, I attest that it can be more difficult than pulling teeth to get a scientist to commit code to a version control system.

Greg Wilson once commented that the subversive way to get scientists to use source control was not to pitch it as a code history tool, but rather as a nifty way to sync up code between their work machines, home machines, etc. He said he had a lot more traction with that than trying to lecture them about having code history.

That's probably good for arguing about good backup practices too. In the department I worked in it was common for grad students to have months of code written on their laptop that was not duplicated anywhere else. The problem is that these students were working independently and didn't really have a need to transfer the code anywhere else.

Re: Why scientific programming does not compute

#100

Earlier quoted context omitted.

Well, I went to a lecture by one of the most prominent scientists here in Brazil, where he explicitly said that the answer to your question is NO. Research as it stands today exists to feed the system. According to him, you: * Publish, so you can get grants * Use that grant so you can publish more * Get more grants; * Get tenure somewhere in the middle. I have to confess I was very disgusted by him saying that in fro…

I agree it's a problem, but I think you have to fix the incentives to make meaningful change. When people are thrown into a cut-throat competitive environment, with tenure clocks, multiple junior professors per tenure slot, requirement to bring in grants to fund your research or you get shut down, etc., it doesn't encourage people to be altruistic and sharing.

I think the problem is fundamentally one of economics. Research is good, but you have to decide how much money to allocate to it. In order to decide, you need a metric for performance. Really, only scientists are qualified to judge whether the results of other scientists are worth anything, so currently the only metric we really have is publishing in peer-reviewed journals. Ultimately, therefore, that's where the incentives end up.

When a more appropriate way of quantifying research output and its benefits is found, hopefully a beneficial change in culture will trickle down into the academic trenches.

Post reply on HN