DEV Community

Discussion on: Against 'foo' (and 'bar' too)

Collapse
 
avasconcelos114 profile image
Andre Vasconcelos

I personally feels like it works better because it is a language he isn't too familiar with.

Because most of the people looking at examples with foo and bar are the ones who are just getting into the language, and speaking from experience having examples there really does harm readability and some function/variable names would have been better off if they were given a more specific name instead.

Some people were probably fine reading through foo/bar examples, but that doesn't negate the fact that a good chunk of people out there would rather have sensible naming for examples so that they can visualize the code they're trying to learn better

Collapse
 
woody_tanner profile image
Tanner Woody

The thing is, if I am doing code review or telling someone they are not following Single Responsibility Principle by throwing everything in main, I will tell them to:

def foo():
bar0 = process0()
...
barN = processN()
baz = doing_stuff(bar0, ..., barN)
return baz

Foo bar baz is a specific way to show theory, principles, and has it's place. Much like the comment below . and x in math.