What is your favorite variable name? - was: Re: [nodejs] Re: what is your favorite JS editor?

97 views
Skip to first unread message

Rob Koberg

unread,
Dec 19, 2011, 12:04:00 AM12/19/11
to nod...@googlegroups.com
uff

Mark S

unread,
Dec 19, 2011, 1:51:35 PM12/19/11
to nodejs
i

Naouak

unread,
Dec 19, 2011, 1:57:27 PM12/19/11
to nod...@googlegroups.com
prout (french speaking people will understand)

Naouak, Grade 2 de Kobal.
Site web: http://www.naouak.net


On Mon, Dec 19, 2011 at 19:51, Mark S <ma...@topicnine.com> wrote:
i

--
Job Board: http://jobs.nodejs.org/
Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nod...@googlegroups.com
To unsubscribe from this group, send email to
nodejs+un...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

Ryan Gahl

unread,
Dec 19, 2011, 2:05:03 PM12/19/11
to nodejs
davidHasselhoff

Mark Hahn

unread,
Dec 19, 2011, 2:23:50 PM12/19/11
to nod...@googlegroups.com
foo, bar and especially fubar.
 

Angel Java Lopez

unread,
Dec 19, 2011, 2:30:20 PM12/19/11
to nod...@googlegroups.com
What is the origin of foo/bar?

I read in an old Software Development mag (from the past century ;-) that they are related to navy jargon.

Something like : free object on board all reassured 

Is it true?

Angel "Java" Lopez
from Argentina

On Mon, Dec 19, 2011 at 4:23 PM, Mark Hahn <ma...@hahnca.com> wrote:
foo, bar and especially fubar.
 

--

Mark Hahn

unread,
Dec 19, 2011, 2:34:18 PM12/19/11
to nod...@googlegroups.com
LOL.  Fubar means Fucked Up Beyond All Repair.  And yes, it came from world war II.

Dean Landolt

unread,
Dec 19, 2011, 3:08:48 PM12/19/11
to nod...@googlegroups.com
On Mon, Dec 19, 2011 at 2:34 PM, Mark Hahn <ma...@hahnca.com> wrote:
LOL.  Fubar means Fucked Up Beyond All Repair.  And yes, it came from world war II.

So they say. Same with snafu (situation normal: all fucked up). 

Angel Java Lopez

unread,
Dec 19, 2011, 3:20:10 PM12/19/11
to nod...@googlegroups.com

Louis Santillan

unread,
Dec 19, 2011, 3:44:15 PM12/19/11
to nod...@googlegroups.com
Since I haven't seen it offered, I'm a pico/nano user. But that might need to change. They don't play well with Shell In A Box. Specifically, ctl-w (search) closes your browser tab.  Probably something I could easily fix in siab's keyboard handler.

-L

Marak Squires

unread,
Dec 19, 2011, 3:45:14 PM12/19/11
to nod...@googlegroups.com
self

On Mon, Dec 19, 2011 at 12:04 AM, Rob Koberg <r...@koberg.com> wrote:
uff


--
Job Board: http://jobs.nodejs.org/
Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nod...@googlegroups.com
To unsubscribe from this group, send email to
nodejs+un...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en



--
-- 
Marak Squires
Co-founder and Chief Evangelist
Nodejitsu, Inc.

Christoph Häckel

unread,
Dec 19, 2011, 6:07:39 PM12/19/11
to nod...@googlegroups.com

wazzaaaaaah

(mostly used for debugging :-)

Bradley Meck

unread,
Dec 19, 2011, 6:20:51 PM12/19/11
to nod...@googlegroups.com
$_

Dave Clements

unread,
Dec 19, 2011, 7:46:20 PM12/19/11
to nodejs
i'm fixated with moo, been using it since I was 12 when I first learnt
javascript before I knew about foo bar.
after moo I usually go to poo and then choo. Moo and poo are easy to
type.

.... I'm almost embarassed about admitting that.

Andrew

unread,
Dec 19, 2011, 8:05:47 PM12/19/11
to nodejs

BOOGERS and in caps to imply a constant.

Martín Ciparelli

unread,
Dec 19, 2011, 9:13:28 PM12/19/11
to nod...@googlegroups.com

dada is fast to type

El 19/12/2011 22:05, "Andrew" <davidan...@gmail.com> escribió:

BOOGERS and in caps to imply a constant.

Robert Steckroth

unread,
Dec 19, 2011, 9:32:06 PM12/19/11
to nod...@googlegroups.com
.unshift, because it is untrue in linguistic logic and in practice
(because of you know who). Sigh...


--
Bringing game to younix
Bust0ut Entertainment  ---
PBDefence.com
"Finding the exit without looking"

Axel Kittenberger

unread,
Dec 20, 2011, 5:00:03 AM12/20/11
to nod...@googlegroups.com
I know this was a sarcastic move to "lets talk about editors", and
obviously it didn't work :-)

Anyway, while arguing e.. vim vs Emacs is utter useless, I like
listings like this, because it highlights more alternatives to the
most used ones.

On Mon, Dec 19, 2011 at 6:04 AM, Rob Koberg <r...@koberg.com> wrote:
> uff
>

Dominik Kienzler

unread,
Dec 20, 2011, 5:06:31 AM12/20/11
to nod...@googlegroups.com
i will go with "callback"... at least its the most used variable in my
code xD second would be "i" or "cb" i guess...

Am 20.12.11 03:32, schrieb Robert Steckroth:

Tane Piper

unread,
Dec 20, 2011, 5:06:53 AM12/20/11
to nod...@googlegroups.com
from a recent bit of code, possibly controversial:

var execute_child = require('child_process').fork('./execute');

Rob Koberg

unread,
Dec 19, 2011, 3:25:03 PM12/19/11
to nod...@googlegroups.com
Eek. This is not what I meant with my sarcasm! :)

On Mon, Dec 19, 2011 at 12:20 PM, Angel Java Lopez

Lee Treveil

unread,
Jan 4, 2012, 7:22:12 PM1/4/12
to nod...@googlegroups.com
I seem to use 'haggis' a lot. I don't know why, im not from Scotland.

Mark Hahn

unread,
Jan 4, 2012, 7:33:28 PM1/4/12
to nod...@googlegroups.com
>  I seem to use 'haggis' a lot. I don't know why, im not from Scotland. 

Maybe you saw the movie "I Married An Axe Murderer" too many times?  (great movie)

Xananax

unread,
Jan 5, 2012, 12:32:20 AM1/5/12
to nod...@googlegroups.com
I tend to use "a", "b" "c", and "i".
"asdfd" and "ghgh"come close second.
When approaching deadlines, I begin cluttering my code with variables named "plz", "plzwork", "whyyyyyyyy" , then some "imcool", "allisok" and then again "ohno" and "thistimeitsgonnawork", and so on.
When getting real near the last hours, they becomes insults that are impossible to re-type and actually deserve my debugging purposes.
My debugging output follows the same road. Very organized and shiny at first, with every variable neatly typed and output, and in the end it's "AAAAAAAAAAAAAAAAA WORK WORK WORK NOOOOOOOOO", that kind of stuff.

raisch

unread,
Jan 6, 2012, 1:14:06 PM1/6/12
to nodejs
My favorite variable name is always that name which is the most
succinct representation of the variable's use and purpose within the
context in which it is used. Since we must always be writing code "for
the next guy", the use of poorly or generically named variables
diminish understandability which reduces the code's supportability.

Isaac Schlueter

unread,
Jan 6, 2012, 1:40:09 PM1/6/12
to nod...@googlegroups.com
The best rule of thumb about variable naming I've ever heard is this:

The length of a variable's name should be inversely proportional to
the distance between its definition and use. If it's used very close
to its definition, there's no need for a long name, since you can just
look up a few lines and see what it is.

Its descriptiveness should be inversely proportional to its frequency
and obviousness. High frequency or high obviousness, be more terse.
Low frequency or low obviousness, be more verbose.

Examples:

* A global you define in a .h file and then use once in a while: High
distance from creation to use, low frequency, probably low
obviousness. Go nuts. All caps, multiple words, super descriptive.
* A loop counter: low distance, high frequency, high obviousness.
Please use a single char. It probably doesn't even matter which one.

Super annoying:

for (var indexOfTheListOfTheThings = 0, numberOfThingsInTheList =
theListOfTheThings.length; indexOfTheListOfTheThings <
numberOfThingsInTheList; indexOfTheKillMeNowPleaseOMG++) ...

This is much more obvious:

for (var i = 0, l = things.length; i < l; i ++) {
doSomething(things[i])
}


Don't forget: the goal is to win, not to prove that some rule is perfect.

Andi

unread,
Jan 6, 2012, 10:54:38 PM1/6/12
to nod...@googlegroups.com
__ (two underscores, means: callback)
_ (underscore.js)

Reply all
Reply to author
Forward
0 new messages