Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

4
  • 9
    Plus one for making ones "code to read as much like the published equations as possible". Sorry, advocates of long, meaningful variable names. The most meaningful names in scientific code oftentimes are nasty, short, and brutish precisely because that's exactly the convention used in a scientific journal paper that the code is attempting to implement. For an equation-heavy chunk of code that implements equations found in a journal paper, it's oftentimes best to stay close as possible to the nomenclature in the paper, and if this goes against the grain of good coding standards, tough. Commented Jul 8, 2018 at 15:39
  • @DavidHammen: As a grad student, I respect that. As a programmer, I'd then insist that you have a giant comment block at the top of each function describing in plain English (or language of your choosing) what each variable stood for, even if just a temporary placeholder. That way I at least have a reference to look back to. Commented Jul 9, 2018 at 17:24
  • 1
    @DavidHammen Besides, Python support for UTF-8 in source files and simple rules for variable names makes it easy to declare λ or φ instead of the ugly lambda_ or phy... Commented Jul 9, 2018 at 22:57
  • 1
    @tonysdg You already have a reference; it's called "Hammen, et al. (2018)" (or whatever). It will explain the meanings of the variables in far greater detail than any comment block ever could. The reason for keeping the variable names close to the notation in the paper is precisely to make it easier to connect what's in the paper to what's in the code. Commented Oct 10, 2018 at 14:44