Hacker News new | ask | show | jobs
by zamfi 2158 days ago
In addition, the same notation is often overloaded in new domains, where the association with the prior domain is metaphorical, or even simply allegorical.

As a novice programmer, it took years to get out of the habit of using non-descriptive single-letter variable and function names. It’s a terrible habit, and makes code incomprehensible — and programmers know it.

Math, as taught to kids, is full of single-letter variable names (or worse, as you point out, using non-Roman letters and other symbols) that are devoid of any hints to the uninitiated of what their meaning might be.

I wonder what it would be like if math were taught with descriptive names — starting with the basics, for functions and variables, and used those names consistently.

Would it be more verbose? Absolutely — but I’m pretty sure it would also be a huge kindness to learners.

3 comments

But Math is taught gradually, introducing concepts in child-friendly ways, and moving up towards "adult" notation.

Note that if you programmed in FP languages, you'd have to unlearn the "descriptive variable names" thing you were taught. Once you deal with abstractions, names cease to be meaningful. If the most you can say about a parameter to a higher order function is that it is "a function", then "f" is the best name for it. Some very good programmers argue that long/descriptive names often obscure the shape of an abstraction.

> If the most you can say about a parameter to a higher order function is that it is "a function", then "f" is the best name for it

Of course. But even in FP languages you don’t name all your functions “f”! At some level of abstraction, sure, you use “i” for index variables, etc., but once you back out of that low level, you are going to be naming things that are less abstract.

Agreed. I'd say Math is a lot like the abstract parts of FP, and so short variable names make sense there, just like they do in higher order FP functions. Choosing "more descriptive" names risks locking you into a specific metaphor and prevents you from seeing the big picture, which seems doubly dangerous in Math.
Are you sure it’s not the opposite? Plenty of students can solve a set of equations. But when you start asking them about trains speeding in the night...
I think this is actually proof that students are treating math as a set of rules applied to a process, and not having any real understanding of how the variables and equations they’re mechanistically applying rules to have any connection to the real world.

If they did, it would be a lot easier to talk about trains speeding through the night!

Trains are how the courses try to help folks move from blind processes to understanding.

A person can wonder if it would be better to start with understanding. (Personally, I only briefly taught that age but my oracle for how to teach it, Mr Barton, does say that experience shows you have to have down the class's ability to mechanically solve before you introduce the trains. The other order, apparently, doesn't work when you try it with actual students in practice.)

> Math, as taught to kids, is full of single-letter variable names (or worse, as you point out, using non-Roman letters and other symbols) that are devoid of any hints to the uninitiated of what their meaning might be.

Any time a new symbol is used in a text, it will typically be introduced. The phrase "Let A be the subgraph composed of G" for example defines A in relation to G. Typically, the author will also define their notation at the start of a paper with: "A graph G is defined as the set of edges E and vertices V such that...". To be frank, I always see math papers and communications written in this style.

More often than not, I think folks just say "SINGLE VARIABLE NAMES BAD. MATH HAVE SINGLE VARIABLE NAMES". It's really dense. In any given math paper, the author typically defines any such variables. And if those definitions don't make sense, it's because the underlying mathematical objects are beyond you, and you need further background.

> More often than not, I think folks just say "SINGLE VARIABLE NAMES BAD. MATH HAVE SINGLE VARIABLE NAMES". It's really dense. In any given math paper, the author typically defines any such variables. And if those definitions don't make sense, it's because the underlying mathematical objects are beyond you, and you need further background

Yes, that’s my point.

Imagine learning a foreign language by being given a dictionary and a set of grammar rules. Is that enough to learn the language? Not really. You’d be missing idioms, patterns of speech, common phrases & compositions - the same is true in math.

If you already halfway understand the language, then yes, you can do with a reference / definitions and rules for application — but even then, understanding how to use them is not trivial.

Also, you are talking about “texts”, but there are plenty of domains in which conference and journal papers assume a certain set of notation, and that notation is not defined, nor even consistent; you need to be well-read in the field to even have a hope of understanding what’s going on. AI/robotics comes to mind, but ML in general is sometimes guilty of this.