<!DOCTYPE html>
<head>
  <title>Let's hash this out | Technical Blog #3 | Brian Kennedy</title>
  <meta charset="UTF-8">
  <link href='http://fonts.googleapis.com/css?family=Khula:800,400' rel='stylesheet' type='text/css'>
  <link rel="stylesheet" type="text/css" href="../stylesheets/blog-stylesheet.css">
</head>

<main>
  <h1>Let's hash this out</h1>
  <h2>Comparing Ruby arrays and hashes</h2>
  <h4>4/1/2015</h4>

  <section>
    <p>Arrays are dumb and hashes are smart. Well, maybe that's not the best way to put it. Arrays are simple and hashes are complicated.</p>
    <p>That sounds better.</p>
    <p>There are plenty of great uses for arrays. When you've got a simple set of data you can push it into an array and feel good about it.</p>
    <p>Let's say you want to use the years Babe Ruth played in the majors. That array would look like this: <code>babe_years = [1914, 1915, 1916, 1917, 1918, 1919, 1920, 1921, 1922, 1923, 1924, 1925, 1926, 1927, 1928, 1929, 1930, 1931, 1932, 1933, 1934, 1935]</code></p>
    <p>Super simple. A list of years. If you wanted to know what the year was during Babe Ruth's 20th season you would just do <code>babe_years[19]</code> (arrays start counting at 0, so the 20th season is at index 19). That search of the array would return <code>1933</code>.</p>
    <p>Cool, Babe Ruth's 20th season was in 1933.</p>
    <p class="footer"><a href="http://briankennedy1.github.io">Posted by Brian Kennedy</a>. <a href="http://devbootcamp.com">DBC</a> Technical Blog #3</p>
  </section>
</main>


Work on tech blog 3
Work on tech blog 3
