I recently tried to implement a ranking algorithm, AllegSkill, to Python 3.
Here's what the maths looks like:


No, really.

This is then what I wrote:
t = (µw-µl)/c  # those are used in
e = ε/c        # multiple places.
σw_new = (σw**2 * (1 - (σw**2)/(c**2)*Wwin(t, e)) + γ**2)**.5

I actually thought it is unfortunate of Python 3 to not accept √ or ² as variable names.
>>> √ = lambda x: x**.5
  File "<stdin>", line 1
    √ = lambda x: x**.5
      ^
SyntaxError: invalid character in identifier

Am I out of my mind? Should I have resorted for a ASCII only version? Why? Wouldn't an ASCII only version of the above be harder to validate for equivalence with the formulas?
Mind you, I understand some Unicode glyphs look very much like each other and some like     ▄ (or is that ▗▖ ) or ╦  just can't make any sense in written code. However, this is hardly the case for Maths or arrow glyphs.

Per request, the ASCII only version would be something along the lines of:
winner_sigma_new = ( winner_sigma ** 2 *
                    ( 1 -
                     ( winner_sigma ** 2 -
                       general_uncertainty ** 2
                     ) * Wwin(t,e)
                    ) + dynamics ** 2
                   )**.5

...per each step of the algorithm.

I feel strongly that just replacing σ with s or sigma doesn’t make sense and is counter-productive.
What’s the potential gain? Well, let’s see …

Does it improve readability? Nope, not in the slightest. If that were so, the original formula would have undoubtedly used Latin letters also.

Does it improve writability? On the first glance, yes. But on the second, no. Because this formula is never going to change (well, “never”). There will normally be no need to change the code, nor to extend it using these variables. So writability is – just this once – not an issue.


Personally, I think programming languages have one advantage over mathematical formulae: you can use meaningful, expressive identifiers. In mathematics, this isn’t normally the case, so we resort to one-letter variables, occasionally making them Greek.
But Greek isn’t the problem. The non-descriptive, one-letter identifiers are.
So either keep the original notation … after all, if the programming language does support Unicode in identifiers, so there’s no technical barrier. Or use meaningful identifiers. Don’t just replace Greek glyphs with Latin glyphs. Or Arabic ones, or Hindi ones.
