Forums: Yew Grove > Standardising variable names
Replacement filing cabinet
This page or section is an archive.
Please do not edit the contents of this page.
This thread was archived on 20 January 2016 by Liquidhelium.

Proposing a style guideline that sets out to improve the readability of mathematical formulae.

First, we need to start using single letter variable names as much as possible.

Next, we create as much consistency for variable names in functions. This obviously shouldn't dictate the names of every variable in every formula, but in general, I propose the following letters be linked to the following arguments.

In every case, variable names should be explained below the formula.

Proposed variables
  • $ a $ - armour rating
  • $ d $ - defence
  • $ k $ - kills of a monster
  • $ l $ - level in a skill (such as experience lamps)
  • $ t $ - tier
  • $ x $ - experience
  • $ y $ - input of an item/currency/points
  • $ \alpha $ or $ aff $ - affinity
  • $ F_{Melee} $ - Melee version of F
  • $ F_{Ranged} $ - Ranged version of F
  • $ F_{Magic} $ - Magic version of F
  • $ F_{Hybrid} $ - Hybrid version of F
  • $ F_m $ - Main-hand version of F
  • $ F_o $ - Off-hand version of F


Support - MolMan 00:10, January 11, 2016 (UTC)

Support Weird gloop @Gaz#7521 00:33, January 11, 2016 (UTC)

Oppose - I don't have the FH button on my keyboard --Iiii I I I 00:35, January 11, 2016 (UTC)

Press Alt + F4 + H MolMan 00:36, January 11, 2016 (UTC)
Shift+9 Shift+h Shift+0 Weird gloop @Gaz#7521 00:38, January 11, 2016 (UTC)
F(H)* Korasi's sword Archmage Elune  TalkHS Void knight deflector fetus is my son and I love him. 00:42, January 11, 2016 (UTC)
$ f(H) $ MolMan 00:44, January 11, 2016 (UTC)

Comment - I propose we use $ \times $ for multiplication and immediately block anyone who uses $ * $ in Latex. MolMan 00:44, January 11, 2016 (UTC)

Eh, \cdot. 18px-Avatar.png Fswe1 26px-Brassica_Prime_symbol.svg.png 07:13, January 11, 2016 (UTC)
Seedot? Beach ball ThePsionic Ice cream 08:46, January 11, 2016 (UTC)
Nice. But no, the LaTeX command. 18px-Avatar.png Fswe1 26px-Brassica_Prime_symbol.svg.png 13:53, January 11, 2016 (UTC)
I would suggest either \times or nothing for multiplication - $ 100 \times A = 100 A $ - with preference to \times. \cdot can be confusing if you're not aware of the difference between it and a decimal point - and some places/texts/etc use a cdot as a decimal point and a baseline dot for multiplication. Best to just avoid all of that by using \times, and reserve \cdot for vector dot products only (should we need to use that). Weird gloop @Gaz#7521 20:36, January 11, 2016 (UTC)

Question - If we're going to standardize, why is there a preference for uppercase (e.g., L) instead of lowercase (e.g., l or ℓ)? --User:Saftzie/Signature 04:27, January 11, 2016 (UTC)

Because I literally copy pasted from existing calculations. There, fixed for most. I prefer capitalization on the subscript skills to leave lowercase m free for "main-hand". MolMan 13:07, January 11, 2016 (UTC)

Support - Fx for Magic though? Er... 18px-Avatar.png Fswe1 26px-Brassica_Prime_symbol.svg.png 07:13, January 11, 2016 (UTC)

$ F_{M} $ and $ F_{m} $ are already taken, so what's the alternative really Beach ball ThePsionic Ice cream 08:45, January 11, 2016 (UTC)
$ F_\mu $? --User:Saftzie/Signature 11:40, January 11, 2016 (UTC)
Fuck you too. MolMan 13:00, January 11, 2016 (UTC)
It's now $ F_w $ for "Wizard". ( ͡° ͜ʖ ͡°) MolMan 13:07, January 11, 2016 (UTC)
You mean $ F_W $ Beach ball ThePsionic Ice cream 13:08, January 11, 2016 (UTC)
$ F_\mu $, Tom. MolMan 13:10, January 11, 2016 (UTC)
F_W or w could stand for Warrior. Honestly, $ \mu $ works best. 18px-Avatar.png Fswe1 26px-Brassica_Prime_symbol.svg.png 13:53, January 11, 2016 (UTC)
Too late! It's $ F_W $. With both styles beginning with M, one of them had to give up their original identity. MolMan 13:55, January 11, 2016 (UTC)
So, $ F_\mu $ it is then? Fswe1 (talk) 14:34, January 11, 2016 (UTC)
No. Avoid Greek letters unless we have to use them. MolMan 14:36, January 11, 2016 (UTC)

Support - yaaaaasss Beach ball ThePsionic Ice cream 08:45, January 11, 2016 (UTC)

Comment - First, we need to start using single letter variable names as much as possible. - I do not see why this is necessarily true. The single-letter subscripts M, m, and W do not seem to make the equation easier to understand due to the conflicting nature. Please convince me that this can make the math more readable. Riblet15 18:34, January 11, 2016 (UTC)

Easily distinguishable.
$ \begin{align} & S_M + S_W \times \frac{S_W}{S_R} & \text{Easy to parse} \\ & S_{Melee} + S_{Magic} \times \frac{S_{Magic}}{S_{Ranged}} & \text{Extra thinking} \end{align} $
Longer texts can become impossible to read by being too long.
  • $ Affinity_{melee} = (65 \times Armour_{magic} + 45 \times Armour_{ranged} + 55 \times Armour_{melee} + 55 \times Armour_{hybrid} ) / Armour_{total\ worn} $
  • $ \alpha_M = \frac{45 A_W + 65 A_R + 55 A_M + 55 A_H}{A_E} $
versus even just the subscript not shortened
  • $ \alpha_{Melee} = \frac{45 A_{Magic} + 65 A_{Ranged} + 55 A_{Melee} + 55 A_{Hybrid}}{A_{Equipped}} $
In any case, I'm proposing we require all variables to be elaborated, which itself should satisfy any concerns about confusion. MolMan 18:46, January 11, 2016 (UTC)

Question - Why? ʞooɔ 18:58, January 11, 2016 (UTC)

It's a good kind of consistency. If I see $ l $ used for level on one page, it'd make sense to see level on another page use the same variable. MolMan 19:03, January 11, 2016 (UTC)
Consistency is a good thing (and I hope we can all agree on that), but it's not clear to me why shorter, non-obvious variable names like $ A_W $ are a good idea. We should endeavor to make the formulas as easy to follow as possible, and I 100% disagree with Mol's assertion that $ S_M + S_W \times \frac{S_W}{S_R} $ is easier to parse than something that writes out the actual names of variables in an explanatory way. We should try to make it so people can read possibly-complex formulas without having to glance back at the variable definitions all the time. If the text becomes too long, we can have line breaks (which we tend to already do for longer equations).
The obvious pressure point that Fswe identified is that it's weird to have "X" refer to Magic. Psi asks what the alternative is...and by the time we're asking that question, it's clear to me that we're locking ourselves into a restrictive standard for dubious reasons. Let's step back and agree that standardization is a good idea, and discuss the merits of longer and shorter variable names, which I haven't seen much of here. ʞooɔ 19:13, January 11, 2016 (UTC)
I don't see any reason to shy away from single letter variables either. I'll admit that when it comes to disambiguating things like those subscripts, the initial proposal wasn't a very good one, but that's not necessarily a good argument against all single letter names. If we're discussing experience gained at a level (for this example, Jack of trades aura),
$ x = \tfrac{3}{2}\left(l^2-2l+100\right) $ is a fairly straight forward formula.
$ experience = \tfrac{3}{2}\left(level^2-2level+100\right) $, on the other hand doesn't improve my understanding. It's definitely longer, which isn't inherently bad, but it certainly feels unnecessary.
Most of the equations where I want to see this consistency applied to are that straight forward. For the more complex equations like those on Affinity, I'm not entirely opposed to writing out more of the variables, but everything I see no reason not to. MolMan 19:32, January 11, 2016 (UTC)
Also equations past a certain length clip off the page, since they're images and not reflowable text. I don't think its a problem in the vast majority of cases, but still. Its kinder to smaller screens to have them shorter. Weird gloop @Gaz#7521 20:36, January 11, 2016 (UTC)

Comment: I take it $ F $ is just a meaningless example? --Henneyj 22:55, January 12, 2016 (UTC)

Yes. The subscripts could be $ Aff_{Magic} $ or $ Acc_{Magic} $. No point in listing them all, so I chose $ F $ for $ F_{uck} $. MolMan 22:58, January 12, 2016 (UTC)
Oppose Aff because the spacing is weird. User:Cqm/Signature

Closed - The concept of standardizing variable names seems to have reached consensus. However, there is still debate over the best standardized variable names (and there likely will always be disagreement over this issue). Whoever is willing to put in the work of standardizing all these names can select someone reasonable. Use common sense. --LiquidTalk 22:04, January 20, 2016 (UTC)

Community content is available under CC-BY-SA unless otherwise noted.