Hacker News new | past | comments | ask | show | jobs | submit login

>Having seen code written by scientists, I can confidently answer this with: almost certainly not.

Got a kick out of that, thanks. I think there is a kind of compartmentalization of environments going on when one engages in scientific programming. It seems to often be structured more akin to math than code. I once worked with a brilliant multitalented individual who held a PhD in a specific field of physics that I cannot recall. In one instance they ported the orchestration software for a supercomputer from python into java, in a week. It was beautiful to read. This same person used single letter variables in their ML models and had virtually zero comments which made it somewhat difficult for me to follow their updates after a week of having not seen the code.




Here's an analogy that I can speak from more direct experience: if you study the theory of elliptic curves, and then look at elliptic curve cryptography code, there will appear to be no connection between the two. This is because in between the theory and the code are a zillion implementation details and tricks of the trade that aren't generally mentioned in the theory. Add to that the fact that the people who write scientific code aren't coders by trade, so they learn to write code that is just good enough but no better, and the result is something that looks like a horrible mess. (Also, the code is often written by grad students, so that makes it even worse. I look back on some of the code that I wrote back when I was a grad student that was the basis for publications and I shudder.)


This reminded me of the chemical PhD who created Clasp, a full common lisp implementation using LLVM as a JIT compiler, able to call even template C++ code from Common Lisp (a feat which no other language I know of even tries, except perhaps .NET with managed C++).

[0] https://github.com/clasp-developers/clasp


To me, it's a difference in professional gestalts(?) in highly trained individuals.

Physical engineers, especially, have a very formalized, standardized way of looking at the world. They all share it, and so their code follows from that.

Physicists, biologists, software developers all have different ways of looking at the world (some more standardized, some less). Our code follows from that.

So while we may gripe they don't leverage (insert language arcana / convention), my intuition is our code would still look very different even if they did. Biggest example, as you point out: math-structured code, from math-heavy disciplines.


From what I’ve heard the core of the issue is it’s similar to non-online game development. Most scientists make some programs for a single paper, and then just start from scratch for a new project. When you don’t have to care about long term maintainability readability becomes much less of a concern to people.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: