Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

It's supposed to mean nothing; that's the point. You use "foo" and "bar" (and "baz" and "qux", etc) when the names of the things in your example do not matter. It's the same way you'd see examples featuring "x", "y", and "z" when learning algebra: maybe your textbook also has story problems, but most of the examples will simply show an equation in terms of x, y, and maybe z, without pretending that those abstractions refer to anything concrete.


I think meaningless abstractions are fine to a point, but when you have a less trivial example, it can make it harder to keep track of the relationship of different things. For example, you might see something like

  trait Foo {
      fn frobulate()
  }
  
  struct Bar;
  struct Baz;
  
  impl Foo for Bar {
      fn frobulate() {
          // TODO   
      }
  }

  fn qux<T: Foo>(...)
It's ends up being too abstract. A more concrete example would help clarify the relationship of the different elements.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: