# Mathematics should learn from programming standards

**URL:** <https://boards.straightdope.com/t/mathematics-should-learn-from-programming-standards/837345>\
**Category:** Great Debates\
**Created:** [July 20, 2019, 10:40am UTC](https://boards.straightdope.com/t/mathematics-should-learn-from-programming-standards/837345 "2019-07-20T10:40:01Z")\
**Posts on this page:** 20\
**Page:** 2

<div class="post-metadata">

**Author:** ![Sage\_Rat](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/sage_rat/32/399_2.png) [@Sage\_Rat](https://boards.straightdope.com/u/Sage_Rat)\
**Post date:** [July 21, 2019, 4:44am UTC](https://boards.straightdope.com/t/mathematics-should-learn-from-programming-standards/837345/21 "2019-07-21T04:44:03Z")

</div>

> [@Chronos](#):
>
> Often, in math, descriptive variable names are impossible, because the variables aren’t describing anything in particular. Maybe there are a thousand different real-world situations that equation could be describing. Maybe nobody’s ever found any real-world situation that would be described by that equation. Maybe there are exactly two known real-world situations described by that math. The only time that descriptive names would really make sense would be when there’s exactly one real-world situation described by a particular bit of math, and that’s quite rare.

In terms of pure mathematics, I’m not sure that this is true - though obviously, that’s not my area of knowledge.

To the extent that I can tell, pure mathematics always deals in diagrams. And while diagrams may well represent things that can’t be displayed in 2D, they are nevertheless simply lines, points, nodes, etc.

Graham’s number was the output of research on cuboids. A cuboid has edges and vertexes, etc.

There is no particular reason that you can’t call your variable for the length of an edge in your hyper cuboid ‘edgeLength’. It may be pure mathematics, but it is nevertheless the edge length of your hypercuboid.

---

<div class="post-metadata">

**Author:** ![Mijin](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/mijin/32/9369_2.png) [@Mijin](https://boards.straightdope.com/u/Mijin)\
**Post date:** [July 21, 2019, 5:39am UTC](https://boards.straightdope.com/t/mathematics-should-learn-from-programming-standards/837345/22 "2019-07-21T05:39:39Z")

</div>

> [@DPRK](#):
>
> Most mathematicians nowadays do not “need to write code” (why would they?) […]

Well I should have put “IME”, but yeah IME most mathematicians write code (and obviously mathlab counts as code)

The main uses are probably: 1. Any time many calculations need to be performed 2. Visualization e.g. in geometry / topology 3. Share datasets with others 4. Run simulations (in applied mathematics)

> [@Daylate](#):
>
> That didn’t bother the chess authorities at all. A few years ago they were perfectly happy to replace “descriptive notation”, in use for hundreds of years and with thousands of books written using it), with an abortion called “algebraic notation”, seemingly because they wanted change for change’s sake.
> 
> And I could see no improvement in either clarity or convenience.

This is an example of how once a person gets used to one system, they often find it hard to see the benefits of switching to another system.  
Objectively-speaking the algebraic system is quicker to both read out, and write down moves. (I also think there’s less chance of confusing moves because every move only mentions one piece. Though that one’s debateable as some may consider it easier to confuse, say, C4 and D4).

---

<div class="post-metadata">

**Author:** ![Mijin](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/mijin/32/9369_2.png) [@Mijin](https://boards.straightdope.com/u/Mijin)\
**Post date:** [July 21, 2019, 7:41am UTC](https://boards.straightdope.com/t/mathematics-should-learn-from-programming-standards/837345/23 "2019-07-21T07:41:41Z")

</div>

Correction: Matlab (no ‘h’)

---

<div class="post-metadata">

**Author:** ![Chingon](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/chingon/32/17645_2.png) [@Chingon](https://boards.straightdope.com/u/Chingon)\
**Post date:** [July 21, 2019, 1:03pm UTC](https://boards.straightdope.com/t/mathematics-should-learn-from-programming-standards/837345/24 "2019-07-21T13:03:26Z")

</div>

Sorry, but symbols have been found to be quite convenient and useful.

---

<div class="post-metadata">

**Author:** ![MrDibble](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/mrdibble/32/114_2.png) [@MrDibble](https://boards.straightdope.com/u/MrDibble)\
**Post date:** [July 21, 2019, 1:47pm UTC](https://boards.straightdope.com/t/mathematics-should-learn-from-programming-standards/837345/25 "2019-07-21T13:47:38Z")

</div>

> [@Sage\_Rat](#):
>
> Historically, a lot of math was done by etching or scratching into clay, wax, or other mediums. Even after this period, with the introduction of paper and pens, those materials were still somewhat expensive, difficult to use, and unforgiving of error.

Right from the get-go, you’re building on some shaky foundations here:

1. wax tablets, in particular, are endlessly rewriteable.
2. You seem to ignore the chalk+slate tablet/chalkboard combo, again endlessly rewriteable.

Neither of those were particularly difficult to use, either. Or particularly expensive (hell, the Greeks and Romans used wax tablets for letters, bills of lading,even schoolkid’s writing practice)

---

<div class="post-metadata">

**Author:** ![Nava](https://avatars.discourse-cdn.com/v4/letter/n/da6949/32.png) [@Nava](https://boards.straightdope.com/u/Nava)\
**Post date:** [July 21, 2019, 2:38pm UTC](https://boards.straightdope.com/t/mathematics-should-learn-from-programming-standards/837345/26 "2019-07-21T14:38:13Z")

</div>

For many people, understanding a short symbol is easier than understanding a larger one; a lot of my Chemistry tutoring in the US was spent explaining that [HCO[sub]3[/sub][sup]-[/sup]] can, and in fact for a very popular family of Chemistry problems\* is, a variable. In English “a rose is a rose by any other name”; in Spanish _llámalo x_, “call it x”, has that same meaning of “the essence of things does not change depending on what you call them”, but it is also one of the most basic tools when doing algebra on stuff whose usual symbol is large and clunky. I am very grateful to my Physics and Chemistry HS teachers for the effort they put into making sure that their students knew to write our substitutions at the beginning of a problem, and to revert them explicitly at the end of the same.

That the OP has apparently encountered work by people who didn’t know to apply those rules doesn’t mean the solution is to have to drag large symbols all around the page when calling it x is just a lot more convenient. It’s not about space, it’s about ease.

- equilibrium problems, and specifically those based on the carbonate family. Teachers love their bicarbonate, man.

---

<div class="post-metadata">

**Author:** ![Nava](https://avatars.discourse-cdn.com/v4/letter/n/da6949/32.png) [@Nava](https://boards.straightdope.com/u/Nava)\
**Post date:** [July 21, 2019, 2:49pm UTC](https://boards.straightdope.com/t/mathematics-should-learn-from-programming-standards/837345/27 "2019-07-21T14:49:34Z")

</div>

> [@Daylate](#):
>
> That didn’t bother the chess authorities at all. A few years ago they were perfectly happy to replace “descriptive notation”, in use for hundreds of years and with thousands of books written using it), with an abortion called “algebraic notation”, seemingly because they wanted change for change’s sake.
> 
> And I could see no improvement in either clarity or convenience.

“A few years”? My Dad’s chess books are written like that and they’re dated in the 1950 through the 1970s. I suspect it may be a matter of one of several pre-existing notations becoming more widespread: you had been trained in a different one, but you might actually have been in a minority.

---

<div class="post-metadata">

**Author:** ![HMS\_Irruncible](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/hms_irruncible/32/7394_2.png) [@HMS\_Irruncible](https://boards.straightdope.com/u/HMS_Irruncible)\
**Post date:** [July 21, 2019, 2:55pm UTC](https://boards.straightdope.com/t/mathematics-should-learn-from-programming-standards/837345/28 "2019-07-21T14:55:39Z")

</div>

> [@DPRK](#):
>
> That’s all fair enough, but I don’t think we can really condone as good style notation in which identical symbols, or ones not easily distinguishable, stand for different things. Surely that is avoidable.

This is not correct. Computer languages, at least the good ones, are lexically scoped so that you can reuse variable names. A well-designed function is short and has no side-effects, so it’s safe (indeed preferable) to use short variables like a, i, n, or whatever.

Meaningful variable name are only important in these cases:  
[ol]  
[li]Your language is not typed[/li][li]Your language is not lexically scoped (in this case, first try finding another job)[/li][li]You inherited a codebase where the methods/functions are too long, or it isn’t even organized into distinct units.[/li][li]When calling a foreign function, it is helpful (though not required) to use a variable name that hints how it will be used in the called function.[/li][/ol]

Basically… write good code, and this problem isn’t a problem anymore.

---

<div class="post-metadata">

**Author:** ![HMS\_Irruncible](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/hms_irruncible/32/7394_2.png) [@HMS\_Irruncible](https://boards.straightdope.com/u/HMS_Irruncible)\
**Post date:** [July 21, 2019, 3:01pm UTC](https://boards.straightdope.com/t/mathematics-should-learn-from-programming-standards/837345/29 "2019-07-21T15:01:57Z")

</div>

> [@glowacks](#):
>
> Computer programs need descriptive variable names because computer programs have a much higher likelihood to be need to be read by people who don’t already understand what it is they do.

To phrase another way, much of the body of mathematics has no application at all, whereas a computer program likely mediates at least one application. So it can be helpful to differentiate context.

but again, as I write above, the solution there is to make your code more math-like (use tight, single-purpose functions with no side effect). Let your function signature explain itself, don’t put this burden on variables or comments (which have been known to lie).

---

<div class="post-metadata">

**Author:** ![glee](https://avatars.discourse-cdn.com/v4/letter/g/b5a626/32.png) [@glee](https://boards.straightdope.com/u/glee)\
**Post date:** [July 21, 2019, 3:49pm UTC](https://boards.straightdope.com/t/mathematics-should-learn-from-programming-standards/837345/30 "2019-07-21T15:49:23Z")

</div>

> [@Daylate](#):
>
> That didn’t bother the chess authorities at all. A few years ago they were perfectly happy to replace “descriptive notation”, in use for hundreds of years and with thousands of books written using it), with an abortion called “algebraic notation”, seemingly because they wanted change for change’s sake.
> 
> And I could see no improvement in either clarity or convenience.

The main reasons for the change from descriptive notation (e.g. 1. P-K4 N-KB3) to algebraic notation (e.g. 1. e4 Nf6) were:

- in descriptive, each square had two names 😕, depending whether you were White or Black (algebraic had a single name)
- having only one system made it easier to sell books world-wide, syndicate chess columns and keep score in international events + correspondence games
- there were a lot of countries using algebraic already
- algebraic was slightly shorter (a small benefit!)

I used descriptive myself for decades, but switched to algebraic within a week…

---

<div class="post-metadata">

**Author:** ![Thudlow\_Boink](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/thudlow_boink/32/320_2.png) [@Thudlow\_Boink](https://boards.straightdope.com/u/Thudlow_Boink)\
**Post date:** [July 21, 2019, 4:22pm UTC](https://boards.straightdope.com/t/mathematics-should-learn-from-programming-standards/837345/31 "2019-07-21T16:22:42Z")

</div>

> [@Sage\_Rat](#):
>
> Turning a formula into code should be, in essence, a 1:1 conversion. If you’re going to use to use the gamma function, being able to load your “paper” into an IDE and having it take me into a library for complex numbers when I right click the Γ would be horribly useful, in terms of identifying what I am looking at.

I can’t tell for sure, but you may be confusing “function” and “formula.” In computer programming, a function is something that performs a specific, well-defined calculation for a specific purpose; but that’s not how modern mathematicians use the term “function.”

[Here’s the Wikipedia article for the Gamma function](https://en.wikipedia.org/wiki/Gamma_function). What would your hypothetical wished-for IDE have given you when you “click the Γ”? Something like this whole article, or a specific part of it, or something else?

> [@](#):
>
> If I just see the Γ, I have no idea if it’s a thing that this person has declared or is a mathematical standard. If the latter, is it a Greek character or Hebrew or what? The time spent tracking down the formula makes a person lose track and forget what the original topic was or how this fit in at all.

A good writer of mathematics or anything else should know their audience, and should not use terminology or symbols that a significant portion of that audience would be unfamiliar with, without some sort of explanation or reference. That’s true of any field.

---

<div class="post-metadata">

**Author:** ![RaftPeople](https://avatars.discourse-cdn.com/v4/letter/r/6f9a4e/32.png) [@RaftPeople](https://boards.straightdope.com/u/RaftPeople)\
**Post date:** [July 21, 2019, 4:28pm UTC](https://boards.straightdope.com/t/mathematics-should-learn-from-programming-standards/837345/32 "2019-07-21T16:28:04Z")

</div>

> [@HMS\_Irruncible](#):
>
> To phrase another way, much of the body of mathematics has no application at all, whereas a computer program likely mediates at least one application. So it can be helpful to differentiate context.
> 
> but again, as I write above, the solution there is to make your code more math-like (use tight, single-purpose functions with no side effect). Let your function signature explain itself, don’t put this burden on variables or comments (which have been known to lie).

This is absolutely horrible advice. Fortunately, I’ve never encountered a large system where anyone was naive enough to actually do this.

If you’ve decomposed your functions to the extent that you don’t need any meaningful variable names then you’ve decomposed way too far and reduced the readability of your code and thus cost your company money due to the time it takes for others to figure out how it works.

In addition, this just pushes the problem onto the function names. When you have an order of magnitude more names then the need for organization of the names increases significantly and the length of the names increases. It can be challenging to create function names that incorporate the full hierarchy of context.

You’ve also cost your company money due to the overhead of creating hundreds of thousands or millions of functions that didn’t need to exist.  
Regarding no comments:  
Programming languages are not designed to describe anything about the problem being modeled. While it’s true that good code organization and naming of functions and variables can reduce some of the need for comments, they simply can not eliminate the need for additional information for rapid understanding of the software.  
Regarding comments lie:  
“comments (which have been known to lie)”  
So can function names, class names, table names, etc. Everything can lie, so your solution is to eliminate a valuable tool because some people make mistakes once in a while?

Should we eliminate function names for the same reason?

---

<div class="post-metadata">

**Author:** ![Mijin](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/mijin/32/9369_2.png) [@Mijin](https://boards.straightdope.com/u/Mijin)\
**Post date:** [July 21, 2019, 4:56pm UTC](https://boards.straightdope.com/t/mathematics-should-learn-from-programming-standards/837345/33 "2019-07-21T16:56:33Z")

</div>

> [@RaftPeople](#):
>
> Regarding no comments:  
> Programming languages are not designed to describe anything about the problem being modeled. While it’s true that good code organization and naming of functions and variables can reduce some of the need for comments, they simply can not eliminate the need for additional information for rapid understanding of the software.
> 
> Regarding comments lie:  
> “comments (which have been known to lie)”  
> So can function names, class names, table names, etc. Everything can lie, so your solution is to eliminate a valuable tool because some people make mistakes once in a while?
> 
> Should we eliminate function names for the same reason?

+1 all of this.

In 20+ years as a software developer, I have never encountered code that had so many comments as to decrease readibility, nor have I encountered nonsense oft-cited examples like commenting x++ with // increment x  
However plenty of times I’ve had to basically reverse-engineer code peppered with single character variables and sod all comments.

Or, to put it another way, if “True Scotsman” programmers always write clear enough methods or functions that meaningful variable names are not required, then I know of no True Scotsman programmers.

(The one exception though might be non-nested loop variables)

---

<div class="post-metadata">

**Author:** ![HMS\_Irruncible](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/hms_irruncible/32/7394_2.png) [@HMS\_Irruncible](https://boards.straightdope.com/u/HMS_Irruncible)\
**Post date:** [July 21, 2019, 5:38pm UTC](https://boards.straightdope.com/t/mathematics-should-learn-from-programming-standards/837345/34 "2019-07-21T17:38:00Z")

</div>

> [@RaftPeople](#):
>
> If you’ve decomposed your functions to the extent that you don’t need any meaningful variable names then you’ve decomposed way too far and reduced the readability of your code and thus cost your company money due to the time it takes for others to figure out how it works.

This is 100% unsubstantiated opinion. Honestly it seems like you’ve never read or written good code. Good composition results in maximum readability. Readability should arise from the structure of the program, not your choice of verbiage.

> [@](#):
>
> In addition, this just pushes the problem onto the function names. When you have an order of magnitude more names then the need for organization of the names increases significantly and the length of the names increases. It can be challenging to create function names that incorporate the full hierarchy of context.

Clearly you’ve never heard of namespaces, which are a basic feature of most commercially used programming languages, so we can pretty much discard the rest of your junior critique.

> [@](#):
>
> You’ve also cost your company money due to the overhead of creating hundreds of thousands or millions of functions that didn’t need to exist.

By what reasoning did you determine that thousands of variable names are cheaper than thousands of function names? (Setting aside that it isn’t a 1 for 1 exchange).

> [@](#):
>
> Regarding comments lie:  
> “comments (which have been known to lie)”  
> So can function names, class names, table names, etc. Everything can lie

This is not exactly true. When programmatic entities are incorrectly named, this will often be flagged/failed by the compiler, or a unit test, or an integration test, or a runtime. In other words there is some penalty for lying and some protection against it… for every entity except for comments.

> [@](#):
>
> This is absolutely horrible advice. Fortunately, I’ve never encountered a large system where anyone was naive enough to actually do this.

Dude, dial the heat down a notch. Most of your post boils down to “that’s now how I do it or how I like to do it, and things I don’t like are probably expensive.”

---

<div class="post-metadata">

**Author:** ![HMS\_Irruncible](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/hms_irruncible/32/7394_2.png) [@HMS\_Irruncible](https://boards.straightdope.com/u/HMS_Irruncible)\
**Post date:** [July 21, 2019, 5:57pm UTC](https://boards.straightdope.com/t/mathematics-should-learn-from-programming-standards/837345/35 "2019-07-21T17:57:36Z")

</div>

> [@Mijin](#):
>
> Or, to put it another way, if “True Scotsman” programmers always write clear enough methods or functions that meaningful variable names are not required, then I know of no True Scotsman programmers.

Your appeal-to-ignorance fallacy kind of cancels out your No True Scotsman there. 😃

Anyway, my point is not “never write comments” or “never use good variable names”. I did not suggest that. Rather I suggest that good program structure should be the first choice for self-describing code.

And if that isn’t possible, here are some perfectly good reasons to write comments, and ways to write them so they don’t lie:  
[ul]  
[li]Explaining the intent of the code. Why did I write this method?[/li][li]Explaining a seemingly nonsense practice. This looks weird/risky. Why did I do that?[/li][li]Signaling a known instability or site of change. This code may break after the year 2038![/li][/ul]

Likewise, here are some good reasons to be very descriptive in variable names:  
[ul]  
[li]Your language uses global variables or lacks namespacing[/li][li]You are calling a foreign function and you want to signal what you think you’re passing to it.[/li][li]You are defining the parameters of a method signature.[/li][li]Your language doesn’t have types, so your variables need a type hint.[/li][li]Your method body is more than a half-screen long, and you don’t have time to refactor it.[/li][/ul]

Considering above, I would ask we talk about _why_ we make certain choices, and the contexts where they make sense, instead of simply declaring that my preferences are good and cheap, but yours are bad and expensive.

For example, the survival skills you learned in PHP are partially irrelevant in Java and wholly irrelevant in Elixir (not that anything is wrong with PHP or Java, and clearly I’m an Elixir fanboy. Just pointing out that the survival practices are different because the languages are different).

---

<div class="post-metadata">

**Author:** ![Voyager](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/voyager/32/133_2.png) [@Voyager](https://boards.straightdope.com/u/Voyager)\
**Post date:** [July 21, 2019, 11:18pm UTC](https://boards.straightdope.com/t/mathematics-should-learn-from-programming-standards/837345/36 "2019-07-21T23:18:48Z")

</div>

> [@HMS\_Irruncible](#):
>
> This is 100% unsubstantiated opinion. Honestly it seems like you’ve never read or written good code. Good composition results in maximum readability. Readability should arise from the structure of the program, not your choice of verbiage.

40 years ago I adapted the Jensen/Wirth Zurich Pascal compiler for my dissertation. The structure was very good, but for some reason they used one or two character variable names throughout. It took me two months to document everything. I blame Wirth because his data structures text did the same thing.

Clearly you’ve never heard of namespaces, which are a basic feature of most commercially used programming languages, so we can pretty much discard the rest of your junior critique.

> [@](#):
>
> By what reasoning did you determine that thousands of variable names are cheaper than thousands of function names? (Setting aside that it isn’t a 1 for 1 exchange).

Thousands of function names imply thousands of functions.

> [@](#):
>
> This is not exactly true. When programmatic entities are incorrectly named, this will often be flagged/failed by the compiler, or a unit test, or an integration test, or a runtime. In other words there is some penalty for lying and some protection against it… for every entity except for comments.

That is misspelling, not lying.

As for comments, they are especially useful in giving the context of code, especially for code written to handle corner cases or weirdnesses forced upon you by your environment. Or do you trust in up to date external documentation?

---

<div class="post-metadata">

**Author:** ![RTFirefly](https://avatars.discourse-cdn.com/v4/letter/r/c77e96/32.png) [@RTFirefly](https://boards.straightdope.com/u/RTFirefly)\
**Post date:** [July 21, 2019, 11:29pm UTC](https://boards.straightdope.com/t/mathematics-should-learn-from-programming-standards/837345/37 "2019-07-21T23:29:48Z")

</div>

> [@Mijin](#):
>
> If there was a convention that every equation has a clear table next to it explaining all the variables, there wouldn’t be a problem.

When writing and proving theorems, mathematicians explain what every bit of notation means, aside from universally accepted notation for sets like the integers, rationals, reals, or complex numbers. As **DPRK** said:

> [@DPRK](#):
>
> A mathematical article may have mind-blowing identifications like, “Let p be a prime number…”, “Let X be a scheme… Pic(X) the Picard group of X…”, “Let G be a group and H a normal subgroup”, etc.

Language like this may be Greek to the average reader, but as others have said, the hard part is the concepts, not the language. The intended audience of people who could make sense of the underlying ideas aren’t going to be slowed down much by the notation.

---

<div class="post-metadata">

**Author:** ![HMS\_Irruncible](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/hms_irruncible/32/7394_2.png) [@HMS\_Irruncible](https://boards.straightdope.com/u/HMS_Irruncible)\
**Post date:** [July 22, 2019, 12:42am UTC](https://boards.straightdope.com/t/mathematics-should-learn-from-programming-standards/837345/38 "2019-07-22T00:42:54Z")

</div>

> [@Voyager](#):
>
> As for comments, they are especially useful in giving the context of code, especially for code written to handle corner cases or weirdnesses forced upon you by your environment. Or do you trust in up to date external documentation?

What did I write to make you think that? I did not mention or imply anything about external documentation. Read my replies above where I explained when comments can be desirable.

Or actually…don’t. I’m done with replies that put words in my mouth or don’t read what I actually posted. However, thank you for being a prime example of one of the biggest problems with comments: people just don’t read.

---

<div class="post-metadata">

**Author:** ![RaftPeople](https://avatars.discourse-cdn.com/v4/letter/r/6f9a4e/32.png) [@RaftPeople](https://boards.straightdope.com/u/RaftPeople)\
**Post date:** [July 22, 2019, 2:03am UTC](https://boards.straightdope.com/t/mathematics-should-learn-from-programming-standards/837345/39 "2019-07-22T02:03:02Z")

</div>

> [@HMS\_Irruncible](#):
>
> This is 100% unsubstantiated opinion. Honestly it seems like you’ve never read or written good code. Good composition results in maximum readability. Readability should arise from the structure of the program, not your choice of verbiage.

There is research surrounding this topic, it’s not just opinion.

> [@](#):
>
> Clearly you’ve never heard of namespaces, which are a basic feature of most commercially used programming languages, so we can pretty much discard the rest of your junior critique.

40 years of experience in a wide variety of languages, OS’s, and problem domains.

> [@](#):
>
> This is not exactly true. When programmatic entities are incorrectly named, this will often be flagged/failed by the compiler, or a unit test, or an integration test, or a runtime. In other words there is some penalty for lying and some protection against it… for every entity except for comments.

The compiler has no idea of the intent of the function and whether the name supports that intent.

> [@](#):
>
> Dude, dial the heat down a notch. Most of your post boils down to “that’s now how I do it or how I like to do it, and things I don’t like are probably expensive.”

The heat is warranted due to how poor the advice was. It’s based on objective evidence from 40 years of experience with large enterprise systems.

Once in awhile I get a lead or a programmer that read some blog somewhere with this type of advice and took it to heart and it takes time to correct their incorrect notions.

I recently fired a lead over this exact topic.

---

<div class="post-metadata">

**Author:** ![Mijin](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/mijin/32/9369_2.png) [@Mijin](https://boards.straightdope.com/u/Mijin)\
**Post date:** [July 22, 2019, 3:07am UTC](https://boards.straightdope.com/t/mathematics-should-learn-from-programming-standards/837345/40 "2019-07-22T03:07:52Z")

</div>

> [@HMS\_Irruncible](#):
>
> Your appeal-to-ignorance fallacy kind of cancels out your No True Scotsman there. 😃

It would have been an appeal to ignorance had I claimed that no such programmers exist.  
Instead I am simply questioning the merit of your advice, given that in my 20 years experience it would be precisely the wrong advice for every programmer I have worked with.

> [@](#):
>
> Anyway, my point is not “never write comments” or “never use good variable names”. I did not suggest that. Rather I suggest that good program structure should be the first choice for self-describing code.

Then it would seem there’s little to debate. No-one is going to argue against good program structure being of primary importance.

I guess the one remaining thing is that you are still implying that _sometimes_ clear variable naming is beneficial, when my opinion is that it _almost always_ is, and for many of the reasons you list.  
Conversely I don’t see any benefit of using single-character names.

[Previous page](https://boards.straightdope.com/t/mathematics-should-learn-from-programming-standards/837345.md?page=1)

[Next page](https://boards.straightdope.com/t/mathematics-should-learn-from-programming-standards/837345.md?page=3)
