Forum:Standardising variable names

From the RuneScape Wiki, the wiki for all things RuneScape
Jump to: navigation, search
Forums: Yew Grove > Standardising variable names
Archive
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
  • - armour rating
  • - defence
  • - kills of a monster
  • - level in a skill (such as experience lamps)
  • - tier
  • - experience
  • - input of an item/currency/points
  • or - affinity
Subscripts
  • - Melee version of F
  • - Ranged version of F
  • - Magic version of F
  • - Hybrid version of F
  • - Main-hand version of F
  • - Off-hand version of F

Discussion

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

Support Quest.png Gaz Lloyd 7:^]Events!99s 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 Quest.png Gaz Lloyd 7:^]Events!99s 00:38, January 11, 2016 (UTC)
F(H)* Korasi's sword.png Archmage Elune  TalkHS Void knight deflector.png fetus is my son and I love him. 00:42, January 11, 2016 (UTC)
MolMan 00:44, January 11, 2016 (UTC)

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

Eh, \cdot. User_talk:Fswe1 Fswe1 Brassica Prime symbol.png 07:13, January 11, 2016 (UTC)
Seedot? User talk:ThePsionic.png: RS3 Inventory image of User talk:ThePsionic ThePsionic Special:Contributions/ThePsionic.png: RS3 Inventory image of Special:Contributions/ThePsionic 08:46, January 11, 2016 (UTC)
Nice. But no, the LaTeX command. User_talk:Fswe1 Fswe1 Brassica Prime symbol.png 13:53, January 11, 2016 (UTC)
I would suggest either \times or nothing for multiplication - - 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). Quest.png Gaz Lloyd 7:^]Events!99s 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 ℓ)? --Saftzie (talk) 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... User_talk:Fswe1 Fswe1 Brassica Prime symbol.png 07:13, January 11, 2016 (UTC)

and are already taken, so what's the alternative really User talk:ThePsionic.png: RS3 Inventory image of User talk:ThePsionic ThePsionic Special:Contributions/ThePsionic.png: RS3 Inventory image of Special:Contributions/ThePsionic 08:45, January 11, 2016 (UTC)
? --Saftzie (talk) 11:40, January 11, 2016 (UTC)
Fuck you too. MolMan 13:00, January 11, 2016 (UTC)
It's now for "Wizard". ( ͡° ͜ʖ ͡°) MolMan 13:07, January 11, 2016 (UTC)
You mean User talk:ThePsionic.png: RS3 Inventory image of User talk:ThePsionic ThePsionic Special:Contributions/ThePsionic.png: RS3 Inventory image of Special:Contributions/ThePsionic 13:08, January 11, 2016 (UTC)
, Tom. MolMan 13:10, January 11, 2016 (UTC)
F_W or w could stand for Warrior. Honestly, works best. User_talk:Fswe1 Fswe1 Brassica Prime symbol.png 13:53, January 11, 2016 (UTC)
Too late! It's . With both styles beginning with M, one of them had to give up their original identity. MolMan 13:55, January 11, 2016 (UTC)
So, 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 User talk:ThePsionic.png: RS3 Inventory image of User talk:ThePsionic ThePsionic Special:Contributions/ThePsionic.png: RS3 Inventory image of Special:Contributions/ThePsionic 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.
Longer texts can become impossible to read by being too long.
versus
versus even just the subscript not shortened
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 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 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 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),
is a fairly straight forward formula.
, 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. Quest.png Gaz Lloyd 7:^]Events!99s 20:36, January 11, 2016 (UTC)

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

Yes. The subscripts could be or . No point in listing them all, so I chose for . MolMan 22:58, January 12, 2016 (UTC)
Oppose Aff because the spacing is weird. cqm 21:13, 14 Jan 2016 (UTC) (UTC)

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)