1waffle1
|
  |
| Joined: 16 Oct 2007 |
| Total Posts: 16381 |
|
|
| 17 Aug 2011 02:02 PM |
| Is it sad that half the time I spend on programming is on choosing names for variables? |
|
|
| Report Abuse |
|
|
Oysi
|
  |
| Joined: 06 Jul 2009 |
| Total Posts: 9058 |
|
| |
|
| |
|
LPGhatguy
|
  |
 |
| Joined: 27 Jun 2008 |
| Total Posts: 4725 |
|
|
| 17 Aug 2011 02:06 PM |
Yup.
"Eh, maybe I should call this RegionSet... Nah, nah, how about I abbreviate that to RegionS... no, that's too close to my other variable, Regions... RegionSet it is!" |
|
|
| Report Abuse |
|
|
|
| 17 Aug 2011 02:06 PM |
I just describe whatever Im doing function plugin_gui_off() |
|
|
| Report Abuse |
|
|
|
| 17 Aug 2011 02:08 PM |
Why not just call it what it is supposed to be. Or most the time I use "var" and "var2" if I can't think of a name
~ Mitch ~ |
|
|
| Report Abuse |
|
|
Oysi
|
  |
| Joined: 06 Jul 2009 |
| Total Posts: 9058 |
|
| |
|
|
| 17 Aug 2011 02:11 PM |
I dont.. I usually just take few letters and use them as a name for the variable :o Such as if I make variable for chars Right Shoulder, I would probably use rS (most of time, I leave the first letter small :D) With the exception of tables. For tables I write the full name :D |
|
|
| Report Abuse |
|
|
1waffle1
|
  |
| Joined: 16 Oct 2007 |
| Total Posts: 16381 |
|
|
| 17 Aug 2011 02:24 PM |
I like to use letters in my for loops, but in pairs, for the first argument, I JUST DON'T KNOW WHAT TO CALL IT AFTER THE SECOND BRANCH.
for _, a in ipairs(table) do for WHAT!!!, b in ipairs(table) do end end |
|
|
| Report Abuse |
|
|
DanJ555
|
  |
| Joined: 05 Feb 2011 |
| Total Posts: 36 |
|
|
| 17 Aug 2011 02:27 PM |
Trololol, it's normal.
-El anciano desnudo |
|
|
| Report Abuse |
|
|
| |
|
Tenal
|
  |
| Joined: 15 May 2011 |
| Total Posts: 18684 |
|
| |
|
myrco919
|
  |
| Joined: 12 Jun 2009 |
| Total Posts: 13241 |
|
| |
|
|
| 17 Aug 2011 02:34 PM |
If it's something simple that I'm just testing, I'll use easy stuff like 'a' 'b' etc...
It it's something I actually care about I'll use descriptive names.
~~{I'm a dangerous sociopath with a long history of violence}~~ ~{I don't understand how you keep forgetting that}~ |
|
|
| Report Abuse |
|
|
Oysi
|
  |
| Joined: 06 Jul 2009 |
| Total Posts: 9058 |
|
| |
|
sncplay42
|
  |
| Joined: 27 Nov 2008 |
| Total Posts: 11891 |
|
|
| 17 Aug 2011 03:53 PM |
[[I like to use letters in my for loops, but in pairs, for the first argument, I JUST DON'T KNOW WHAT TO CALL IT AFTER THE SECOND BRANCH.
for _, a in ipairs(table) do for WHAT!!!, b in ipairs(table) do end end]]
YOu know you can just call it _ too if you're not using it, right? |
|
|
| Report Abuse |
|
|
|
| 17 Aug 2011 04:24 PM |
Very few of my declarations are important. So they don't get much thought. Generally, I go in order from a,b,c,d,e,f,g etc for data i,o,j,k for iterators
etc.
Functions get camelCase names that conform to some sort of order with the rest of the program. Pretty simple. |
|
|
| Report Abuse |
|
|
|
| 17 Aug 2011 04:28 PM |
Is it bad that mine or random letters? D:
~~ In Soviet Russia, scripts write you. ~~ |
|
|
| Report Abuse |
|
|
|
| 17 Aug 2011 04:28 PM |
"I like to use letters in my for loops, but in pairs, for the first argument, I JUST DON'T KNOW WHAT TO CALL IT AFTER THE SECOND BRANCH.
for _, a in ipairs(table) do for WHAT!!!, b in ipairs(table) do end end"
You know you can name both _, as long as you don't need them, right?
_ is often used as a variable to represent a value you don't want; don't need.
Don't be scared of overwriting _. If _ shouldn't be overwritten, then it shouldn't be called _. Also, I'd suggest using next instead of pairs/ipairs, since next is more efficient, but, hey, that's just me. |
|
|
| Report Abuse |
|
|
|
| 17 Aug 2011 04:28 PM |
or = are :3
~~ In Soviet Russia, scripts write you. ~~ |
|
|
| Report Abuse |
|
|
NeodAemon
|
  |
| Joined: 30 Jul 2010 |
| Total Posts: 89 |
|
|
| 17 Aug 2011 04:37 PM |
I usually just add random words put together <3
LOLWUT. LOLHAX. |
|
|
| Report Abuse |
|
|
NeodAemon
|
  |
| Joined: 30 Jul 2010 |
| Total Posts: 89 |
|
|
| 17 Aug 2011 04:51 PM |
| Y u no reply to my random post? :'c |
|
|
| Report Abuse |
|
|
| |
|
| |
|