Hacker News new | ask | show | jobs
by ergothus 3028 days ago
> not, as i had originally thought, meaningful words or even instructions. i'll take a and b any day.

I get where you're coming from, but an advantage to foo and bar is that once we understand they are arbitrary words, that's a reliable rule. I do a little teaching and new students are incredibly literal. (Which makes sense, the kid that answers "what time is it" with the exact hour/minute/second is more likely to grow into a programmer - I certainly did).

As a result I can't use "better" words, because any meaningful word will be taken to be the requirement. "a" and "b", as you suggest, have issues with being TOO small, too similar, and already have a meaning in sort() uses, not to mention that learning "a" and "b" being meaningless terms is just as hard as learning foo and bar. Pretty much any terms you use will face the same issues, so often the route of least pain is to use the same set of arbitrary terms, and a set that we have a general common agreement as being arbitrary so when a student reads a book, blog post, or watches a video each one of these don't have to explain that foo and bar are arbitrary - we each have to learn that once.

Which isn't to say that foo/bar/baz aren't overused in places, but I doubt it'd be a good idea to replace them entirely or even mostly.