Page 1 of 1

Bob, Jim and Tim

Posted: Tue Nov 01, 2005 5:34 pm
by Killswitch
I have a really odd habbit of 'naming' my variables. Not in the sense that I give them names that describe what information they hold, but actual people's names. Usually they're three letters long and the most common are 'Bob', 'Jim' and 'Tim'. 'Kim' crops up occasionally - but not as often as the other three. Now this is usually only in very small projects, and 'test' files as otherwise I'd very quickly run out of variable names in a larger project - I was just wondering if anyone else has any quirky coding habits?

Posted: Tue Nov 01, 2005 5:40 pm
by Kale
In an old job i had developing websites a guy used to use: 'foo' and 'bar' ad 'stuff' alot, used to drive me up the wall! :roll:

Posted: Tue Nov 01, 2005 5:49 pm
by Psychophanta
I use to use 2 to 6 characters for variables, because less than 2 is not usually descriptive enough, and more than 6 or 8 is too much text.
But often i miss greek symbols for variables.
Should be good if editor and compiler allow that. :)

Posted: Tue Nov 01, 2005 6:17 pm
by Pantcho!!
Crap.s
Test.s
ShitX.l
ShitY.l
WorkIt.l
FuckenWork.l

OhYEahh.l

Posted: Tue Nov 01, 2005 6:41 pm
by dagcrack
Well, similar to pantcho (I think he already knows this heh)..

But yes, usualy very obsene variable names from my side (of course, but of course, for testing: small sources or very little programs that are for my own usage.. else I use descriptive variable names with no obsene contents hehe).

I'd sure get banned if I wrote down a list of this variable names...
But most common is "pija" (its a lexic from "penis" in spanish, very funny, indeed....... that is because my brother used to say "this is a pija, this is pija, this other is pija, its all pija" hence... I used to tell him "heck you love pijas!" and now for some odd reason I often use that as a variable for testing purposes)... They dont come worst than that, do they?


(laughs)...
Anyone with something worst than this?


Also.. would anyone tell me why everyone uses 'l' for 'for' loops.. I find 'm' more addecuate, but this 'l' variable I've seen it since long time ago, whats the deal with 'l' anyway?

I also add some formatting when I define a value in an array
for example:

Image
etc

(and yes I use ; at the end of almost everything, this must be something to do with php or c.. else I might fall into basic's lazyness and whenever I must work in say, php, I might forget about the ; ...).

Posted: Tue Nov 01, 2005 7:11 pm
by Trond
dagcrack wrote:Also.. would anyone tell me why everyone uses 'l' for 'for' loops.. I find 'm' more addecuate, but this 'l' variable I've seen it since long time ago, whats the deal with 'l' anyway?
I stands for iteration.

Posted: Tue Nov 01, 2005 7:38 pm
by blueznl
i'm not everyone :-)

always use 'n' for simple loops

but about strange habits... i always use underscores

old_screen_size = whatever

and i tend to (ab)use the word 'old'

if old_screen_size <> screen_size

and similar constructions

i never caught myself using strange or funny variable names... yet :-)

Posted: Tue Nov 01, 2005 7:49 pm
by CodeMonkey
I was doing some later night programming with a mate once and he started to spell 'customers' as 'custard', the name sort of stuck by the end of the night had:

bowls_of_custard
spoons_of_custard
and all sorts of other names based on this custard theme

Needless to say the code was unreadable the next day but it strangely worked and is probably still in use to this day :cry:

Posted: Tue Nov 01, 2005 7:58 pm
by dagcrack
Heheheh
Iterations, makes sense.. However its stupid
Like those using 'FP' variable name for file pointers... pisses me off.
Cant you hold in your brain whats that variable holding ?? jeez. at least give it a more reasonable name, defining which file pointer is it.

Bah, I shouldnt care about them..

Now that I remember, I did had "pija" as an array name in a commercial project which did ship like that (laughs).. No one ever noticed of course. (How professional can you be? :lol: ).

Posted: Tue Nov 01, 2005 8:02 pm
by PB
> I use to use 2 to 6 characters for variables

I used to use just 2 chars for variables because that's how it was back in
the VIC-20 and C-64 days. :) Nowadays though I use either full descriptive
words (eg. "admin" if the user has admin rights on the PC) or acronyms for
longer stuff (eg. "sww" to indicate whether the app starts with Windows).

Posted: Tue Nov 01, 2005 8:23 pm
by Killswitch
I use 't' for loops.

Edit:

Well I started off with DarkBasic, and in the documentation for 'For Next' loops they used a 't'. It's just stuck.

Posted: Tue Nov 01, 2005 8:26 pm
by dagcrack
And the reason?
To me M is closer than anything else.. comfyness!
It's because of my way of typing.. believe it or not I type faster with my method than with other conventional methods..

I can tell you that the M here is kind of losing the ink in this keyboard :p
So I might use it a lot I guess.. mhh loops, nice and tastey.

Posted: Tue Nov 01, 2005 8:40 pm
by Psychophanta
Killswitch wrote:I use 't' for loops.
Me too :shock:
I learned my first basic with AppleII basic, and since then i usually use 't' for the For-Next loop.

BTW: is this thread offtopic?. May be General discussion, or hybrid :P

Posted: Wed Nov 02, 2005 11:02 am
by Pantcho!!
me too! i had books on basic programming on Apple // computer!

it rocked!

i had this stupid robot to display with ascii

hehehe

and for loops i allway use "For x = ..."
always.