|
|
|
|
|
by nikofeyn
3029 days ago
|
|
this memo is kind of funny in its informational tone. i had always just assumed foo and bar came from fubar once i became familiar with the usage. on another note, i have always disliked the usage of these terms. they stand only for internal lingo and serve no useful purpose. in every case, there are better names that can be used, and i feel foo and bar do nothing but distract me from the example and use case at hand. also, as a student in my first assembly programming course, the professor just started using foo and bar indiscriminately and frequently. i was thoroughly confused at least the entire duration of that lecture and maybe the next until i realized these were seemingly arbitrary words he had picked and 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.