20 ms·
To software engineers criticizing Neil Ferguson’s epidemics simulation code
- cheerlessbog 7y agoThe author makes it sound like a warning label is missing from the C++ tin. Maybe. But what tool should he have used? I haven't seen this code but is there any doubt it would look just as bad in Java or Python, maybe with fewer segfaults? Or FORTRAN.
- dirtydroog 7y agoI'm genuinely surprised it wasn't an Excel spreadsheet.
- 1_over_n 7y agohttps://www.semanticscholar.org/paper/Chicken-Chicken-Chicken-%3A-Chicken-Chicken-Zongker/365e06d677cbf832a6f782aa3db0e49ddbdd1ae2 https://www.semanticscholar.org/paper/Chicken-Chicken-Chicke...
- DavidHm 7y agoA well executed Excel model is much easier to explain to a non-technical person. To be frank, for all the snobbery towards Excel, it has done a marvelous job at getting millions of people to think in more quantitative ways instead of "business acumen".
- mcv 7y agoI haven't seen the code, but from what I read, it may well have been better to have done this in an Excel spreadsheet. Of course we all would have been just as horrified at that.
- AzzieElbab 7y agoWell, according to some reviews the model did run into problems specific to amateurish use of c/c++. Specifically, it produced different results when running on CPUs with different number of cores and even single core but different CPUs
- htk 7y agoI get what he’s saying, but the “non-experts” using code to represent their models should also let outside help come when the need arises. When your model predicts an apocalyptical scenario and government is taking drastic measures based on it, it’s a good time to expose your “non-expert code” to the software engineering communities (and all other associated fields) to take a look.
- ptheywood 7y agoThis is starting to happen through Research Software Engineers, although as it is still a (relatively) new movement within academia. https://society-rse.org/ https://society-rse.org/ https://www.software.ac.uk/ https://www.software.ac.uk/
- scarmig 7y agoI looked at the job vacancies posted on the Society for Research Software Engineering. Those with salaries listed: Senior RSE, London: £35,965 to £52,701 Web Application Developer, London: £35,965 to £43,470 Research Software Engineer, Hannover: Salary Scale 13 TV-L (AFAICT this is €41259 to €59545) I'm the type to be happy to take a pay cut, especially if there are work-life advantages involved. But a 80%-90% cut is asking a bit much. It's not like London's a particularly cheap place to live, either. Not sure how to fix it.
- JamesBarney 7y agoI don't think the government is taking drastic measures based solely on this code. It's just a way to model facts we already know. We know that viruses spread exponentially, and we know what exponential growth looks like this just lets use model different assumptions to see how they affect that model.
- noobaccount 7y agoThe model is way more granular than that. Have you read it?
- llarsson 7y agoNot a comment on the specific repo in question, but I just want to note that I have seen utter monstrosities of academic code written in Python, MATLAB, and R - languages that are ostensibly "easier" than C++. I so not think that poor code quality is due to the many footguns C++ admittedly gives you. I am sure that the main research is not in the implemented code. But with unclear code, it is exceedingly hard to know that there are no mistakes: that the researched models have been properly encoded. That, I believe, is what software engineers are afraid of.
- zozbot234 7y agoI'm not sure I would describe R as "easier" than C++ tbh.
- disgruntledphd2 7y agoIt's much more accessible, as you need to know less to use it. Consider - using Eigen in a C++ project, or calling install.packages("eigen") in R.
- veddox 7y agoIt's easier to dip your toes into, but it is a terrible language to learn software development with. It's such a hodge-podge of ill-thought-out and ill-fitting components with random names and no overall sense of structure that you're never going to learn core CS concepts from it, let alone good programming practice.
- disgruntledphd2 7y agoThat's not really its purpose though, right? R is "an environment for statistical computing and graphics". Note that it doesn't talk about software engineering at all. I agree with you that R has lots of rough edges, but please remember that it's a 90's era clone of a 70's era language (S) and a lot of those rough edges and corners are legacies from that time. I completely agree that the naming conventions (i.e. the absence of same) are super annoying, but again it's a tradeoff for the decades of statistical computing knowledge embedded in the system of R. I find your disdain for R a little annoying, and while I'm probably not a computer scientist, it was my first language and I learned about closures, higher order functions, OOP, testing and interacting with API's from it, and it definitely gave me insight into how computers worked. I'm sorry that you have to deal with horrible legacy R code, but that's no reason to throw the baby out with the bathwater.
- bJGVygG7MQVF8c 7y agothis is quite off the mark. the author sets the bar too low for himself by criticizing the most easily (and to be fair legitimately) dismissed criticisms of the Imperial College model. here's a better laid-out critique that the OP doesn't speak to: The Imperial College modelers released the source code a couple of days ago to the model that shut down the world economy. It's not the original model code but was rather original source code turned over to volunteer programmers who re-wrote it so that is more readable. I have done some model review of financial models in the past but without the source code I would not be able to do a full review of the Imperial College model. Now that we have the source code (sort of), I can. Any such model ought to have been independently reviewed before it is ever used for real policy decisions. Policy analysis is awash in models but no one ever really checks them. Going forward, health policy makers should ask for and disclose independent validation of any model before using its results to make recommendations of any consequence. Normally, model reviews are long technical documents but there would also be a summary section. Here's what I think a summary should have looked like. Overall conclusion: this model cannot be relied on to guide coronavirus policy. Even if the documentation, coding, and testing problems were fixed, the model logic is fatally flawed, which is evidenced by its poor forecasting performance. https://www.facebook.com/scarlett.strong.1/posts/252437219500976 https://www.facebook.com/scarlett.strong.1/posts/25243721950...
- wrsh07 7y agoIt's worth noting that in a pandemic situation, waiting before taking action is "making a decision" Shutting down the economy is costly, yes, but allowing a virus to continue its exponential growth with all of the unknowns that entails is much more costly in expectation (we can only speak in expectation given the unknowns) Whether or not this model should have been the basis for such a decision I don't know, but it's important to keep in mind that taking proactive steps in a pandemic is conservative
- SpicyLemonZest 7y agoThe government wasn't waiting before taking action. The Imperial report was impactful because it said that the government's actions were insufficient, that if they continued on with only moderate social distancing people would die in the streets for lack of hospital beds.
- hamandcheese 7y ago> Consider what you, as a client, expect from engineers in other domains. You expect cars to be safe to use by anyone with a driver’s license. You expect household appliances to be safe to use for anyone after a cursory glance at the instruction manuals. It is reasonable then to expect your clients to become proficient in your work just to be able to use your products responsibly? Worse, is it reasonable to make that expectation tacitly? I don’t buy this argument. Cars are safe, yes. C++ isn’t the car, though. C++ is the dangerous machine shop you use to build the car. A better analogy would be comparing a car to a web browser, and indeed incredible effort has been put into keeping web browsers secure.
- 1_over_n 7y agoThe scientific method is supposed to be reproducible. Others should be able to follow the steps and arrive at the same outcome. Scientsits working in wetlabs are not publishing papers on what they do in a language only they can understand and expecting others to blindly trust the results and conclusions.
- JamesBarney 7y agoThis is definitely happening except the language is hard to follow excel.
- LoSboccacc 7y ago> It’s you, the software engineering community, that is responsible for tools like C++ that look as if they were designed for shooting yourself in the foot. wait what. a fraction of the community might be a pretentious bunch of purist, but I don't think it's fair to criticize them for the tooling selection one wouldn't pick a excavator just because it's the industry standard for moving earth to plant some tulip in a vase and even if funding is scarce, google is free: the first result for planting tulips returns a bulb planter, not a bulldozer.
- flankstaek 7y agoThis letter feels as though it is overlooking a large point of contention. >The scientists who wrote this horrible code most probably had no training in software engineering, and no funding to hire software engineers Shouldn't the argument be, that for research that is reliant on coding models, funding be allocated to experts that can assist in creating said models (software engineers)?
- deleted 7y ago[deleted]
- klenwell 7y agoThe conclusions from the first critical code review cited: All papers based on this code should be retracted immediately. Imperial’s modelling efforts should be reset with a new team that isn’t under Professor Ferguson, and which has a commitment to replicable results with published code from day one. On a personal level, I’d go further and suggest that all academic epidemiology be defunded. This sort of work is best done by the insurance sector. Insurers employ modellers and data scientists, but also employ managers whose job is to decide whether a model is accurate enough for real world usage and professional software engineers to ensure model software is properly tested, understandable and so on. Academic efforts don’t have these people, and the results speak for themselves. https://lockdownsceptics.org/code-review-of-fergusons-model/ https://lockdownsceptics.org/code-review-of-fergusons-model/
- rscho 7y agoYeah really, why don't we leave out all modelling duties to companies who optimize for more money instead of leaving it with the only actor trying to optimize towards actual public health? What could go wrong?
- SpicyLemonZest 7y agoIf you're willing to dismiss all companies as optimizing for more money, it seems only fair to say that academics optimize for prestige and publication in good journals.
- silveraxe93 7y agoI disagree so strongly with this that I had a visceral reaction while reading it. C++ is a tool, not an end product. If you're not qualified to use a tool correctly it's not the manufacturer's fault, it's yours. Why do so many people believe that good software development is not part of their job? If you write code then you're a developer, no matter your job title. If you write shit software, saying you're a researcher is not an excuse.
- lucideer 7y agoThis is such a ridiculous comment I don't know where to start. Are you actually proposing that being a fully experienced & knowledgeable software engineer should be a base requirement for all academic research (in any field)? If you, working as a software engineer, were told tomorrow by your manager that you needed to perform heart surgery, and that that now fell under your responsibilities in your current role, would your argument be the same? The private sector's typical response to the problems in the article would be to hire qualified software engineers to assist researchers. Funding dictates this is impossible, so they make do.
- moron4hire 7y agoNo, your analogy is definitely the most ridiculous thing here.
- pbourke 7y ago> Funding dictates this is impossible, so they make do. Put another way: software quality is not valued in academia. Let’s say the code in question was in great shape. Would it have mattered at all in the trajectory of anyone’s career? No. This is probably the one academic code base in a million that has received any negative reputational hit due to its quality.
- TeMPOraL 7y ago> software quality is not valued in academia. And in general, it shouldn't. Code written by scientists is almost always throwaway prototypes. So it absolutely doesn't matter how decoupled, or easy to extend it is. The only aspect of quality that matters here is the simplicity, in the sense "it obviously has no bugs" (and related practices like testing). This is something that could be taught, but I think it should be also addressed from the other end of the spectrum - more pressure put on verification and reproducibility of results.
- rjtobin 7y agoI'm somewhat skeptical. Firstly, I don't think the language is the problem with scientific code. You can write messy code in any language. So the warning then has to be about writing software in general. In that case, I think a warning like "don't try to write software unless you have years of training" is a bit much. Many people with no training learn to write nice code. Many projects made by amateurs might have ugly code but still add something to the world (eg. many games). The problem here is the project is influencing decisions in healthcare. Having worked in HPC and academia, I've seen code like this a lot. There are two archetypes I've noticed: (1) the well-meaning older academic maintaining legacy code, who have often done a lot of convergence testing, but still have code that isn't up to modern engineering practices, and (2) the domain experts with the attitude that "programming is much easier than my area of domain expertise". These are problems that require attitude changes within academia, not better warnings on online tutorials. The second group are going to ignore the warnings anyway. Remember many of the people writing this academic code also teach programming courses in their departments! They view themselves as programming experts.
- hpoe 7y agoI'd like to point out I've met a lot of software engineers that subscribe to two in reverse. "This domain area of expertise is much easier than programming, ergo I am qualified to solve it."
- mcv 7y agoI think it's true of many experts, that they see their own area of expertise as the most important one, and the others as relatively minor.
- silveraxe93 7y agoThis model didn't just influence decisions in healthcare. It single-handedly changed the UK government's strategy over this pandemic. From what I understand the UK was planning on beating COVID by creating herd immunity, similarly to Sweden. Then this model came out and everyone started yelling that Boris wanted to kill your grandma. The problem is that it's impossible to have an intelligent discussion over this. This pandemic became a partisan issue. We're not discussing whether one of the most impactful decisions made by a government this generation should be based over absolute trash code. You're either uncritical of the lockdown or "anti-science".
- airlines55 7y agoOh not not the heckin scientists. They are always right! Dang it guys it's our fault, not Science. I just wish it was 1801 again so we could parade around streets once more in worship of the god of Rationality!
- orbifold 7y agoScience is inherently a low stakes game. Most scientists are competing for budgets of no more than a few million a year, if they are really successful. There is little reward for producing excellent code, but a lot of reward for producing atrocious code to publish in prestigious journals. If you want to be truly horrified look into the practices surrounding NEURON, a simulation tool that has been used to publish simulations since the 80s. You have to write code in a domain specific language called Hoc, that code is typically littered with hard coded constants. Code is copied over from one paper to the next, etc. Code is a means to an end, not something that is held in high regard. Moreover improving someone else's code style or quality won't earn you a degree or praise. Starting a competing "higher quality" project is bound to annoy or anger the establish players. It will be hard to get funding for it, because those players will likely review your proposal. In any case there is typically a 10-20 year gap between the people doing any decisions and the people actually doing any practical work. Finally in some cases code is a competitive advantage, I'm sure that Neil Ferguson has churned out quite a few papers with the same framework by simply tweaking some things here and there. In that case you are ill advised to share the code with anyone.
- chasd00 7y agothey need to defer to the experts of software development. I, as a software engineer, wouldn't try to design an epidemic model, i would defer to experts. Epidemic experts shouldn't be writing the implementation of their model, they should defer to the experts. Also, "It’s you, the software engineering community, that is responsible for tools like C++ that look as if they were designed for shooting yourself in the foot. It’s also you, the software engineering community, that has made no effort to warn the non-expert public of the dangers of these tools" that's a bit much. if someone buys a lathe, gets it home, flips the switch and tears off an arm are machinists to blame?
- veddox 7y ago> Epidemic experts shouldn't be writing the implementation of their model, they should defer to the experts. Believe me, a lot of scientists would love to. But as pointed out in the OP: it is next to impossible to get funding for a paid software developer position in a research team. It's a problem the scientific community is increasingly aware of, but changing funding guidelines takes a long time. (Source: computational biologist)
- chasd00 7y agoThat's a fair point. Also, passing judgement on source code is a very easy thing to do. May he who writes/maintains perfect code cast the first stone.
- downerending 7y agoMost scientific software isn't of subtly poor quality. Most scientific software is a stinking, flaming dumpster fire that looks like it was written by packs of drunk kindergartners.
- zaphar 7y agoThe lathe is almost guaranteed to come with a long list of warnings and an entire section of the manual devoted to safe use. Learn C++ resources tend to not come with those sections in the same detail nor are they usually front and center.
- zozbot234 7y agoLook, the software engineering community has switched to Rust by now. If you're still using C++, that's your problem. Don't blame us.
- dahnhiller 7y agoPublicly funded science should in almost all cases make the software underpinning it publicly available. Otherwise, how are results reproducible, verifiable or open to peer review?
- tkiley 7y agoI poked at the github repo for a bit. The ugliness of the code doesn't bother me, but the quantity of parameters does. Here's one params file that specifies some of the inputs to a run of the model: https://github.com/mrc-ide/covid-sim/blob/master/data/param_files/p_PC7_CI_HQ_SD.txt https://github.com/mrc-ide/covid-sim/blob/master/data/param_... Here's another one: https://github.com/mrc-ide/covid-sim/blob/master/data/admin_units/United_States_admin.txt https://github.com/mrc-ide/covid-sim/blob/master/data/admin_... There are hundreds of constants in there. A lot of them appear to be wild-ass guesses. Presumably, all of them affect the output of the model in some way. When a model has enough parameters for which you can make unsubstantiated guesses, you have a ton of wiggle room to generate whatever particular output you want. I'd like to see policy and public discussion focus more on the key parameters (R-naught, hospitalization rate, fatality rate) and less on overly-sophisticated models.
- wbhart 7y agoThe problem is, unsophisticated models do not predict anything. You apply them in one country and they do ok, and apply them in another and they get it totally and completely wrong. Unless all important factors are accounted for, they are going to result in incorrect information for someone. Public policy will then be based on incorrect predictions. People will grow tired of the predictions being wrong and they'll give up on data science entirely. It's already quite bad that people think they can choose their reality by finding numbers that agree with them and ignoring the ones that don't. I do understand the point you are making, which is like the epicycles argument. But in global warming and epidemics alike, more parameters are actually needed to model reality. I do agree that those parameters should be based on actual data, not guesses though. But what value of R would you pick? Is that actually well-constrained?
- tkiley 7y ago"But what value of R would you pick?" I don't know -- and until we can agree on the answer to your simple question with a high degree of confidence, I think complex models based on specific assumed values of R obscure more than they reveal. A little bit of modeling is useful because humans are intuitively bad at exponential math and we need scary graphs to jolt us awake sometimes. But when we don't even know the basic parameters (transmission/hospitalization/fatality) with a high degree of precision, complex models with myriad parameters create a false sense of confidence.
- mkirch 7y agoAbsolute cringe, this was hard to read. Seems like a blatant shift of responsibility. At what point do people have to take responsibility and stand by their creations, regardless of what has been spoon-fed to them?
- Nursie 7y agoI think the reason I find this so objectionable is that he's focused on a tool for doing the job of software engineering, and then blamed software engineers for not making it easy for him. There's a spot-on comment on there at the moment - this isn't the car that's ready to use by anyone with a license. This is the welding gear we use to put bits of car together. You walked into the machine shop here, used some of our tools and made something that wasn't safe. If scientists are not software engineers, and do not have the time or the motivation to become software engineers, perhaps they shouldn't play at being software engineers?
- ak217 7y agoMany senior members of the academic community rely on their reputation as researchers to brush aside basic issues with the software that they develop for scientific purposes. These include the lack of testability, debuggability, reproducibility, separation of concerns, documentation, or usability. The lack of focus on research software quality among senior PIs, funding committees, and article reviewers is a huge problem in academia. The problems with the Ferguson model and codebase are just the latest prominent example of this. The tools that academics have access to are excellent. If you compare the free support academic software developers receive from the rest of their community to other engineering disciplines, it's beyond great. I think the OP is wrong to suggest otherwise. The problems with the Ferguson model are an opportunity to educate more members of the community about the fact that good software development practices are not optional for good science, and that senior members of the community jeopardize their own reputation by not paying attention to them.
- veddox 7y ago> If you compare the free support academic software developers receive from the rest of their community to other engineering disciplines, it's beyond great. Could you elaborate on what you mean by that?
- rjsw 7y agoNot the OP, but I know of at least one University that runs "Programming for scientists" courses at low or no cost.
- fsh 7y agoThese courses are usually short introductions into python or Java. Most scientists simply don't have time in their curriculum for a full software engineering course.
- rjsw 7y agoI didn't claim they were good. My father is doing a Python one right now and I'm not very impressed. He is retired from the University but is still eligible to take the course.
- raverbashing 7y agoWhat we're missing is an "open letter" of scientists criticizing software engineers evaluation of this model. Because it seems no one of these critics have ever coded anything to do with stochastic forecasting or simulations. "The code produces different results between runs" well, I would be very worried if it didn't, unless your RNG has a fixed seed, and all randomness in your model derives from it (so, if you use multiple threads, there goes your repeatability - which is fine). Also, you want multiple runs to be different, so you can establish best/worse case scenarios (also tuning some of the parameters). Does the model pass basic sniff tests? (for example, no more infected people than the population of a place? does it follows known pandemic curves? Can the parameters be reasonably tuned to fit its behaviour in existing places?) And yes the model was checked against a different model from what I remember. In essence, if you take Population x (percentage for herd immunity) x IFR you can get a very good estimate of the worse case scenario for deaths. Then you can see if your model goes to that value given the known parameters. Yes, the code is ugly. Yes you probably made worse code at a point in your career.
- enitihas 7y agoSo government can spend billions and trillions on implementing covid19 related policies, but can't spend any money on getting good data for the same? The fact that government policy is driven by some unpublished, undocumented, non repeatable code, affecting the lives of an entire nation, should be treated as a national defence issue. Anyone saying the person writing this was not a software engineer is giving a poor excuse. Government shouldn't appoint random people to do random jobs and in case of poor results say they weren't a trained XYZ. The people deserve a better process.
- asddsfgdfsh 7y agoEverything is fine. You get what you pay for.
- growlist 7y agoLaughable nonsense, and especially glib when there are lives on the line due to the question of competence/lack of it. One thing I'm surprised not to have seen yet - as a MSc Geographic Information Science grad - is criticism of the methdology from a GI science aspect. And the question that I have is: where is the proof that this model's results are in any way representative of reality? Surely Professor Ferguson - before releasing results that have the potential to turn economies upside down, and with thousands of lives at stake - would have run this against some real world data to validate the model. Or not? If not, why should we listen to anything he says ever again?
- m0llusk 7y agoThat is a reasonable problem statement and proposed solution, but the problems with software engineering go very deep. That is why so many software projects fail outright. Just as we acknowledge that aviation engineering has different risks and constraints from basic tool building so we all need to understand that at least for now and likely for some time software development will be inherently messy and risky for all who dare it.
- dekhn 7y agoI chuckled when I saw the author of this article. Many years ago I was a scientist (PhD student) writing code in Python, but wanted to use features in Mathematica like symbolic integration. Turns out Mathematica has a C API that lets you send Math expressions to it and evaluate them. I wrote a clunky Python interface and shared it with Konrad Hinsen, who looked at it and suggested an elegant recursive object representation of Math objects in Python that led to automatic conversion between Python and Mathematica, massively simplifying the code and making it more elegant. I got slightly better at software engineering that day.
- motohagiography 7y agoI'm trying to be charitable on this code base issue, and the institutions will need to accept they need to be able to bear more scrutiny on the inputs to policy recommendations. Both R and Python are taught in highschool and undergraduate courses for scientific data analysis. Ferguson and other scientists did not need software engineers. A free co-op student, or to have spent the three weeks learning a language that met the needs of the level of abstraction he was working at would have sufficed. The culture that enables that code as described to be acceptable for policymaking is one that intentionally produces complex black boxes that obfuscate risk and attribution, and to launder decision accountability through technology. I've seen this in other institutional code as well. However, while the policy recommendations that resulted from his model may (or may not) have saved tens of thousands of lives, it did so at the risk of losing the credibility to do it again. Deflecting blame to nebulous software engineers is disingenuous and serves mainly to exacerbate the suspicions of reasonable people, and further polarize those most harmed by the policy response.
- disgruntledphd2 7y agoI honestly don't think R and Python would have worked here. While I was able to clone the repo and run it for Ireland, the UK requires at least 26Gb of RAM, which is not common on most personal computers. The US requires much, much more. And given that it's pretty slow when written in C++, imagine how slow it would have been in R or Python? I agree with you in principle with respect to this stuff being better, but the incentives skew otherwise at the moment.
- Nursie 7y agoGiven we're talking about something that it seems people say does not have good code quality, I would guess that whether the C++ implementation is more efficient due to language choice would be a wide open question.
- silveraxe93 7y agoAny serious attempt at modelling this over python would use the pydata stack (numpy, pandas, etc), which run on top of C++ anyways.
- jstewartmobile 7y agoWith all due respect, Konrad can go f himself. Plenty of performant, non-foot-gun, alternatives to C++ these days. The choice of that language, and any abuses of it fall entirely upon Ferguson and his team. And for this nugget: “It’s also you, the software engineering community, that has made no effort to warn the non-expert public of the dangers of these tools.” I say he deserves it without lube. Hardly a day goes by on Lobsters or HN where we (including many C++ devs) don’t complain at great length on what a reeking dumpster fire C++ is.
- commandlinefan 7y ago> A clear message saying “Unless you are willing to train for many years to become a software engineer yourself, this tool is not for you.” If you say anything along those lines, you'll be dismissed as a "gatekeeper".
- gammarator 7y agoWhether the Imperial code is good or bad doesn't actually matter: you can derive the headline numbers analytically, without any simulation at all [1]. (The real problem with the worst case estimate is that it assumes people don't individually change their behavior in the face of a pandemic.) A better critique of the software engineering criticism is [2]. [1] https://twitter.com/trvrb/status/1258879531022082049 https://twitter.com/trvrb/status/1258879531022082049 [2] https://philbull.wordpress.com/2020/05/10/why-you-can-ignore-reviews-of-scientific-code-by-commercial-software-developers/ https://philbull.wordpress.com/2020/05/10/why-you-can-ignore...
- mcv 7y agoWhat a collection of terrible arguments. I'm afraid I can't help myself here. I've got to eviscerate this USENET-style: > "The scientists who wrote this horrible code most probably had no training in software engineering, and no funding to hire software engineers. And the senior or former scientists who decided to give tax-payer money to this research group are probably even more ignorant of the importance of code for science. Otherwise they would surely have attributed money for software development, and verified the application of best practices." Let's start with the observation that this is indeed the main problem here. Planning research that requires software to be developed, without accounting for software development, is a terrible idea. There's a good reason why scientific programmers exist: to help researchers write the code they need for their scientific projects. Hire one if you need one. Don't blame someone else if you forget to do so. > "It’s you, the software engineering community, that is responsible for tools like C++ that look as if they were designed for shooting yourself in the foot. It’s also you, the software engineering community, that has made no effort to warn the non-expert public of the dangers of these tools." Excuse me? The internet is riddled with jokes about how easy it is to shoot yourself in the foot with C++. Of course you can shoot yourself in the foot with any programming language, but C++ excels at it. Many programmers avoid it because they don't want to have to manage their own memory. Follow their example and use something that focuses on the problem area you want to focus on. > "You know, the kind of warning that every instruction manual for a microwave oven starts with: don’t use this to dry your dog after a bath." Anyone who needs that kind of warning is a danger to themselves and others. A scientist who lacks this level of common sense should seek guidance from someone who has it. > "A clear message saying “Unless you are willing to train for many years to become a software engineer yourself, this tool is not for you.”" Software engineer is a serious profession that requires lots of training. Should any idiot expect to whip up their own epidemic simulation without knowing what they're doing and expect reasonable results? > "But power comes with responsibility. If you want scientists to construct reliable implementations of models that matter for public health decisions, the best you can do is make good tools for that task, but the very least you must do is put clear warning signs on tools that you do not want scientists to use" Is it unreasonable to expect someone who needs tools, to either research what tools are suitable for their needs, or otherwise ask advice from an expert on those tools? Nobody grabs just a random tool from their toolbox to solve a specific problem. If it's a nail, you grab a hammer, if it's a screw, you use a screw driver. > "scientists are not software engineers, and have neither the time nor the motivation to become software engineers." Then hire one. Don't blame your lack of motivation on others. > "Consider what you, as a client, expect from engineers in other domains. You expect cars to be safe to use by anyone with a driver’s license." Yeah, with a driver's license. We don't let random idiots drive off in a car, we expect them to learn how to drive first. If you want to use C++, you're going to have to learn about memory management. If you don't want to do that, get a different language. > "You expect household appliances to be safe to use for anyone after a cursory glance at the instruction manuals." Is that cursory glance going to be enough to tell them not to put their dog in a microwave? At least C++ is not going to kill your dog. > "It is reasonable then to expect your clients to become proficient in your work just to be able to use your products responsibly?" They can use our products just fine, but if they want to use our tools, they need to learn how to use them. Should toolboxes now contain warning labels not to build your own car from scratch? Or not to use these tools to repair a nuclear reactor? It's absolutely valuable to learn how to use tools, but if you just grab random power tools without knowing what you're doing, and without being willing to learn to use them, you're likely to lose a limb. Finally, if you're really looking for a programming language to let scientists play around with, try Python. It's designed to be easy to learn, and it's also very suitable for all sorts of scientific modeling. There's a good reason it's popular in research. I still recommend putting some effort in learning to use it.
- stephc_int13 7y agoCould someone give a short example of some ugly code in this repo? I've quickly looked and I did not find anything clearly uglier than what I have seen in 99% of online repositories... Quite the contrary, to be honest.
- Luc 7y agoJohn Carmack has reviewed the code and didn't seem to find it all that bad, so there's that. https://twitter.com/ID_AA_Carmack/status/1258192134752145412 https://twitter.com/ID_AA_Carmack/status/1258192134752145412 https://twitter.com/ID_AA_Carmack/status/1244302925855326209 https://twitter.com/ID_AA_Carmack/status/1244302925855326209
- veddox 7y agoThat's a valuable pointer, thanks for sharing :-)
- brigandish 7y agoReally? > Imperial are trying to have their cake and eat it. Reports of random results are dismissed with responses like “that’s not a problem, just run it a lot of times and take the average”, but at the same time, they’re fixing such bugs when they find them. They know their code can’t withstand scrutiny, so they hid it until professionals had a chance to fix it, but the damage from over a decade of amateur hobby programming is so extensive that even Microsoft were unable to make it run right. That's from the first analysis[1]. There's a follow up[2]: > Sadly it shows that Imperial have been making some false statements. and > It’s clear that the changes made over the past month and a half have radically altered the predictions of the model. It will probably never be possible to replicate the numbers in Report 9. [1] https://lockdownsceptics.org/code-review-of-fergusons-model/ https://lockdownsceptics.org/code-review-of-fergusons-model/ [2] https://lockdownsceptics.org/second-analysis-of-fergusons-model/ https://lockdownsceptics.org/second-analysis-of-fergusons-mo...
- Joeboy 7y agoYes. John Carmack says the code is OK, some anonymous person on the lockdownsceptics.org website says it's a flaming heap of garbage. For what it's worth I looked into some of the tickets linked in those articles and concluded the author is, broadly speaking, full of shit. I am nobody in particular though.
- brigandish 7y ago
- s9w 7y agoC++ is hard, therefore they're allowed to publish such rubbish and destroy trillions of dollars as a consequence? Critical code is written all the time. It can be expected with such decisions.
- veddox 7y agoWell, it looks like one of the biggest problems in computational biology has finally blown up in our face. I work in a very similar field to the one discussed here - ecosystem modelling. And much of the code I see is probably of a similar quality to Neil Ferguson's model. (Although I haven't had a detailed look at his work.) For all you angry devs out there, I have three comments: 1. Yes, we have a problem with code quality, and no, this should not be acceptable where policy-relevant decisions of such magnitude are concerned. (Although one should bear in mind that all science is flawed and its achieved reliability will always be limited by constraints of time/budget/etc.) 2. However, changing the status quo is really hard. Specifically, the two greatest changes that are needed are to teach proper software development practices to students in the natural sciences (just like we teach lab technique), and/or make it easier to get funding for software developer positions in a research team. This sounds easy, and ought to be easy, but both run counter to some pretty entrenched ideas held by the "old folks at the top" in universities and funding bodies. (Believe me, I'm speaking from experience :-/ ) 3. But yes, we are working on it. The debate is growing, and there's a new generation of computational biologists with much closer ties to computer science who are trying to shake things up a bit. In some sense, we are several decades behind the wider CS world in the techniques we use, but we're catching up. And at the same time, we're starting to develop some of our own methods of quality control (such as pattern-oriented modelling).
- veddox 7y agoIf you're interested, here is some further reading: * DeAngelis, D. L., & Grimm, V. (2014). Individual-based models in ecology after four decades. F1000prime Reports, 6(June), 39. https://doi.org/10.12703/P6-39 https://doi.org/10.12703/P6-39 * Grimm, V., Berger, U., DeAngelis, D. L., Polhill, J. G., Giske, J., & Railsback, S. F. (2010). The ODD protocol: A review and first update. Ecological Modelling, 221, 2760–2768. https://doi.org/10.1016/j.ecolmodel.2010.08.019 https://doi.org/10.1016/j.ecolmodel.2010.08.019 * Grimm, V., & Railsback, S. F. (2011). Pattern-oriented modelling: A ‘multi-scope’ for predictive systems ecology. Philosophical Transactions of the Royal Society B, 367(1586), 298–310. https://doi.org/10.1098/rstb.2011.0180 https://doi.org/10.1098/rstb.2011.0180 * Nowogrodzki, A. (2019). How to support open-source software and stay sane. Nature, 571(7763), 133–134. https://doi.org/10.1038/d41586-019-02046-0 https://doi.org/10.1038/d41586-019-02046-0 * Wilson, G., Bryan, J., Cranston, K., Kitzes, J., Nederbragt, L., & Teal, T. K. (2016). Good Enough Practices in Scientific Computing. 1–30. http://arxiv.org/abs/1609.00037 http://arxiv.org/abs/1609.00037
- madhadron 7y agoI just took a quick skim through the repository and I'm not quite sure what everyone is so upset about. It looks like simulation code. I would argue that the real problem isn't C++ but tooling that is aimed at producing source code as an artifact as opposed to repeatable executions as artifacts. There are effectively lots of models in this system, and the code represents all of them tangled together. But that means that you have source code, parameters, tracing, and output as a thing.
- jonnadul 7y agoInstead of complaining about code quality, shouldn't SE's jump in and support academia in writing better code?
- lukeex 7y agoBridges are designed, built, tested, and verified as fit for purpose. Planes are designed, built, tested, and verified as fit for purpose. Why should software models that inform policy be excluded from those requirements? What is the expected cost of failure - it seems that critical risk controls are missing from academia - in the case that they are wrong. The case in hand - is problematic because it highlights that lack of controls that are present and that should probably be present when building models and simulations to inform policies. Quality control is important in nearly every other industry - the lack of quality controls in academia appears to be the root cause to me. Rather than particular language/build choices.
- btrettel 7y agoAs a researcher, if I want to find a software engineer willing to review my code for free (I have no budget for this), how should I find one? The article says > We can’t ask software experts for a code review every time we do something important. but I think there are people who'd be willing to give at least 15 minutes of their time to review scientific software once.
- luord 7y ago> Consider what you, as a client, expect from engineers in other domains. You expect cars to be safe to use by anyone with a driver’s license. You expect household appliances to be safe to use for anyone after a cursory glance at the instruction manuals. It is reasonable then to expect your clients to become proficient in your work just to be able to use your products responsibly? Worse, is it reasonable to make that expectation tacitly? That doesn't seem like a proper analogy. I certainly would expect a civil engineer to think me an idiot if I tried to do his job for him. And that's how most code written by non software engineers/computer scientists ends up looking. Software engineers don't produce programming languages, but programs. Languages (and libraries, etc) are our tools, not our end products. Much like an architect's job is not to produce rulers and pencils, but plans. It just so happens that (more so for computer scientists than for software engineers) we create our own tools.