5 ms·
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 (e
by randomNumber7 5y ago
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...
- KptMarchewa 5y agoPeople 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.html https://docs.oracle.com/javase/tutorial/java/generics/types....
- Jtsummers 5y agoAs 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.
- drdec 5y agoAs 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).
- colechristensen 5y agoScientists 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 https://www.grc.nasa.gov/www/k-12/airplane/nseqs.html
- randomNumber7 5y agoThis 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....
- colechristensen 5y agoIt’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.
- deleted 5y ago[deleted]