4 ms·
Foo, Bar, and Baz: Not Having It Posted on April 21, 2012 These placeholder variables are the worst thing to happen to language documentation in the modern era
by abuzzooz 14y ago
Foo, Bar, and Baz: Not Having It
Posted on April 21, 2012
These placeholder variables are the worst thing to happen to language documentation in the modern era. And so there’ll be none of this on Lingua Pragma. I’ll illustrate the problem by demonstrating classes in ruby. Compare:
Example 1
class Dog
def speak
return 'woof'
end
end
class Dachshund < Dog
end
fido = Dachshund.new
fido.speak
=> 'woof'
Example 2
class Foo
def bar
return 123
end
end
class Baz < Foo
end
qux = Baz.new
qux.bar
=> 123
Which example conveys more information? Which is easier to quickly grasp? Which would you rather read?
The dog motif in Example 1 came to me because my GF asked me to write an app to simulate a pet salon. And I’d model the classes something like this.