JavaScript-Garden icon indicating copy to clipboard operation
JavaScript-Garden copied to clipboard

remove all "foos" and "bars"

Open timruffles opened this issue 10 years ago • 9 comments

foos and bars are horrible in example code as it gives no context on why you'd do something.

timruffles avatar Dec 16 '14 15:12 timruffles

see https://en.wikipedia.org/wiki/Foobar

dashed avatar Dec 18 '14 12:12 dashed

?

timruffles avatar Dec 18 '14 12:12 timruffles

Agreed. They could at least be named "some" and "another" so it's easier to remember which function or variable is which. "first" and "second" could work too.

Foo and bar just add mental strain to the examples: var foo = {name: 'kitten'} foo.name; // kitten foo['name']; // kitten

var get = 'name'; foo[get]; // kitten

foo.1234; // SyntaxError foo['1234']; // works

Why would you ever name foo kitten? It makes it harder to remember what's going on. Easier to use var person, and person.name. If you keep to a theme throughout the document I bet it would erase a lot of the foo bar overhead.

chrisranderson avatar Feb 07 '15 15:02 chrisranderson

foo and bar are specially confusing for non english speakers (like me) because we can't translate/understand these words

hugotox avatar May 29 '15 16:05 hugotox

Still a long way to go:

$ ack -hc '\b(foo|bar|baz|qux)\b' doc/en/
164

timruffles avatar Sep 29 '15 07:09 timruffles

Totally Agree.

roccomuso avatar Nov 03 '15 21:11 roccomuso

PRs would be gratefully accepted on this one. Puns win extra points.

On Tue, Nov 3, 2015 at 9:28 PM, Rocco Musolino [email protected] wrote:

Totally Agree.

— Reply to this email directly or view it on GitHub https://github.com/BonsaiDen/JavaScript-Garden/issues/261#issuecomment-153494775 .

timruffles avatar Nov 04 '15 09:11 timruffles

My tiny contribution: https://github.com/BonsaiDen/JavaScript-Garden/pull/373

siddharthkp avatar Oct 09 '17 10:10 siddharthkp

agreed with that

alieldeba avatar Oct 18 '22 09:10 alieldeba