Skip to content
loading...

re: Against 'foo' (and 'bar' too) VIEW POST

FULL DISCUSSION
 

I think using Foo/Bar in API documentation is a very good sign that your example code is not properly communicating what it is supposed to be doing. That being said, I think using silly nonsense words in tutorials can have a good purpose. In certain cases where someone is learning a new language it might be useful to show them how to initialize variables in that language compared to other languages. Basically any sort of lesson on the actual concept of variables can and probably should use some silly nonsense word to show that people can name their variables anything they want. While most programmers know that variable names don't matter to the compiler interpreter, someone going into programming for the very first time might not fully understand that and long, specific variable names might add confusion to the lesson. This obviously depends on the student AND the teacher but I remember being confused by misunderstandings that just seem silly now when I started learning to program.

(Also Foo and Bar are a part of programming culture and it is our duty to teach newer programmers about them. ;P)

code of conduct - report abuse