Hacker News new | ask | show | jobs
by ShamelessC 1872 days ago
I mean I guess that makes sense for a mathematics-oriented language. Generally, literate coding would encourage you to come up with friendlier variable names as software engineers aren't mathematicians per se and code is meant to be accessible to more than just academics/mathematicians.

In particular, I see a lot of this done in machine learning python code. Lots of "z", not "zeta", etc. Pretty tough to understand as a non-researcher.

2 comments

It seems backward to try and understand a known math technique or fact from code when there are likely pedagogical presentations of the same material. And if we're talking about novel math, it seems more than fair to ask that the reader is comfortable with the domain.

Can you imagine someone learning math by contemplating the sum of effects in a program? Heaven forbid there's any emphasis on performance whatsoever.

Trying to abbreviate greek variables ends up causing a lot of issues too. It's common to have both "zeta" and x,y,z in the same scope. As well as a capital and lower case zeta. And maybe a zeta prime, and some subscripts. Unless you plan well ahead, it's hard to be consistent across all parts of the code and be concise at the same time.

Trying to come up with more descriptive names isn't practical as the variables often have very complex definitions, and it'd be impossible to explain in a variable name.