title: Best directory structure for static files: hierarchical vs. flat
body: <p><strong>To be clear, I'm not looking for opinions but rather facts based on actual in-the-field usage of different file structure types.</strong></p>
  
  <p>In researching, before asking this questions, I've seen many posts about what the right folder structure is for a web application. For example, I'll see someone list where the following should go: css, js, html, images, php. But, I haven't seen anyone go into much deptch about what the static directory structure should look like.</p>
  
  <p>I have a lot of images in form of <code>static/images/mustang_2017_front.jpg</code> using Ford vehicles for example. Is it best to keep them in this flat file format or use a hierarchical folder structure such as <code>static/images/mustang/2017/front.jpg</code>. All the images are the same type for each car (e.g front, side, rear, top). Also, though I'm asking about images, I think the naming conventions standards apply to static files in general.</p>
  
  <p>Option 1- flat</p>
  
  <ul>
  <li><code>static/images/mustang_2017_front.jpg</code></li>
  <li><code>static/images/mustang_2017_side.jpg</code></li>
  <li><code>static/images/mustang_2017_rear.jpg</code></li>
  <li><code>static/images/fusion_2017_front.jpg</code></li>
  <li><code>static/images/fusion_2017_side.jpg</code></li>
  <li><code>static/images/fusion_2017_rear.jpg</code></li>
  </ul>
  
  <p>Option 2- hierarchical</p>
  
  <ul>
  <li><code>static/images/mustang/2017/front.jpg</code></li>
  <li><code>static/images/mustang/2017/side.jpg</code></li>
  <li><code>static/images/mustang/2017/rear.jpg</code></li>
  <li><code>static/images/fusion/2017/front.jpg</code></li>
  <li><code>static/images/fusion/2017/side.jpg</code></li>
  <li><code>static/images/fusion/2017/rear.jpg</code></li>
  </ul>
  
  <p>Here are some of the benefits I can think of for each approach, but they're from a human perspective. <strong>Is one of the options easier to work with in code?</strong> Does it matter much? I just don't want to be setting myself up for something that's not scalable in the future.</p>
  
  <p>Option 1- flat Benefits</p>
  
  <ul>
  <li>all files have all information in the name</li>
  </ul>
  
  <p>Option 2- hierarchical Benefits</p>
  
  <ul>
  <li>from a human perspective it's easier to manually navigate and find what you're looking for using a hierarchical folder system instead of having a large number of files all in the same folder</li>
  </ul>
  
  <p><strong>To be clear, I'm not looking for opinions but rather facts based on actual in-the-field usage of different file structure types.</strong></p>