JavaScript-Garden
JavaScript-Garden copied to clipboard
remove all "foos" and "bars"
foos and bars are horrible in example code as it gives no context on why you'd do something.
see https://en.wikipedia.org/wiki/Foobar
?
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.
foo and bar are specially confusing for non english speakers (like me) because we can't translate/understand these words
Still a long way to go:
$ ack -hc '\b(foo|bar|baz|qux)\b' doc/en/
164
Totally Agree.
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 .
My tiny contribution: https://github.com/BonsaiDen/JavaScript-Garden/pull/373
agreed with that