Khang Nguyen

is a writer.
Moving from code back to math

Most of my pre-univeristy education was spent doing math. But I stopped after enlisting because it required too different of a state of mind from the daily grind. After leaving the Army, I didn’t quite get straight back into math, but instead started on some coding projects. Now, I’m back studying math full-time at university, and I see two things which math can learn from code.

Variable scoping

When programming something small, it’s okay to name your variables things like x and y and not be worried of names conflicting. However, this doesn’t hold in a larger project. Most programming languages already address this. Variables can be choosed to be scoped within a function. This leaves programmers to reuse common names even if they were defined differently outside of the function.

Math needs this. There needs to be a more common practice to scope variables so they remain more readable. We can’t keep relying on extending over to Greek alphabets or subscript numbers.

Standardizing syntax

Because most of math is expressed in conjunction with a written language, mathematical papers still leave room for misunderstanding. Unlike a programming language which has a mechanical compiler, the language of math is compiled by the human brain. While compilers are identical if on the same version, and give the exact same evaluation of the same code, this is not the case for humans and math mixed with language.

The lack of a standardized syntax probably stems from the fact that math was develop independently by lots of different people who speak different native languages. There wasn’t a single person or team who constructed math in its entirety and proposed it to the world, unlike programming languages.


Still, I’d say that one edge that math has over code is that it is more readable for its own purpose. Fractions is one example. That they are written on two lines makes it so much easier to visually manipulate.

Overall, I’m still optimistic about the future of documented math because it’s still a relatively new technology when you consider how many other things it serves as a basis for.