News for hackers. Stuff that matters.
Re:Ask HN: How did you learn math notation? by randomNumber7 on Thursday November 25, 2021 @10:46AM (#29342274)
Formulas would also be easier to read if they would not name all their variables and functions with one character.

If programmers would write code like that (even fortran programmers use 3 characters), noone would be able to understand the code...

Re:Ask HN: How did you learn math notation? by drdec on Thursday November 25, 2021 @11:12AM (#29342480)
As someone trained in mathematics, I can tell you that using single character variables allows one to focus better on the concepts abstractly which is one of the goals of mathematics. That is to say, it is a practice well-suited to mathematics.

It doesn't carry over to programming where explicit variables are better suited. In mathematics one is dealing with relatively few concepts compared to a typical program so assigning a single letter (applied consistently) to each is not a problem. This is not so in programming, except for a few cases like using i and j for loop variables (back when programs had explicit loops).

Re:Ask HN: How did you learn math notation? by Jtsummers on Thursday November 25, 2021 @11:05AM (#29342417)
As far as programmers, forget about the names. Does every C source file that uses pointer arithmetic include an explanation of how it works? Nope. They just use it and assume the reader understands it or is clever enough to ask for help or read up on the language.

Mathematical writing is similar. At some point you have to assume an audience, which may be more or less mathematically literate. If you're writing for graduate students or experts in a domain, you don't include a tutorial and description of literally every term, you can assume they're familiar with the domain jargon (just like C programmers can assume that others who read their program understand pointers and other program elements). Whenever something is being used that is unique to the context, a definition is typically provided, at least if the writer is halfway decent.

If the audience is assumed to be less mathematically literate (like a Calculus course textbook audience), then more terms will be defined (chapter 1 of most Calculus books include a definition of "function"). But a paper on some Calculus topic shouldn't have to define the integral, it should be able to use it because the audience will be expected to understand Calculus.

Re:Ask HN: How did you learn math notation? by colechristensen on Thursday November 25, 2021 @11:17AM (#29342536)
Scientists and engineers write code with single variables all the time and don’t seem to have any large amount of trouble with it. Long variable names seriously limit the ability to put complexity in one place and make it understandable.

Take a look at this and tell me it would be easier to understand if all the symbols were words instead of single characters: https://www.grc.nasa.gov/www/k-12/airplane/nseqs.html

Re:Ask HN: How did you learn math notation? by randomNumber7 on Thursday November 25, 2021 @11:33AM (#29342674)
This is pretty understandable because:

1. They explain all abbreviations at the top.

2. There is a lenghty text explaining the formula.

3. It's mathematically pretty easy if you know partial differentation.

Also scientists and engineers write pretty horrible code....

Re:Ask HN: How did you learn math notation? by colechristensen on Thursday November 25, 2021 @12:12PM (#29343032)
It’s not horrible, it’s different, has different goals and different audiences. Context is king, and the bulk of professional programmers criticizing scientist code is just lack of context and a different set of priorities.

From a more science based background i often think programmers write horrible code as i search in vain for where anything actually happens in a sea of abstractions.

Re:Ask HN: How did you learn math notation? by KptMarchewa on Thursday November 25, 2021 @04:49PM (#29345295)
People sometimes do that when their code is reasonably abstract. For example, usual convention for generic type in Java is something like T.

https://docs.oracle.com/javase/tutorial/java/generics/types....