3
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

foo, bar, bazとは一体なんなのか?

Posted at

今更ながら、foo, bar, bazって何!?と思ったので調べてみた。

どこで出てくるか?

チュートリアルなど説明のメソッド名やクラス名などで使われることが多い。

foo,barの例
module Foo
  extend ActiveSupport::Concern
  included do
    def self.method_injected_by_foo
      ...
    end
  end
end

module Bar
  extend ActiveSupport::Concern
  include Foo

  included do
    self.method_injected_by_foo
  end
end

意味

意味はない

プログラミングの世界で、仮の名前を設定するときに使われる。日本語の、hoge, fuga, piyo, hogehogeなどと同じ。

意味のない単語をメタ構文と呼ぶ

順番

使う順番に決まりはないが、次の順で使われることが多い。

foo
bar
baz
qux
quux
corge
,,,


これらが出てきたら、名前つけるのめんどくさいから、適当に仮の名前を設定してあると認識すればOK。
3
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?