If you're branching out into other code, you can always ask Julia itself what a particular character is — just paste it into a help prompt at the REPL:
help?> 𝒜
"𝒜" can be typed by \scrA<tab>
julia> '𝒜'
'𝒜': Unicode U+1D49C (category Lu: Letter, uppercase)Maybe the title should have been 'Algorithms that look concise and beautiful to people who already know them'.
I don't think an expert in some field who just happens not to be an expert in some other field's jargon and pictographs should be branded "a lowest common denominator of people", this terminology is both judgmental and elitist in all the bad ways.
I've seen plenty of function use, say, `theta` but I have never worked with θ.
There's a reason we use 'y = mx + b' instead of 'range = slope * domain + intercept' when we're doing math calculations. It's nice to use the long form when we're learning what the symbols are, but the symbols enhance readability when you're doing math, once you've become familiar with the meaning of the terms.
There is a reason why one letter/number variables are basically verboten in best practice.
Personally, those 'strange letters' make it more readable, because that's how the mathematics are written.
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?
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.
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.
Math requires excellent fonts if you don't want your reader to want to murder you by attempting to decipher the difference between L, calligraphic L, script L, italic L...
The way you put it, it almost sounds as if that wouldn'be great!
What is easier: matching (𝛍, 𝚺) to (𝛍, 𝚺), or to (mu, Sigma)?
Let me say there is a third alternative: (mean, cov) (except you'll shadow some functions...).
If you're a practitioner and not much of a programmer, it might be faster and easier to read the "math notation" version, which will be familiar to you, than the version a programmer might write, which might be unfamiliar and might require your brain to scan everything "from scratch".
I don’t think that Julia having the capacity to use this style is bad, but I don’t think these examples are “beautiful and concise”, more “baroque and tasteless”.
I don't need to only if I already know what they mean. How does your brain process a character that you can't pronounce and whose meaning you're trying to understand from the code you're currently reading? Because my brain will need to assign something to it in order to use it.
Its not like anyone could draw them properly by hand either
It's becoming a pet peeve of mine how HN conflates a solid, classical mathematical education with some kind of gatekeeping club. Anyone is welcome to join. Anyone is welcome not to use this language if they wish. But please don't dictate how us mathematicians are supposed to communicate.
Calling this mathematical education makes me doubt your implicit claim of pedagogical ability.
I think a lot of math could be taught with a lot less overhead and in more understandable fashion. It's just that the natural incentives seem to drive people to unnecessary overhead and barriers for those who actually want to learn.
Lot of the language and symbols involved could be streamlined. But like QWERTY keyboard and C++, you would first have to turn this huge hulking ship of legacy cruft into that direction.
Ok. Have at it, I guess.
> Lot of the language and symbols involved could be streamlined. But like QWERTY keyboard and C++, you would first have to turn this huge hulking ship of legacy cruft into that direction.
This screams a fundamental misunderstanding of mathematics. The symbols need context to make any sense whatsoever. To a reader with intimate knowledge of the context, the symbols convey lots of information very efficiently. That doesn't mean that the symbols are understandable without context, or even that they could be made understandable without context.
Using in-group context-sensitive symbols is by definition exclusive. Using descriptive well thought out names is inclusive.
Math as a language seems very needlessly compressed. Imagine a world where programmers invented a new symbol for every function and you would have to look up what they mean, but when you look up what they mean, you would have to look up 10 other symbols. Most of those symbols refer back to symbols where you came from in the first place. It's a detriment for learning. Simple as that.
Not everybody wants to be a mathematician. Some people just want to get work done and read through a bunch of research papers.
Are you saying the whole field of mathematics (and physics) is wrong, and we're doing something "meaningless"?
> Using in-group context-sensitive symbols is by definition exclusive. Using descriptive well thought out names is inclusive.
Not when the group is open to anyone who wants to join. Math is probably the most "open source" field out there. Barring the very cutting edge front of research, everything can be learned from free sources or ones that can be borrowed for free from libraries, or had through very very cheap second hand material.
That there is a high barrier to entry when it comes to effort isn't some malicious gatekeeping design. It's just because some things are hard.
> Math as a language seems very needlessly compressed. Imagine a world where programmers invented a new symbol for every function and you would have to look up what they mean, but when you look up what they mean, you would have to look up 10 other symbols.
You clearly have never done math! The way it works requires intimate familiarity with the definitions of the symbols. Once you actually manage to internalize that (it can be a lot of work), remembering what the symbols stand for comes for free.
> Not everybody wants to be a mathematician. Some people just want to get work done and read through a bunch of research papers.
"Not everyone wants to be a surgeon, some people just wanna read medical research papers."
"Not everyone wants to be an astrophysicist, some people just wanna read astrophysics papers."
Do you not see how ridiculous this is? Nobody is gatekeeping for the sake of gatekeeping. You're conflating gatekeeping with something just being hard, and the practitioners of the hard thing not wanting to change the way we work to accommodate non-practitioners (to our own detriment!)
All I'm seeking here is how to improve communicating math without having to go through the credentialism of higher education.
edit: Why you didn't understand my comment on reading papers: some computer science papers require heavy math background. A lot of math is actually applied math.
Lastly:
> All I'm seeking here is how to improve communicating math without having to go through the credentialism of higher education.
Like I've already pointed out: mathematics is perhaps the most "open source" field there is. There's no need to go through the "credentialism" if you don't want to. Again you're just conflating math being hard with it being protected by some imagined wall of credentialism guarded by gatekeepers.
I think it's just the opposite. People familiar with the relevant math have, most likely, worked with this stuff in other programming languages and never used math symbols in their code.
I'm used to seeing θ or α in text and theta or alpha in code. The combination of Greek letters and for loops looks very weird.
The options aren't just complete beginner vs math PhD though. Imagine an experienced software developer who has written these kinds of algorithms in other languages and has never used latex. That's the kind of person you're also keeping out. Are they "the lowest common denominator"?
I also don't know why you assumed that the people who are most likely to use this code like this are automatically people who already know the glyphs.
It's gatekeeping not just because there is barrier to entry. It's because that barrier is artificial, unnecessary and comes with a smug feeling of superiority (you aren't the first person to use "lowest common denominator" in this thread).
(Seriously talking: From an educational point of view, lowest common deminator is exactly what you want, as long as you can communicate the entire concept effectively)
- Greek letters
- glyphs with obscure latex codes
The last one in particular - how do you read this in your mind if you don't already know the name of the character? - "Hmm, that's a curly handwritten A". It's so disruptive to the thought process of the reader of your code if they don't already know the notation.
I really think that this is the opposite of beautiful. Code is about communicating with other people too. I also think that mixing code and math notation is liked by a vocal minority of Julia users but in the long term is harming the adoption of the language by beginners.