DEV Community

Discussion on: Why I Don't Use Foo/Bar/Baz

Collapse
 
adam_cyclones profile image
Adam Crockett πŸŒ€ • Edited

So a to improve the examples, there's a couple more things. Let's get the liniting out of the way because I have a compulsive nature so excuse me sorry 😣 I can't help myself.

  • Don't use let use const as there is no further assignment.
  • Semicolons everywhere or non at all.
  • Don't use double quotes and single quotes use one or the other.
  • function is not a pure function, takes no params so is probably unnecessary.

Okay on to the topic, the first example where foo, bar, baz is concerned, that is just bad mentoring. Foo bar baz are just debugging names (your dog's name, your own name, or just about anything you can see from your desk are aslo fair game), you might use them if you console.log alot and can't use execution breakpoints for whatever reason.

I do use foo, bar, but I didn't like baz so instead I use foo, bar, thunder, flash, hotdog.

Collapse
 
kiarathedev profile image
Kiara Contreras

Thanks for the formatting feedback.

On the topic, I’ve seen documentation/algorithm examples that use foo/bar/baz outside of debugging names so that’s where this post stems from.

Collapse
 
adam_cyclones profile image
Adam Crockett πŸŒ€

Introverted isn't it, almost as if the developer forgot that others would see this code. "Makes sense to me" he/she probably thought to themselves, and so Kiara you are absolutely justified in your post.

I have to say, it's not something I have thought much about, that's a bit frightening.

Also sorry If that was your code, I would have kept my mouth shut, it's rude to pick at silly little things like this.

Thread Thread
 
kiarathedev profile image
Kiara Contreras

Definitely! I've been trying to think about small topics that were daunting when I started and it's always interesting to think back. For some people, it's hard to empathize with not understanding basic concepts so I understand how this topic can be included in learning materials.

It was mine but it actually was helpful. I should be more careful about syntax if I'm going to post!