Author Topic: "I chose it because it popped into my head"  (Read 5875 times)

0 Members and 1 Guest are viewing this topic.

Offline Hot_Dog

  • CoT Emeritus
  • LV12 Extreme Poster (Next: 5000)
  • *
  • Posts: 3006
  • Rating: +445/-10
    • View Profile
"I chose it because it popped into my head"
« on: January 20, 2012, 08:31:31 pm »
In your programming, what have you chosen for an interesting variable name, value, etc. simply because the idea popped into your head, no matter how ilogical it was?

1. One of my label names: NOPQ.  I needed a name for a local label, and for some reason I thought of this one
2. Values that mean an enemy should move up, down, left or right in a straight line and not diagonally: $D7 - $D0.  Values from 0 to 31 were taken, and the value $D7 just came into my head and wouldn't leave me alone

Offline Builderboy

  • Physics Guru
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5673
  • Rating: +613/-9
  • Would you kindly?
    • View Profile
Re: "I chose it because it popped into my head"
« Reply #1 on: January 20, 2012, 08:35:58 pm »
Looking through my Nightmare source I am pleased to say that none of my variables were named arbitrarily ^^, although I can't go as far as saying they are completely descriptive XD Often times I find the variable 'dist' in source code, referencing some kind of distance.

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: "I chose it because it popped into my head"
« Reply #2 on: January 20, 2012, 11:07:22 pm »
For some reasons, in my BASIC games, I always chose the last real variable letter for animations, then go up as I need more. I go from Theta, to Z, Y, X, etc. For some reasons, though, I always used Z for getkey, so whenever I need Z for key detection, I skip it for animations. Also I skip Y if I'm using the graph screen, since ClrDraw and that stuff resets it to zero.

For other things, such as character position and direction, I start with A, B and so on.

Offline imo_inx

  • Manman, SaviourOfTheMultiverse!
  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 473
  • Rating: +27/-8
  • imo_inx
    • View Profile
Re: "I chose it because it popped into my head"
« Reply #3 on: January 20, 2012, 11:21:24 pm »
I use C for key-press storage, and a/b and d/e for storage of variables for drawing tools.


Offline Juju

  • Incredibly sexy mare
  • Coder Of Tomorrow
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 5730
  • Rating: +500/-19
  • Weird programmer
    • View Profile
    • juju2143's shed
Re: "I chose it because it popped into my head"
« Reply #4 on: January 20, 2012, 11:23:55 pm »
I always gave meaningful names to variables, like K for getKey, X and Y for position, A and B for previous values of X and Y, etc. Oddly I always used the full 8 characters limit for program names. ASDFASDF is a pretty good name as well.
« Last Edit: January 20, 2012, 11:24:52 pm by Juju »

Remember the day the walrus started to fly...

I finally cleared my sig after 4 years you're happy now?
THEGAME
This signature is ridiculously large you've been warned.

The cute mare that used to be in my avatar is Yuki Kagayaki, you can follow her on Facebook and Tumblr.

Offline Darl181

  • «Yo buddy, you still alive?»
  • CoT Emeritus
  • LV12 Extreme Poster (Next: 5000)
  • *
  • Posts: 3408
  • Rating: +305/-13
  • VGhlIEdhbWU=
    • View Profile
    • darl181.webuda.com
Re: "I chose it because it popped into my head"
« Reply #5 on: January 21, 2012, 01:10:48 am »
I normally try to do some acronym or another, but sometimes I forget what it means (I still can't remember some of them as far back as TWHG) :P

Normally for variables I use placement on the keypad, so there'd be the normal X,Y and the forces acting on those are S,T because they're the keys just above.  If there's another thing with similar vars, I might use IJNO or UVZΘ and etc.
« Last Edit: January 21, 2012, 01:15:55 am by Darl181 »
Vy'o'us pleorsdti thl'e gjaemue

Offline Hayleia

  • Programming Absol
  • Coder Of Tomorrow
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3367
  • Rating: +393/-7
    • View Profile
Re: "I chose it because it popped into my head"
« Reply #6 on: January 21, 2012, 01:17:50 am »
I try to give logical names, like Lbl APD to "turn off" the calc (set contrast to 0 :P) or Lbl FAC to clear the box (only french people can see what I did here)
But for random and/or temporary labels, I give names like VH7 :P

As for variables, what I do might not seem logical to everybody but I always use the same scheme for all my programs ;)
I own: 83+ ; 84+SE ; 76.fr ; CX CAS ; Prizm ; 84+CSE
Sorry if I answer with something that seems unrelated, English is not my primary language and I might not have understood well. Sorry if I make English mistakes too.

click here to know where you got your last +1s

Offline Builderboy

  • Physics Guru
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5673
  • Rating: +613/-9
  • Would you kindly?
    • View Profile
Re: "I chose it because it popped into my head"
« Reply #7 on: January 21, 2012, 01:24:26 am »
so there'd be the normal X,Y and the forces acting on those are S,T because they're the keys just above.
I do exactly the same :D  Except when it's Basic and we have to use X Z because Y is silly D:

Offline leafy

  • CoT Emeritus
  • LV10 31337 u53r (Next: 2000)
  • *
  • Posts: 1554
  • Rating: +475/-97
  • Seizon senryakuuuu!
    • View Profile
    • keff.me
Re: "I chose it because it popped into my head"
« Reply #8 on: January 21, 2012, 02:01:56 am »
I always use X and Y for inflated coordinates, S and T for uninflated, A and B for velocity ^^
In-progress: Graviter (...)

Offline jsj795

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1105
  • Rating: +84/-3
    • View Profile
Re: "I chose it because it popped into my head"
« Reply #9 on: January 21, 2012, 04:34:39 am »
I use theta for GetKey cuz... that's what I've always used. And then I use Z for my loops, usually Repeat, and if there are nested loops, I use Y, X, and so on. For character position I tend to use A and B, C and D, and so on. Usually if there is gravity involved I would use G for that, if not, I use G for storing Gold (any currency in game even if not named Gold).
Any other variables I just choose randomly :P


Spoiler For funny life mathematics:
1. ROMANCE MATHEMATICS
Smart man + smart woman = romance
Smart man + dumb woman = affair
Dumb man + smart woman = marriage
Dumb man + dumb woman = pregnancy
2. OFFICE ARITHMETIC
Smart boss + smart employee = profit
Smart boss + dumb employee = production
Dumb boss + smart employee = promotion
Dumb boss + dumb employee = overtime
3. SHOPPING MATH
A man will pay $2 for a $1 item he needs.
A woman will pay $1 for a $2 item that she doesn't need.
4. GENERAL EQUATIONS & STATISTICS
A woman worries about the future until she gets a husband.
A man never worries about the future until he gets a wife.
A successful man is one who makes more money than his wife can spend.
A successful woman is one who can find such a man.
5. HAPPINESS
To be happy with a man, you must understand him a lot and love him a little.
To be happy with a woman, you must love her a lot and not try to understand her at all.
6. LONGEVITY
Married men live longer than single men do, but married men are a lot more willing to die.
7. PROPENSITY TO CHANGE
A woman marries a man expecting he will change, but he doesn't.
A man marries a woman expecting that she won't change, and she does.
8. DISCUSSION TECHNIQUE
A woman has the last word in any argument.
Anything a man says after that is the beginning of a new argument.

Girls = Time * Money (Girls are a combination of time and money)
Time = Money (Time is money)
Girls = Money squared (So, girls are money squared)
Money = sqrt(Evil) (Money is also the root of all evil)
Girls = sqrt(Evil) squared (So, girls are the root of all evil squared)
Girls = Evil (Thus, girls are evil)
*Girls=Evil credit goes to Compynerd255*

Offline turiqwalrus

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 840
  • Rating: +51/-2
  • Wheeeeeee~!
    • View Profile
Re: "I chose it because it popped into my head"
« Reply #10 on: January 21, 2012, 05:55:26 am »
well, I once had a label Wlrus()
it was my display routine :P

Offline All_¥our_Bass

  • LV1 Newcomer (Next: 20)
  • *
  • Posts: 17
  • Rating: +1/-0
  • Spins Leeks
    • View Profile
Re: "I chose it because it popped into my head"
« Reply #11 on: January 26, 2012, 11:42:08 pm »
K for getkey, anything else is either initials/first letter or just A then B then C,etc.
SOPA = Sons Of the Patriots Act

Stop SOPA