Earlier quoted context omitted.
True, much of math is relegated to experts. This is _exactly_ the problem. Why do you think so many adults have such little understanding of math and will proudly proclaim that they haven't used algebra or geometry in their adult life? Yes, there are are some areas of mathematics that are extremely specific and do require experts but a lot of math is useful to people in general and anything we do to make it easier fo…
Making mathematics accessible to the general public isn't part of mathematicians' jobs, nor is it something most of them care about. If you want to write some articles that make mathematics more accessible to the general public, and you want to use longer variable names in order to do that, nobody is going to stop you. It's unreasonable, however, to expect mathematicians to try to do this at the same time they're doi…
Programming as a Way of Thinking
91–100 of 133 posts
Re: Programming as a Way of Thinking
#92This 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 rethin…
Languages like Julia allow you to use greek letters. Just saying.
Re: Programming as a Way of Thinking
#93This 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 rethin…
It'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:…
Re: Programming as a Way of Thinking
#94This 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 rethin…
No: it's assembly language, for the hand and pen.
Re: Programming as a Way of Thinking
#95Earlier quoted context omitted.
I 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 try…
> 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 pap…
That rule gets broke quite a bit though. For example, if you have a optimization program with some affine inequality constraint A * x 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.
Re: Programming as a Way of Thinking
#96Earlier quoted context omitted.
> The perception that math is useful stems from it's use by non experts. You might be surprised by how many mathematicians would disagree with the assertion that "math is useful" (I suspect a majority would at least think such a statement was overly broad).
Not really, I chose to stop studying math because what I found interesting was generally really useless, and I find a pointless life's work to be a terrible waste of time. Worst outcome I recall was being yelled at by a professor for not getting a PHD. ¯\_(ツ)_/¯
Re: Programming as a Way of Thinking
#97Earlier quoted context omitted.
There 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.
> If you've got a ton of "anything" variables in your code > design for your system We're not talking about programming; we're talking about math; that's the whole point.
Re: Programming as a Way of Thinking
#98Earlier quoted context omitted.
IMO 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".
What 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).
Re: Programming as a Way of Thinking
#99The article misses what I believe is the most important point, which is the concept of the abstraction of a function. A function is more than a computer concept: a function is a hammer, a violin, and a microscope; you put an input and you get an output.
Re: Programming as a Way of Thinking
#100Earlier quoted context omitted.
> If you've got a ton of "anything" variables in your code > design for your system We're not talking about programming; we're talking about math; that's the whole point.
In a broader context, the two are more similar than you are giving them credit for. I was working on a paper and wrote a rather long messy proof that involved a large number of variables. When I finished, I thought the thing was too difficult to follow so I rewrote it. This time I "refactored" the proof by breaking out a bunch of lemmas and developing a more concise notation. The result was not only a more legible pr…
I just think they are different enough that not everything is analogous, including best practices on variable naming.