10 ms·
This article starts to get at an idea that I've had for a while now -- that mathematicians are doing it wrong. In the software business we learned a long time
by ccleve 9y ago
This article starts to get at an idea that I've had for a while now -- that mathematicians are doing it wrong.
In the software business we learned a long time ago to name our variables properly, name our functions logically, and to control complexity by breaking ideas into modules and then hiding the details inside.
If you can't name something, then you don't know what it is, and that tells you that you should rethink your design.
Mathematicians don't do that. They name variables "a" or "x", or worse, they use some Greek letter I can't type on my keyboard. They are entirely inconsistent in their use of variables: "phi" or "theta" can mean a zillion different things. I can't tell you the number of times I've read a computer science paper, a paper that uses entirely unnecessary equations, and doesn't bother to define symbols. This practice wastes everyone's time.
It's laziness, pure and simple.
Mathematics needs a general overhaul. The language of math needs to a complete redesign with a focus on understandability. And the key to it is to force mathematicians to name their variables.
Yes, I realize that mathematics deals in abstractions that have little relationship to the outside world, and it makes little sense to call a variable a "dog" or a "car". So what? It just means that we need a new vocabulary, a vocabulary that includes terms like "fourier transform" or "hypotenuse". Pretty much every industry has it's own vocabulary. Chemistry has thousands of terms. Biology even more. Computer science is full of them. Math is full of symbols that have no inherent or well-understood meaning. That should change.
- umanwizard 9y agoAre you a mathematician? How much math have you studied?
- ccleve 9y agoI'm a software developer. I need to understand computer science papers to get my work done. I've studied enough. High school and several courses in college. Enough that I should be able to take it from here and learn on my own.
- vlasev 9y agoSo let me get this straight...You are mainly a software developer who has an issue with math notation that is meant for mathematicians? Could it perhaps be that you haven't taken enough math to become in tune with how it's done/studied/read? I come from the other direction. I studied math first. And yes, at first I had an issue with the long variable/function names. But soon enough I realized that programming is done quite differently than math. With IDEs and autocompletion, long variable names are not really a problem. One could argue that variable names should be descriptive in programming, because there is a lot more reading involved. Whereas in math, there is a lot more writing/doing involved. I might manipulate a math variable name 1000 times in my head in the process of working on a problem. I might even WRITE it down that many times! In programming, I might READ a variable name 1000 times in debugging.
- j2kun 9y agoI agree. As someone who has done mathematics research, and studied on the purest end of the math spectrum, it's so aggravating to hear engineers who "took BOTH differential equations classes" explain how math should be when they clearly don't know what they're talking about.
- breuleux 9y agoI don't like mathematical notation's ambiguity and opaqueness much either, but it is fairly important for the notation to be terse. It's more important than in software because so many proofs are about this being equivalent to that, and symbols give you a lot of room to work with, which you would not have with words. And I mean, the vocabulary already exists, papers just need to explain which symbol represents what. If a paper tells me that epsilon is the learning rate for some model, I know what that means and I can just keep it in mind when I read the math. I don't think I'd understand better if they write out "learning rate" over and over again.
- ccleve 9y agoBut that's not our experience in software. We do write "learningRate" over and over again, because we've learned that that makes the code much more understandable that just writing "e". In fact, we've learned that excessive terseness in software is an anti-pattern.
- breuleux 9y agoThat works fine for software, but mathematics are a different use case. If you want to simplify or rearrange an equation, what matters most is the structure, not the precise meanings you assign to the variables. If you want to understand how an equation relates to the real world or the task at hand, I agree that named variables help -- but if you want to do math, that is to say, manipulate equations, it makes more sense to work in a terser representation. Patterns will stand out more.
- dragandj 9y agoInterestingly, 500 years ago, math was to your taste. There were not much symbols in it, but lots and lots of English (or, more often, French, German, or Latin) sentences that took paragraphs upon paragraphs of text to describe what today a couple of equations do...
- sqeaky 9y agoTo "explain". I find a good paragraph explaining what the equation means and implies is far more useful than the equation alone. This is all the typical "what" vs "why". If you just want to describe the what then the formula alone might be enough (and just presuming everyone know what the variables mean), but if you actually want to convey a some meaning that formula needs to be explained.
- umanwizard 9y agoYou are arguing against a strawman. I have never seen any piece of mathematics that was just formulas. The heavy majority of any mathematical writing is plain text -- formulas and notation are only used when it would be much less practical to express something in text.
- sqeaky 9y agoI appreciate your response it is well thought out and leaves me struggling hard to find a counter-example. I feel that I know that I have had to deal with this, but I cannot find examples. Before your response I had several hours with just downvotes and did not know why. I wish people would comment with their downvotes.
- runeks 9y agoIf a variable can be literally anything, what would you name it instead of 'a'? 'anything'? Sometimes a variable does not refer to anything specific at all. For example, type variables in Haskell are often denoted using single letters, simply because they can be literally anything, and no sane human wants to type out 'anything' all the time, just so her code can be used as a beginner's intro to the language in question.
- ccleve 9y agoThere may be occasions when a single letter makes sense, but this should be the exception, not the rule. If you've got a ton of "anything" variables in your code, then that means there's probably a better, more understandable design for your system which expresses what the variables represent with more precision.
- runeks 9y agoThe variables named 'anything' can represent anything, that's the point. Are you saying we should avoid writing code that's too general? I understand that not all languages are powerful enough to allow defining functions that can operate on any type. But this doesn't mean that languages with this expressive power should refrain from using it; it means that users of less powerful languages need to learn something new (as I had to).
- gbrown 9y agoThat would create incredibly verbose code, which would be very hard to parse (IMHO).
- throwawayjava 9y agoExactly the opposite. Typed languages without parametric/generic code result in extraordinarily verbose and bug-prone code. You end up constantly casting to/from void* or Object. That's why all popular typed languages after C provide a facility for writing parametric code. And without exception, the standard libraries for those languages using single-variable names (S,T) for types. Because when you have 1-3 type variables, and you're writing generic code, "Type" doesn't really communicate anything that "T" doesn't.
- eldavido 9y agoIt's more standard than people realize. Offhand: x: "some real-valued variable" n: "a countable quantity, usually a total" i: "an index" k: "some kind of constant", often an integer, whose value doesn't change, "c" is also used for this e: almost never used as a variable, it's Euler's number p: some kind of probability, or a prime number, along with p and q t: some kind of parameter, often goes from [0,1] or (0,1) z: complex numbers I have a Master's in EE so I've studied this a bit.
- osoba 9y agoU, V: vector spaces u, v: elements of vector spaces G, H: groups g, h: elements of groups or g, h: homomorphisms, isomorphisms etc e: group identity K, F: fields I: ideals f: functions (x): sequences x_i: i-th element of a sequence A, B: matrices It all depends on the context it's used of course
- danielpatrick 9y agoThis notation has developed over tens to hundreds of years before we had the capabilities of autocomplete and formal typing where a computer can help us write longer names more quickly. This is why single letters became prominent, they were simply easier and faster to write. But anyone who is serious about writing maintainable code today should be using an IDE where the benefits of susinctness are entirely relegated by intellisense-like tools. Trading readability for conciseness is near the top of my list of "crimes against future maintainers." So I had never thought about this in the context of mathematical symbols, but this makes total sense and I'm strongly in favor of relegating mathematical conciseness in favor of readability and specificity.
- gbrown 9y agoIf you're talking about mathematically rigorous programming, conciseness and readability go hand in hand. It's actually easier to read a formula with single letter components than a complex one with long descriptive names in many cases. Also, if you're doing that kind of programming, you're also doing a lot of hand or latex computation. Minimizing the visual distance between the code and the convenient handwritten or typeset notation is incredibly important.
- yorwba 9y ago> ... a paper that uses entirely unnecessary equations, and doesn't bother to define symbols. This practice wastes everyone's time. I agree with you there, notation should be defined, otherwise it doesn't help explain anything. However, consider that for people who are already used to the notation those "unnecessary" equations are actually more compact and precise than reading the accompanying text. What seems difficult to you may be easy for someone else, and vice versa. > ... the key to it is to force mathematicians to name their variables. I believe you overestimate how much of an improvement that would be. How much code have you seen that had variables like int num or String str? If num can be any arbitrary number, and str is just a generic string, there isn't necessarily a more descriptive name you can use. Mathematics is full of these cases. Say, some general equation involves three real numbers and a real valued function of two real parameters. They are completely generic, so a mathematician might name them x, y, z and f and write the equation as f(x,y) = z. How would you call them? All I can think of would be the first parameter, the second parameter, the result and the function, which is not much more descriptive for the added verbosity. The problem with using descriptive names in mathematics is that most entities you are dealing with are so generic that naming them doesn't help. Of course I'm not opposed to e.g. writing NormalDistribution instead of just N, since this is actually a very specific concept. But there is just no way to completely eliminate single letter variables from mathematics without using an equally nondescriptive replacement.
- ccleve 9y agoNaming is hard, no question. Context helps, though. In realm where I live, computer science, x, y, and z likely correspond to something in the problem domain, like "rate" or "time". And even if we're dealing in pure, as opposed to applied, math, you should still be able to come up with names like "surfaceArea" or "interval".
- Klockan 9y agoSo how would you rename a, b, c, x and y in the quadratic formula? https://en.wikipedia.org/wiki/Quadratic_formula https://en.wikipedia.org/wiki/Quadratic_formula It is impossible to get better than one letter variable names here. This goes for most expressions in maths, to make things simpler we just use one letter variables for everything. This forces us to learn that the names aren't important, all that matters is how the names relate to each other. The problem with notation only occurs when non mathematicians start to write down formulas without properly defining what everything is. This is not a problem with mathematical notation, this is a problem with statisticians/economists/physicists/Computer scientists etc who define their own global naming rules where P might denote probability/price/momentum/polynomial time problems etc.
- btilly 9y agoThis article starts to get at an idea that I've had for a while now -- that mathematicians are doing it wrong. And you're making a typical programmer mistake in thinking that. Programming is geared towards having people who are experts in programming, but not in a specific subject area, be able to develop and maintain code. Therefore practices like descriptive variable names help provide context to people who cannot be expected to have a deep understanding of their subject. By contrast mathematics is geared towards having people who are experts in a particular branch of mathematics be able to think and communicate with other experts. Experts naturally create jargon. Jargon is that it is short, concise and precise. This frees up the mind to be able to consider more complex statements, and removes mental friction from more complex manipulations of those statements. Over a lifetime of expertise, the mental effort of learning the jargon for your specialty gets repaid over and over again. Mathematics takes this to an extreme. And for professional mathematicians, it is repaid in spades. There is an obvious barrier for generalists who wish to approach a mathematical topic. But your experience of how to be a generalist does not make a mathematician's experience of how to be an effective specialist any less valid. (Note, this comment is informed by my experience having done mathematics into graduate school, followed by 20 years as a professional programmer.)
- sqeaky 9y ago> Programming is geared towards having people who are experts in programming Programming is getting simpler all the time. Compare modern Python or Ruby to the earliest punch cards. We programmers are going out of way to make it as easy to understand as possible for as many as we can. There are programming languages suitable for children to use while making robots out of Legos. It is hard to see how variable names vs single character variables creates more friction than it reduces and might even allow domain experts outside of math without higher level math degrees in. I am curious what other practices are history vs objectively pragmatic requirements. There is much greater pressure on programmers to use time efficiently so we spent a lot of time on pragmatic thinking, and we are nowhere near done. By contrast you sound like many mathematicians and niche experts claiming that you have it solved and know the most efficient way to proceed without even considering an experiment.
- omaranto 9y agoIs the problem that you want formulas to make sense on their own without the surrounding text? That's not how math is meant to be read. Formulas are reserved for only a few thoughts that are best expressed in that concise notation. The bulk of most mathematical writings is text.
- gbrown 9y agoExactly. These arguments seem to be coming largely from people who don't actually use much math in their programming.
- bryik 9y agoI took discrete math last semester and part of the course focused on binary relations and their properties (reflexive, symmetric, transitive...etc). I saw students memorize the mathematical definitions for all properties and yet be unable to actually apply them to a particular relation. I suspect many people ended up ignoring the definitions and coped by developing their own or using intuition. This seems like a sign that math is not being communicated effectively. "Translating" the math into Python code[1] helped me understand what these definition were saying and identify algorithms for exam time. The downside is that it took a lot of time and may not have been as effective as grinding practice questions. 1 - https://nbviewer.jupyter.org/github/bryik/jupyter-notebooks/blob/master/math/All%20Relations%20on%20a%20Set%20%28and%20Their%20Properties%29.ipynb https://nbviewer.jupyter.org/github/bryik/jupyter-notebooks/...
- aaachilless 9y agoIMO this is sort of an ironic example because it's a case where the names actually convey meaning well. It's a case where I've specifically noted to myself "I'll always remember these definitions because the names are so nice".
- bryik 9y agoWhat about symmetric vs antisymmetric? My professor even warned us about how the names can be misleading (it is possible to have a relation that is both symmetric and antisymmetric).
- aaachilless 9y agoIn this case there's not really a naming problem either. The confusion comes from the idea that ((A -> B) && (A -> ~B)) is sometimes true. Capturing that subtlety in a name doesn't seem practical to me.
- bryik 9y agoI'm not sure I understand. The problem with symmetric/antisymmetric is that the names make students think they are related and this can lead to misunderstanding (e.g. "since this relation is antisymmetric, it cannot be symmetric"). Arguably, this confusion would not exist if they were named differently.
- gbrown 9y agoLanguages like Julia allow you to use greek letters. Just saying.
- dragandj 9y agoDoesn't any language that support Unicode allow that? Java for example. But, it's rather impractical to use, since greek letters are not that easy to type with English keyboard.
- tarlinian 9y agoJulia's REPL allows for LaTeX like notation (e.g,. you can type \alpha to get the matching Greek letter), which makes it quite natural to use the Greek letters in places that make sense.
- dragandj 9y agoIf the intended result is some kind of scientific presentation then kinda yes. If I am writing a classic software code, then I do not see how \alpha is better or more readable than, well - alpha.
- tnecniv 9y agoI used to think this way, but as I learned more math, I realized that the way mathematicians do things isn't an issue in practice. I do wish notation was more standardized, but that's a nitpick (i.e. whether/how scalars and vectors are distinguished). When it comes to proofs, you can only keep so much information in your head at once. In most cases, if you have a ton of variables floating around, you are probably trying to do too much at once and would be better served by breaking out a lemma or two from the main proof. I will note the worst code I've ever read was written by a control theorist that used only single letter variables. I later found out the variable names were the same as a paper, but the paper was not provided in the program comments. > Pretty much every industry has it's own vocabulary. So does math. Open up any textbook and you'll see definitions everywhere. When it is useful to name something, mathematicians normally do.
- vlasev 9y ago> whether/how scalars and vectors are distinguished This becomes less of an issue once you go through some abstract algebra. But typically, constants would come from the start of the English alphabet, and vectors, from the end. > I will note the worst code I've ever read was written by a control theorist that used only single letter variables. I later found out the variable names were the same as a paper, but the paper was not provided in the program comments. Did the code remain "worst" after you found out the names came from a paper?
- tnecniv 9y ago> This becomes less of an issue once you go through some abstract algebra. But typically, constants would come from the start of the English alphabet, and vectors, from the end. That rule gets broke quite a bit though. For example, if you have a optimization program with some affine inequality constraint A * x <= b, it's not uncommon to refer to the individual hyperplane constraints as a_i^T x <= b_i. Math obviously has many more concepts than we have notation so selecting a unique notation for each concept is not feasible, but I bet some standardization can be done. > Did the code remain "worst" after you found out the names came from a paper? No, I am fine with naming things after variables from papers, but I always put a note as to which paper the notation came from. Giving someone a few hundred lines of code where few variables have more than 2 letters and no context is just cruel though.
- ramblenode 9y agoIt is a different convention but I don't think it's inherently less understandable. The semantically opaque variable names in math texts are usually accompanied by some sort of explanation, e.g. "Let x be... and let f(x) be...". Whereas this type of comment is usually required for a proof, comments are often omitted from programming statements when the variable names are self-documenting.
- HiroshiSan 9y agoInstead of dismissing mathematical syntax as laziness plain and simple Jeremy Kun (a mathematician) explains some reasons towards mathematical syntax. https://jeremykun.com/2013/02/08/why-there-is-no-hitchhikers-guide-to-mathematics-for-programmers/ https://jeremykun.com/2013/02/08/why-there-is-no-hitchhikers...
- pfooti 9y agoThis feels like an instance of the XKCD:927 principle. Math notation tends to be big and ugly and hard to wrap your head around at times. It's context-specific (if you're summing over an array, you'll maybe use i as an index value and reference x_i. If you're working with complex numbers, i is a constant. Importantly, this language and its practices have evolved over centuries, in response to a lot of different competing needs. It's probably highly-optimized for something, just not what you need it for. That said, if you're dealing with indices of an array in a sum / product series and that array is of complex numbers, it's actually not terribly ambiguous to do x_i * (2i - 1) or something. On the other (third? gripping?) hand, you do have a point - there's usually unwritten practices about what different variables reference (theta is usually an angle, k is a constant, n an integer, usually). That can be gatekeeping, and it's super-frustrating to work in a language that doesn't expose type information. 927: https://xkcd.com/927/ https://xkcd.com/927/
- kccqzy 9y agoNot everything can be so easily named. A lot of times mathematicians deal with a much higher level of abstraction than you are, and at that level, there are no intuitive names available. It is not a failing of mathematicians, but rather a failing of human natural language to be unable to name these concepts. You might want to read some very old math books that predated the introduction of symbols to stand for things. Go read how ancient mathematicians express Pythagoras's theorem. We have verbose monstrosities that is much more simplified now. Natural language is verbose. Once you can deal with the level of abstraction, conciseness reduces your cognitive load significant.
- escot 9y agoMathematicians work with pen and paper regularly. So long var names can be frustrating. If everyone goes to digital format it may be easier. However, there are forces working against that. Mathematical proofs are more like sentences, or even poetry, than a structured language that can be compiled. They are meant for humans to read. So you jot down your proof over and over again in different formats, playing with both the logic and also the visual representation. Another issue is that a lot of math is done just in your head, so you don't need a computer at all. When writing code you inherently need to test the codes execution, and also more frequently reference digital materials in your research.
- stevedonovan 9y agoConciseness matters. For example, Einstein's convention for tensor notation - a lot of explicit sums are lost!
- L_Rahman 9y agoThank you for writing a terrific criticism on how math is taught today. In part because it's one of the oldest taught subjects, I think the field has gotten away with how it teaches. In every other field we have an escalation ladder of abstraction that starts from tangible descriptions that a motivated learner could understand all the way up to symbolic jargon that is only accessible to insiders. Math doesn't have this at all. It goes from arithmetic straight into symbolic manipulation with only a sideways glance at describing three dimensional shapes. It's lazy and the field needs to acknowledge that it has practical dimension as well as a theoretical one and each needs to be taught and described differently.
- mathgenius 9y ago> It's laziness, pure and simple. No: it's assembly language, for the hand and pen.
- markc 9y agoShort variable names as "doing it wrong" depends on context. There are good reasons in math and in programming to use short names. See for example: Descriptive Variable Names: A Code Smell. http://degoes.net/articles/insufficiently-polymorphic http://degoes.net/articles/insufficiently-polymorphic