<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>hareruya_maro</author_name>
  <author_url>https://blog.hatena.ne.jp/hareruya_maro/</author_url>
  <blog_title>へなちょこSEの考察</blog_title>
  <blog_url>https://henahena.hateblo.jp/</blog_url>
  <categories>
  </categories>
  <description>仕事中、ふと気になって調べ物をしたのでその備忘録。ifとswitchの使い分けって、あまり意識してしたことがなかったのですが、そう言えばどっちがいいもんなんだろうと疑問に思いました。 とりあえずググってみたところ、まぁだいたいの人は「２～３個までの分岐ならif、それ以上はswitchが良いんじゃない？」って感じでした。 確かに4個とか5個ととかなってくると、「 else if(a == 1) 」とかを大量に見るのも飽きてきます。 しかもswitchであればすべての分岐の前提条件が一緒であることが明白ですが、ifではちゃんと条件文を見ないとわかりません。例えば下記のような文。 switch(va…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fhenahena.hateblo.jp%2Fentry%2F2012%2F05%2F15%2F230957&quot; title=&quot;ifとswitchの使い分けについて - へなちょこSEの考察&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url></image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2012-05-15 23:09:57</published>
  <title>ifとswitchの使い分けについて</title>
  <type>rich</type>
  <url>https://henahena.hateblo.jp/entry/2012/05/15/230957</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
