11 ms·
Why scientific programming does not compute
- saulrh 15y agoSomething I heard from one of my professors once: "A programmer alone has a good chance of getting a good job. A scientist alone has a good chance of getting a good job. A scientist that can program, or a programmer that can do science, is the most valuable person in the building."
- nkassis 15y agoThis is so true. I work in a research lab and I'm trying to interest myself more to the science and it's really helping my coding work. It's easier to improve software when you know what your users need.
- MasterScrat 15y agoSimilarly, from Zed Shaw (http://learnpythonthehardway.org/book/advice.html http://learnpythonthehardway.org/book/advice.html) : "People who can code in the world of technology companies are a dime a dozen and get no respect. People who can code in biology, medicine, government, sociology, physics, history, and mathematics are respected and can do amazing things to advance those disciplines."
- archgoon 15y agoThis seems at odds with the statement from the article "There needs to be a real shift in mindset away from worrying about how to get published in Nature and towards thinking about how to reward work that will be useful to the wider community." EDIT: What the heck is wrong with this? We have two opinions on the perceived value of programmers in scientific enterprises, one from someone who works in the field (David Gavaghan) and another from Zed Shaw. I'm highlighting that Zed's perception is not universally agreed upon.
- ldar15 15y agoDont feel too bad. HN has become full of people who believe that the correct response to something they disagree with is to mod down, instead of to reply with a rebuttal. It sucks, but others will mod you up.
- ignifero 15y agoThis sentence strikes me as astonishingly hypocritical. Nature can immediately do 2 things to make the science they publish vastly more useful to the wider community: 1) Remove the paywall 2) Require publishing the code for computational papers (and the data for experimental papers) Nature Group only cares about maintaining its status as a high impact factor journal, and scientists sheepishly submit to them. They actually love it that scientists worry about getting published in Nature.
- vacri 15y agoget published in Nature = food on the table useful to the wider community = warm fuzzy feeling Ideally you'd get both, but if it's one or the other, for most people a full belly wins.
- earl 15y agoMy experience is while they may be respected, they aren't paid. And I'm not a charity.
- crocowhile 15y agoNobody is paid for doing research. The salary of a professor is about 1/3-1/5 of what the same person may get in industry. People who do research don't do it for the money.
- jonathansizz 15y agoI agree with your point, but I'd add the modifier that if you're a top-notch developer who forms an interest in a specific sub-discipline in science (my field is genomics, but there are many others where this would be equally applicable), there is certainly huge potential to carve out a niche and make a big name for yourself in your chosen field (as long as you take the science side as seriously as the coding side). Then you certainly could make big money, as Shaw implies and as you'd surmise from reading the linked article.
- stevenbedrick 15y agoYeah, but you know who gets even more screwed, salary-wise, than the professor? I'll tell you who: their lab techs and staff scientists ("research associates"), and that most definitely includes the "programmer who knows some science". Furthermore, at least at my institution, being the "programmer who knows some science" means that your position is entirely funded with "soft money", which means that your level of job security can be pretty low.
- earl 15y agoThat's fair, but you know what those professors get? Tenure. ie not getting fired unless they're caught in bed with a live boy or a dead girl. And they typically get paid with hard money as stevenbedrick notes.
- gaius 15y agoEveryone thinks they're underpaid, but the truth is, academic skills do not transfer well to industry. I refer you to the discussion in Ghostbusters: "Personally, I liked the university. They gave us money and facilities, we didn't have to produce anything! You've never been out of college! You don't know what it's like out there! I've worked in the private sector. They expect results."
- cosgroveb 15y agoThis is also true in business. You should always remember that you're not just a developer or a programmer but that you're solving business problems. That's the only way to truly make yourself invaluable.
- deleted 15y ago[deleted]
- enjalot 15y agoI'm finishing up a degree in Computational Science where we are essentially trained in computational and mathematical techniques used in the physical sciences, and all I can think about is becoming an artist. I don't think it's the science that adds value, I think it's the programming. The thing is, programming allows you to automate, simulate, measure and visualize complex processes. Science is all about complex processes, so if you have more powerful tools available to understand them, you will be much more valuable. Add to that, many of the physical sciences are hitting limits of physical experimentation and require simulations for further understanding. I don't think the power of programming has truly shown itself, it should revolutionize every industry. It brings with it a different attitude towards solving problems and opens up new realms of possibilities. Social sciences are finally starting to look like real science thanks to big data and we have new knowledge industries. I'm personally most interested in how much art and education will change thanks to new powers of interactivity.
- eru 15y agoIf you are interested in programming and arts, why not have a look at computer games? (Or even modern board games, where the algorithms are run by the players themselves.)
- enjalot 15y agoI grew up interested in computer games, and I was lucky enough to TA a game design class at my university. I love the ability to create interactions, but my interest has recently turned to designing interactions into things that aren't normally interactive. I had a lot of fun making an interactive data visualization at a recent hackathon, and I'm hoping to do more things like that. I personally think games and science need to get much closer together, interactive learning is so powerful, and video games can make anything fun. It's definitely something to explore, but there is still a huge divide between science and entertainment and the understanding of the people in each field.
- gte910h 15y agoSounds like you may want to check out robotics. Georgia Tech has a fun Mobile Robotics Lab, and there are several other places that you could study further. (You'll gain training in the actuators, sensors, etc you'd need for your artistic work).
- earl 15y agoThat has not been my experience. I spent years working on DNA aligners then in a wetlab building software for confocal laser microscopy. In both locations, the best paid and most highly valued people were the scientists. If you, say, were a good developer with masters in stats and a strong understanding (somewhere between an undergrad and an MS) of the relevant science... you were paid 1/2 as much as you would be paid if you did computational advertising. And yet there aren't many good developers doing science. Weird, huh?
- gammarator 15y agoAgreed that low salaries are a disincentive for good engineers to work in science. It's worth noting that even the scientists are paid far less than people with commensurate training and experience in industry. As for why scientists are more highly valued: they bring in the grants that keep the wheels turning (in academic circles; industry & national labs obviously differ).
- saulrh 15y agoThat's possible. I have a friend who works in the university aerospace lab that can read and write C and Matlab. His major contribution is being able to both understand the engineering and write code to manipulate it, and it's basically guaranteed himself a position there. He may not be valued quite as much as the PI or one of the other professors, but he's pretty solid. I'd also cite myself, but I don't count since I'm in a robotics lab.
- ak217 15y agoWhich aligner(s) did you work on? Sequence analysis companies and labs which don't value software engineering get what they pay for: serious or crippling inefficiencies and inability to do analysis on their data or maintain continuity. Unfortunately, many of them don't even realize what they need or how bad their inefficiencies are.
- a_dy 15y agoI can attest to this.
- sliverstorm 15y agoWhy not just hire comp scientists or programmers permanently? Adjust the company model, permanently segregate the work?
- jbooth 15y agoProbably because they're 3-5X as expensive as postdocs.
- nkassis 15y agoI'm lucky to be in a lab with enough funding for this. This is rarely the case. In medical science it's easy to get large grants and pay programmers in something like biology the programmer is usually that guy that learned perl since he's already getting paid to do science. Grad students probably wrote the majority of the tools used in my lab and it shows because when they leave the knowledge of the different issues and bugs in the software that they had goes with them. Years later they resurface and no one has any idea of the thought process of the original author. It's quite annoying. We have such a project right now that is a basic piece of software we use for all our research. There is no current funding for someone to sit there and clean up the code. Most funding agencies want new work not maintenance work to be done with their money. There just isn't any incentives anywhere for this. Someone will just reinvent the wheel probably.
- prospero 15y agoI did some work on data visualization for the astrophysics department when I was in college. I started to work with the simulation code, but found that the math was sprinkled everywhere, which made it really difficult for me to make structural changes without risking the integrity of the program. One of the most elusive skills for self-taught programmers is how to structure code properly. A good architecture would allow domain experts and non-expert programmers to coexist, but that would require throwing away a lot of existing spaghetti code written by domain experts, which is not going to be a popular decision.
- mclin 15y agoThis is why I think, rather than every data analysis/visualization program being written from scratch with it's own custom UI and I/O, formatting etc, these programs should be written as modules to a data workflow program like RapidMiner that handles all that for you.
- bh42222 15y agoAs a general rule, researchers do not test or document their programs rigorously, and they rarely release their codes, making it almost impossible to reproduce and verify published results generated by scientific software, say computer scientists. Just stop doing that! Seriously, testing is not wasted effort and for any project that's large enough it's not slowing you down. For a very small and simple project testing might slow you down, for bigger things - testing makes you faster! And the same goes for documentation. And full source code should be part of every paper. Many programmers in industry are also trained to annotate their code clearly, so that others can understand its function and easily build on it. No, you document code primarily so YOU can understand it yourself. Debugging is twice as hard as coding, so if you're just smart enough to code it, you have no hope of debugging it.
- pygy_ 15y agoYou won't see any clean code written by scientists until (major) journals make it mandatory to submit code for peer review and publication. When it happens, I hope that they'll manage to agree on a sensible license (even though I won't set my hopes too high).
- rflrob 15y agoI have all of my code on github under a CRAPL license [1]. It assumes a certain amount of good-faith from others, but I feel that if you're worrying about getting scooped, your problem isn't ambitious enough. Luckily, my adviser agrees, and is very in favor of open releases of data [2]. [1]http://matt.might.net/articles/crapl/ http://matt.might.net/articles/crapl/ [2]http://www.michaeleisen.org/blog/?p=440 http://www.michaeleisen.org/blog/?p=440
- pygy_ 15y agoThe terms of the license are good, but its name is literally crappy:-/
- kenjackson 15y agoThat will never happen, because the universities are bigger than the journals and will push back. The universities want to own the code if there's money to be made. Stanford made a small fortune from Google, for example. If journals required code review, other journals would pop up that wouldn't require it.
- gte910h 15y agoI want to write a "software style guide" for journalists and their editors. Software and Code are both mass nouns in technical language. "Code" can be in programs (aka, things that run), libraries (things that other programmers can use to make programs), or in samples to show people how to do things in their programs or libraries. Some people call short programs scripts. When you feel you should pluralize "software", you're doing something wrong. You might want to use the word programs, you might want to use the word products, you might want to just use it like a mass noun "It turns out, thieves broke into the facility and stole some of the water", etc when talking about a theft of software "It turns out, thieves broken into the facility and stole some of the software".
- szany 15y agoActually 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+codes%22 http://scholar.google.com/scholar?q=%22population+synthesis+... I'm not sure why this is though.
- gte910h 15y agoWhat an excellent idea: Generate new jargon that's incompatible with the jargon used from the field you suck at. Perhaps concerned scientists and editors should reject the bifurcation here and take on the lingo of the field that creates the tool they have to use and need to learn better as a first step in learning to program in a more responsible manner?
- scott_s 15y agoIt's probably not intentional, or even recent. Scientists have been using computers to help solve their problems as long as computers have existed.
- gte910h 15y agoI agree about the intentional. Not sure about the recent part. Still incites alarm bells/nails on the chalkboard response every time I see it
- deleted 15y ago[deleted]
- scott_s 15y agoOne of the main sources in the article is a study from the 2009 Workshop on Software Engineering for Computational Science and Engineering. One of the workshop's organizer's has a report of the overall conference which is interesting: http://cs.ua.edu/~carver/Papers/Journal/2009/2009_CiSE.pdf http://cs.ua.edu/~carver/Papers/Journal/2009/2009_CiSE.pdf
- brohee 15y agoNext they'll discover than when those scientists leave academia and become quants, they don't magically become any better at coding (but at least they now have access to professionals, if they recognize the need).
- jzila 15y agoMy girlfriend is a PhD student in a pharmacology lab. I'm a software engineer working for an industry leader. Once, she and the lab tech were having issues with their analysis program for a set of data. It was producing errors randomly for certain inputs, and the data "looked wrong" when it didn't throw an error. I came with her to the lab on a Saturday and looked through the spaghetti code for about 20 minutes. Once I understood what they were trying to do, I noticed that they had forgotten to transpose a matrix at one spot. A simple call to a transposition function fixed everything. If this had been an issue that wasn't throwing errors, I don't know whether they would have even found the bug. I've been trying to teach my gf a basic understanding of software development from the ground up, and she's getting a lot better. But this does appear to be a systemic problem within the scientific community. As the article notes, more and more complicated programs are needed to perform more detailed analysis than ever before. This problem isn't going to go away, so it's important that scientists realize the shortcoming and take steps to curb it.
- andrewcooke 15y agoi'm in a similar position to you (although i started out as an academic i've worked in the software industry for ages and so end up helping my astronomer partner). anyway, i disagree slightly with your analysis. in my experience academics know that they suck at the "engineering" part and, to make up for it, are very diligent in making sure that the results "feel right". so i don't think what you described was luck - that's how they work. in comparison, what drives me crazy, is that if they learnt to use a few basic tools (scm, libraries, an ide, simple test framework) they could save so much time and frustration. [related anecdote: last year i rewrote some c code written by a grad student that was taking about 24 hours to run. my python translation finished in 15 minutes and gave the same answer each time it was run (something of a novelty, apparently)].
- reinhardt 15y agoNot sure how your anecdote relates to the conclusion. Forgetting, or even knowing why, to transpose a matrix is not an example of a problem that can be solved by "a basic understanding of software development". Hell, I'm sure there are many decent hackers that don't know what a matrix is, let alone spot such errors within a long sequence of computations.
- jleyank 15y agoThis is a difficult situation. Is it easier to train the domain experts to be competent programmers or train the competent programmers to be domain experts? In a research environment, I worry there's little time or interest in developing specs that can change in an instant or can't be written until the physics is understood. We find it quite difficult trying to get programming out of people who don't know why Carbon has 4 bonds while Nitrogen has 3, for example.
- gammarator 15y agoMy feeling is that a one-semester required course for students in "software carpentry" [1] (as developed by Greg Wilson and discussed in the article) would cure many of the most serious ills in scientific software development. Students can't know they should be using version control, debuggers, and testing if they don't even know such things exist. [1] http://software-carpentry.org/ http://software-carpentry.org/
- jostmey 15y agoIncorporate the ability and require the usage of units! Problem partially solved :-)
- mclin 15y agoRather than building these data analysis/visualization programs from scratch each time, my thought is that scientists should instead be writing them as modules for a data workflow application like RapidMiner. If you haven't heard of RapidMiner, you basically edit a flowchart where each step takes inputs and outputs, eg take some data and make a histogram, or perform a clustering analysis. Video of someone demoing it: http://www.youtube.com/watch?v=TNESlvXp47E http://www.youtube.com/watch?v=TNESlvXp47E This way, the scientists can focus on the algorithms and not have to worry about all the other details of creating useable, maintainable software.
- ak217 15y agoIn bioinformatics, Galaxy (http://galaxy.psu.edu/ http://galaxy.psu.edu/) is a much better alternative.
- droz 15y agoDo you know of any other good data analysis applications similar to RapidMiner?
- mclin 15y agoI don't know any first hand, but other's I've heard of: Taverna: http://taverna.org.uk/ http://taverna.org.uk/ Trident: http://www.microsoft.com/mscorp/tc/trident.mspx http://www.microsoft.com/mscorp/tc/trident.mspx
- bugsbunnyak 15y agoKnime http://www.knime.org/ http://www.knime.org/. To a lesser (but free) extent, Orange http://orange.biolab.si/ http://orange.biolab.si/
- snissn 15y agothere'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 excuse for it, other than the usual, funding, or copyright / university IP
- neworder 15y agoThere 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 the other hand, if the paper is published, code is public and someone spot serious bugs, it's instantly a big shame... (code review as a part of peer review would help, but it's very unrealistic - already, reviewing is very time consuming). In addition, there are really no structural/institutional incentives to produce and share good quality scientific code. Maintaining good code costs much effort and, currently, gives few short-term benefits. It's often easier to produce crappy code, get the results, publish and move ahead.
- eru 15y agoWon't you get a citation, whenever somebody uses your code?
- starwed 15y agoTypically a review paper describing the software is what is actually cited, but yes! For instance, in my department there is a guy who maintains an astrophysical software package called Cloudy. The faq[1] describes how to cite it. (Unlike a lot of the software mentioned here, that project actually is open source, uses version control, and was migrated from the original Fortran to C++.) [1]http://www.nublado.org/wiki/FaqPage http://www.nublado.org/wiki/FaqPage
- gallamine 15y agoI'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 https://github.com/gallamine/Photonator) to help avoid some of these problems (lack of transparency). Even if nobody ever looks/uses the code, I know every time I do a commit there's a change someone MIGHT and I think it helps me write better code. The problem with doing science via models/simulation is that there just isn't a good way of knowing when it's "right" (well, at least in a lot of cases), so testing and verification are imperative. I can't tell you how many times I've laid awake at night wondering if my code has a bug in it that I can't find and will taint my research results. I suspect another big problem is that one student writes the code, graduates, then leaves it to future students, or worse, their professor, to figure out what they wrote. Passing on the knowledge takes a heck of a lot of time, especially when you're pressed to graduate and get a paycheck). There's got to be a market in this somewhere. Even if it was just a volunteer service of "real" programmers who would help scientists out. I spent weeks trying to get my code running on AWS, which probably would have taken a few hours from someone who knew what they were doing. I also suspect that someone with practice could make my simulations run at twice the speed, which really adds up when you're doing hundreds of them and they take hours each.
- pwang 15y agoThere is a market, and it's called libraries. Eventually you will use a language where software carpentry and code reuse is a core feature, and tested, modular libraries for not only core algorithms, but also deployment and dev-ops stuff (like managing a compute cluster on the cloud) will have standard approaches. This is starting to shape up on the Python side of things, but it has stagnated a little bit. People who can and do write the foundational code are oftentimes too focused on making the code work, and not at all focused on improving the quality of the ecosystem that their code is part of. Open Source is a great mechanism for many things, but polishing up the last 20% is not one of them.
- gallamine 15y ago
- ANH 15y agoFrom 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.
- pwang 15y agoGreg 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.
- pama 15y agoDropbox has invalidated this pitch.
- gallamine 15y agoI'm guessing Dropbox has introduced many a scientist to the wonders of code history/portability. I was pretty reluctant to move to Git when Dropbox worked fine.
- Periodic 15y agoThat'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.
- GoogleMeElmo 15y agoYes this is a huge problem. I am a software engineer working at a research institute for bioinformatic. The biggest problem I encounter in my struggle for clean maintainable code, is that management down prioritize this task quite heavily. The researchers produce code of questionable quality that needs to go into the main branch asap. Those few of the researchers that know how to code (we do a lot of image analysis), don't know anything about keeping it maintainable. There is almost a hostile stance against doing things right, when it comes to best practices. The "Works on my computer" seal of approval have taken a whole new meaning for me. Things go from prototype to production by a single correct run on a single data set. Sometimes its so bad I don't know if I should laugh or cry. Since we don't have a single test or, ever take the time to do a proper build system, my job description becomes mostly droning through repetitive tasks and bug hunting. It sucks the life right out of any self respecting developer. There, I needed that. Feel free to flame my little rant down into the abyss. :)
- tedjdziuba 15y agoI know of a company, made up of scientists from academia, that develops software by writing the code (or "codes" as they call it) in Microsoft Word documents and e-mailing them to eachother. Some how, they are still in business. True story.
- xxd 15y agoThis wouldn't be a healthcare startup in SF, would it?
- reinhardt 15y agoI shudder to think that such a "company" could be developing health-related software.
- w1ntermute 15y ago> writing the code (or "codes" as they call it) It's funny how this exact same mistake is made in the linked paper. For some reason, people outside of IT can't get it into their minds that "code" is an uncountable noun in this context.
- CurtHagenlocher 15y agoThis seems to be the standard in technical computing; people say "codes" instead of "code".
- notarealname 15y ago[New account for anonymity] An often neglected force in this argument is that many practitioners of "scientific coding" take rapid iteration to its illogical and deleterious conclusion. I'm often lightly chastised for my tendencies to write maintainable, documented, reusable code. People laugh guiltily when I ask them to try checking out an svn repository, let alone cloning a git repo. It's certain that in my field (ECE and CS) some people are very adamant about clean coding conventions, and we're definitely able to make an impact bringing people to use more high level languages and better documentation practices. But that doesn't mean an hour goes by without seeing results reverse due to a bug buried deep into 10k lines of undocumented C or Perl or MATLAB full of single letter variables and negligible modularity.
- gte910h 15y agoWhat I am hearing from you, is that we need to lobby the US government into open code requirement for grant work done under their purvey. Also some sort of git front end that unwilling people could use would make things better?
- dasil003 15y agoFor 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 and balances with the lofty goal of approaching bug impossibility at an organizational level. Unfortunately this type of evolutionary process is only viable for multi-year projects with 9-figure budgets. It's not going to work for the vast majority of research scientists with limited organizational support. On the positive side, such difficulty is also in the nature of science itself. Scientists already understand that rigorous peer review is the only way to come to reliable scientific conclusions over time. The only thing they need help with understanding is that the software used to come to these conclusions is as suspect as—if not more so than—the scientific data collection and reasoning itself, and therefore all software must be peer-reviewed as well. This needs to be ingrained culturally into the scientific establishment. In doing so, the scientists can begin to attack the problem from the correct perspective, rather than industry software experts coming in and feeding them a bunch of cargo cult "unit tests" and "best practices" that are no substitute for the deep reasoning in the specific domain in question.
- demian 15y agoI agree that correct software can not be achive by industry's practices. BUT isn't better to use "cargo cult best practices", as you call them, than code-and-fix without any kind of formal test or documentation? The hole point of these software programming practices is to improve overall quality with limited resources, not to craft perfect code.
- schleyfox 15y agoI'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.
- rflrob 15y agoWhere do most programmers get this exposure to best practices like version control, unit testing, etc? I took a few early-mid level CS classes, and there was a relatively cursory emphasis on readable code, there was barely any on any of the sorts of things that lead to well-maintained projects. If these are the sorts of things that one learns at your first internship, then it's no wonder that academics in other disciplines don't have any exposure to it.
- bendmorris 15y agoThe vast majority of students are never exposed to these concepts and those who are usually teach themselves. We've been teaching a class called "programming for biologists" that teaches practical skills that are needed in scientific computing - simple database use, version control, etc. - and we've seen huge demand from students and faculty members in many departments.
- JonnieCache 15y agoMaybe we can do an outreach program? Hackers adopting scientists?
- inuhj 15y agoAs a rising medical scientist I wish this were the case. It is, quite literally, a fantasy of mine.
- draven 15y agoI wish this kind of mentoring program would be implemented here (I work in a big research center). Often us programmers end up having to integrate code written by scientists in our apps, and it's a pain. Even a quick glance over the code is often enough to see some problems.
- radarsat1 15y agoI think there are multiple reasons for this problem, and only one of them is a lack of training in software management. Another problem is that science is an inherently exploratory procedure. You design an experiment, gather some data, and then go about analyzing it. You have an idea of what you'll find, but depending on what you get, you might need to then reformat/restructure the data, transform it, cut it up, etc. The problem is that this represents one of the worst problem cases in software design: evolving requirements. By itself this is bad enough. Recently I have been analysing data from a recent study. You start off with a data structure that you think represents things, but then you notice for example you need to synchronize several recordings; now you have to track time. You realize some recordings need to be split down the middle to aid in synchronization; now you need to add a 'part' field. You derive some value from several data points that takes a long time to compute, so you need to create a file to hold it. This needs to be kept in synch with the original data. Eventually you realize that text files aren't going to cut it; you start moving things to a database. Now you need to reconfigure your visualization program to read from the database. Then you realize that you want to add another similar derivative value, but this time it's a 3x3 matrix for each data point; time to extend the database again. etc.. etc.. Eventually you decide it would be best to really rewrite the codebase because it's becoming impossible to work with. Unfortunately the paper is due soon and you just need to generate a few more graphs.. And I didn't even mention the growing directory of scripts that aren't properly organized into modules, that end up with copy-pasted code because it's not very clear how to cleanly put this into a function, or which module it should belong to. Now, this is bad enough when you have a CS degree and have designed several software frameworks in your life. Combine this with someone who knows nothing about software architecture and you have a really big problem on your hands. My point is this: it happens to the best of us, no matter how hard you try to organizing things, when you don't have the requirements available ahead of time. The best approach I've found is to force myself to simply write functions as small as possible, that do one simple thing at a time. I try to break up functions as much as possible for reuse, and avoid copy-pasting code at all costs. Admittedly it's not always easy, sometimes a function that generates a particular graph just needs a certain number of lines of logic, and it's very difficult to modularize. Then you find that you want a similar graph but with a slightly different transformation on the Y axis... etc.. etc..
- sc68cal 15y agoThis is why partnering is key. I partnered up with a geneticist who understands his subject matter, while I can focus on my subject matter. The end result was a grant funded by NIH.
- arctangent 15y agoI think it is unreasonable to expect that a person will be a good programmer just because (a) they are a scientist and (b) their current project can be assisted by computers. Is it not sensible, perhaps, to have a dedicated group of programmers (with various specialities) available as a central resource to assist the scientists with their modelling? (I am imagining a central pool whose budget would be spread over several areas.) I personally love working on toy projects related to science. Maybe we hackers with time for that kind of thing should volunteer in some way to assist with the technical aspects of research that is directed by a scientist? I'm not sure I'd even care about getting a credit on a research paper so long as I could post pretty pictures and graphs on my blog...
- ajdecon 15y ago(Disclaimer: my background is in materials physics, and it may be different in other fields. But I doubt it.) Unfortunately there is very little direct incentive for research scientists to write or publish clean, readable code: - There are no direct rewards, in the tenure process or otherwise, for publishing code and having it used by other scientists. Occasionally code which is widely used will add a little to the prestige of an already-eminent scientist, but even then it rarely matters much. - Time spent on anything other than direct research or publication is seen as wasted time, and actively selected against. Especially for young scientists trying to make tenure, also the group most likely to write good code. Many departments actually discourage time spent on teaching, and they're paid to do that. Why would they maintain a codebase? - Most scientific code is written in response to specific problems, usually a body of data or a particular system to be simulated. Because of this, code is often written to the specific problem with little regard for generality, and only rarely re-used. (This leads to lots of wheel re-invention, but it's still done this way.) If you aren't going to re-use your code, why would others? - If by some miracle a researcher produces code which is high-quality and general enough to be used by others, the competitive atmosphere may cause them to want to keep it to themselves. Not as bad a problem in some fields, but I hear biology can be especially bad here. - Most importantly, the software is not the goal. The goal is a better understanding of some natural phenomenon, and a publication. (Or in reverse order...) Why spend more time than absolutely necessary on a single part of the process, especially one that's not in your expertise? And why spend 3x-5x the cost of a research student or postdoc to hire a software developer at competitive rates? I went to grad school in materials science at an R1 institution which was always ranked at 2 or 3 in my field. I wrote a lot of code, mostly image-processing routines for analyzing microscope images. Despite it being essential to understanding my data, the software component of my work was always regarded by my advisor and peers as the least important, most annoying part of the process. Time spent on writing code was seen as wasted, or at best a necessary evil. And it would never be published, so why spend even more time to "make it pretty"? I'm honestly not sure what could be done to improve this. Journals could require that code be submitted with the paper, but I really doubt they'd be motivated to directly enforce any standards, and I have no faith in scientists being embarrassed by bad code. Anything not in the paper itself is usually of secondary importance. (Seriously, if you can, check out how bad the "Supplementary Information" on some papers is.) But even making bad code available could help... I guess. And institutions could try to more directly reward time put into publishing good code, but without the journals on board it may be seen as just another form of "outreach"--i.e., time you should have been in lab. I did publish some code, and exactly two people have contacted me about it. That does make me happy. But many, many more people have contacted me to ask about how I solved some problem in lab, or what I'm working on now that they could connect with. (And are always disappointed when I tell them I left the field, and now work in high-performance computing.) Based on the feedback of my peers... well, on what do you think I should've spent my time?
- gwern 15y agoThere are a lot of suggestions that the code and data be required to publish. Sorry guys, but that hasn't worked so far: the economics journal _Journal of Money, Credit and Banking _, which required researchers provide the data & software which could replicate their statistical analyses, discovered that <10% of the submitted materials were adequate for repeating the paper (see "Lessons from the JMCB Archive", Volume 38, Number 4, June 2006). Oops.
- gwern 15y agoAn interesting citation http://portal.acm.org/citation.cfm?id=188228 http://portal.acm.org/citation.cfm?id=188228 : > This paper describes some results of what, to the authors' knowledge, is the largest N-version programming experiment ever performed. The object of this ongoing four-year study is to attempt to determine just how consistent the results of scientific computation really are, and, from this, to estimate accuracy. The experiment is being carried out in a branch of the earth sciences known as seismic data processing, where 15 or so independently developed large commercial packages that implement mathematical algorithms from the same or similar published specifications in the same programming language (Fortran) have been developed over the last 20 years. The results of processing the same input dataset, using the same user-specified parameters, for nine of these packages is reported in this paper. Finally, feedback of obvious flaws was attempted to reduce the overall disagreement. The results are deeply disturbing. Whereas scientists like to think that their code is accurate to the precision of the arithmetic used, in this study, numerical disagreement grows at around the rate of 1% in average absolute difference per 4000 fines of implemented code, and, even worse, the nature of the disagreement is nonrandom. Furthermore, the seismic data processing industry has better than average quality standards for its software development with both identifiable quality assurance functions and substantial test datasets.
- gwern 15y agoThere's a later paper available for reading: http://www.leshatton.org/Documents/Texp_ICSE297.pdf http://www.leshatton.org/Documents/Texp_ICSE297.pdf
- salva_xf 15y agoCould be that they are not using the correct language, If they have some domain specific language on top of common lisp for example, they will have much better code with less work, i think
- cool-RR 15y agoMy approach is to have the scientist write as little code as possible. That's why I'm working on GarlicSim: http://garlicsim.org http://garlicsim.org GarlicSim's goal is to do all the technical, tedious work involved in writing a simulation while letting the scientist write only the code that's relevant to his field of study.
- gte910h 15y agoIs there a git client for the unwilling? I could see that solving some of the issues.