Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

About variable naming in math. I sometimes also think that it would be good to define sensibly named variables and then use them in subsequent equations much more often than is usually done. Math equations are traditionally very large and complicated, even though they could be broken down to pieces and then assembled piece by piece.

I think one argument against this is that in math you often want to reach down a few abstraction levels and reorder terms, factor out things etc. which requires peeking into the "internals of boxes". You can't abstract to the point where you only have two or three variables in one equation because to show the next step, you would need to make the expanded formulas of those variables interact (cancellations etc.).

Another is that math is quite a different way of thinking. Most professions don't do as much of this input/output-based, requirements-based thinking with lots of ad-hoc on-the-fly introduced abstractions that is usual in programming. For example engineers, doctors etc. just work very differently and consider many different levels of abstraction at the same time. They consider it normal to sprinkle in temperatures, voltage values etc. in supposedly high-level discussions. Programming is a product of the mind so we have an easier time with it for sure, as our abstractions are more reliable (even if they leak to some degree, they leak much much more in other disciplines).

Now, math is also a product of the mind, but tradition is quite different. Of course math is very abstraction-heavy but the abstractions are usually not generated by the practitioner on-the-fly, on-demand, the way you just write a function or introduce a class in programming. Rather they are widely-known definitions and conventions, which are mostly only created by the people developing new theory. Of course you do define some notations and variables in math, but I find it not as pervasive as in programming.

The closest you can get to programming-like variables in math writing that still somewhat adheres to math tradition is to place full words into subscript positions (index). For example, you can write out N_columns (as a subscript) or S_upper or L_dual or f_transform. This is also something I see more in CS papers than in non-CS math content.



You can use full words or even short multi-world phrases in math expressions. From a typesetting POV, write them in roman (upright) type, and enclose them in brackets whenever ambiguity arises (due to the possibility of separating spaces within a single variable, or the concurrent use of juxtaposition (of single letters) as a product or for other purposes within the same sorts of expression. This is very common in the applied sciences in general, and the convention is universally understood.


It may take some effort to realize this, but a mathematical formula is actually a picture, not text - more often than not it is intended to be seen - as a whole - rather then read, "word by word."




Consider applying for YC's Winter 2027 batch! Applications are open till November 2.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: