5 ms·
It's also a matter of knowing your audience. All due respect: but this looks like code intended for people familiar with the relevant math, for whom such varia
by generalizations 5y ago
It's also a matter of knowing your audience. All due respect: but this looks like code intended for people familiar with the relevant math, for whom such variables are very familiar.
Personally, those 'strange letters' make it more readable, because that's how the mathematics are written.
- contravariant 5y agoThough it's worth keeping in mind that the mathematics is usually accompanied by an article that at a minimum (tersely) tells you what the symbols are.
- ModernMech 5y agoExactly, this is the thing people always seem to forget. When I write a paper with mathematical symbols like this, I always include a glossary for the reader. It's even required in some venues. People like to pretend that mathematical notations are standardized and obvious to practitioners, but they're just not. In my physics undergrad days we made a joke shirt with all the usages of the symbol "k" as it appeared in our physics texts. Is it the constant in Coulomb’s law? Is it a spring constant? The Boltzman proportionality factor? Is it kinetic energy? Is it a kilo? A kelvin? I think we were able to cover the front and back of the shirt with the overloaded usages.
- contravariant 5y agoYeah things can get a little wild sometimes with all possible interpretations. I'm pretty sure there are a few equations that use 'i' as both the imaginary unit and an index at the same time. I've noticed physicists can be a bit fast and loose with their definitions, somehow you're assumed to be up to do date on what concept is given the symbol "R" in that particular context. Though they do tend to agree with each other which concept should have which symbol.
- spywaregorilla 5y agoSounds like something one could expect from a docstring
- counters 5y agoBingo. And it goes vice-versa; because software engineering standards are so lax (read: non-existent) in most academic disciplines and domains, on the rare occasion where you get accompanying code to an academic work it may be impossible to actually much of the source to the original work itself. During my dissertation I had to collect implementations of about a dozen parameterizations of a process I was studying, with the intent of coupling them/incorporating them into a set of climate modeling experiments. All of the implementations were in Fortran (which in and of itself wasn't a problem, albeit it was annoying re-writing or re-factoring some F77 code to play more nicely with the more modern Fortran codebase in which our climate model was written). Of these codes I collected, the majority of them had bugs which restricted my ability to reproduce the reported results from the original work they accompanied. One or two of them had significant flaws in them - answer-changing bugs which, when corrected, potentially would yield different results from those reported in their original papers, and might actually lead to different conclusions. One of the nice things about the Jupyter ecosystem of tools and Julia is the ability to more closely replicate equations from the original paper. It seems dumb, but in my anecdotal experience I've noticed fewer significant bugs when colleagues have used these features. I've also noticed a propensity for scientists and researchers to write clearer, better-documented code - if your next line of code is going to directly mimic Equation 13 in your paper, why wouldn't you go ahead and write a comment saying so?
- res0nat0r 5y agoDo folks normally write code using the Greek alphabet? I totally understand reading/writing math papers in latex, or on paper using the traditional mathematical symbols, but does anyone really want to edit their Julia code in vim and type \scrA<tab> for a variable name? Seems extremely annoying and convoluted vs naming your variables alpha or sigma, etc.
- mbauman 5y agoAll the time. Incidentally, I got these unicode α and σ by copy-pasting from tab completion in an open Julia REPL. https://juliahub.com/ui/Search?q=α&type=code&w=true https://juliahub.com/ui/Search?q=α&type=code&w=true https://juliahub.com/ui/Search?q=σ&type=code&w=true https://juliahub.com/ui/Search?q=σ&type=code&w=true