<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: philip-haines</title>
    <description>The latest articles on DEV Community by philip-haines (@philiphaines).</description>
    <link>https://dev.to/philiphaines</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F584236%2F4b72c0c0-9568-4d25-886b-6c7cbfa880b6.png</url>
      <title>DEV Community: philip-haines</title>
      <link>https://dev.to/philiphaines</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/philiphaines"/>
    <language>en</language>
    <item>
      <title>Dynamic Dispatch and Dispatch Tables</title>
      <dc:creator>philip-haines</dc:creator>
      <pubDate>Fri, 14 May 2021 16:12:20 +0000</pubDate>
      <link>https://dev.to/philiphaines/dynamic-dispatch-and-dispatch-tables-kdm</link>
      <guid>https://dev.to/philiphaines/dynamic-dispatch-and-dispatch-tables-kdm</guid>
      <description>&lt;h5&gt;
  
  
  Starting with the Computer Science Theory
&lt;/h5&gt;




&lt;p&gt;The first time I heard about dynamic dispatch I was shocked, confused, intrigued, and excited all at the same time. It was an enlightening moment. I barely grasped the concept at the time, but through some practice and research came to the understanding that dynamic dispatch, and dispatch tables are truly the way. &lt;/p&gt;

&lt;p&gt;When we talk about dynamic dispatch there are really two types of languages, there are static languages (C++, Java), and there are dynamic languages (JavaScript, Ruby, Python). The difference between a static language and a dynamic language is what happens at runtime.&lt;br&gt;&lt;br&gt;
At its core dynamic dispatch is when a program determines what chunk of code is going to be run when you send it a message. &lt;/p&gt;

&lt;p&gt;A great example of this is &lt;code&gt;console.log()&lt;/code&gt;. Have you ever actually looked at &lt;code&gt;console.log()&lt;/code&gt; and broken down whats happening? It's fascinating. Console is a global object in JavaScript, and log is method on object. The "log" part of &lt;code&gt;console.log()&lt;/code&gt; is the message. When you use a &lt;code&gt;console.log()&lt;/code&gt; you are sending the message “log” to the console object with some data attached to it, console then looks up the method "log" and runs it showing you the argument that you passed in when calling &lt;code&gt;console.log()&lt;/code&gt;. &lt;/p&gt;

&lt;p&gt;The way &lt;code&gt;console.log()&lt;/code&gt; works could not work in a static language as at runtime a static language needs to know exactly what is going to happen in every function, and where all of that code lives. The fact that the message of log is being passed into the console object during runtime is what makes JavaScript a dynamic language.&lt;/p&gt;

&lt;p&gt;So, let's look at how this works in practice. In Ruby, inheritance and &lt;a href="https://razorjack.net/ruby-object-model-implementing-prototypal-inheritance/" rel="noopener noreferrer"&gt;prototype chains&lt;/a&gt; are common occurrences. A prototype chain is a chain of inheritance where attributes are passed from once object model down to the other. &lt;/p&gt;

&lt;p&gt;Let's say we have a model for a Dog. The Dog class inherits from a Mammal class, the Mammal class inherits from the Animals class, and the Animal class inherits from the Object. The prototype chain would look something like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Dog &amp;lt; Mammal &amp;lt; Animal &amp;lt; Object
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Our Dog model has a method to make the Dog bark, and that method can be called with &lt;code&gt;Dob.bark&lt;/code&gt;. Since Dog inherits from Mammal and so forth, Dog also has access to the methods belonging to Mammal, Animal, and Object. If we want out Dog to breath(which I think we do!) we can all &lt;code&gt;Dog.breath&lt;/code&gt;. However, the breath method doesn't belong to Dog, it belongs to Animal, and this is where the beauty of dynamic dispatch kicks in. &lt;/p&gt;

&lt;p&gt;At runtime our program evaluates &lt;code&gt;Dog.breath&lt;/code&gt; and looks for a method of "breath" in the Dog class, when it cannot find it there, it looks for the method in Mammal, when it cannot find it there the program continues up the prototype chain until it finds the method and runs the associated task. This would simply not work in a static language, and would cause some potential errors.&lt;/p&gt;

&lt;p&gt;Ok, ok, enough with the theory side of things, let's look at some of the cool stuff we can do with our new knowledge.  &lt;/p&gt;

&lt;p&gt;Let's pretend that we are making a game, and in our game our user can hit arrow keys, and the character turn the direction of the arrow keys. In order to know what to do when a key is pressed, there needs to be some logic programmed into the computer. To start let's make some methods that will handle a key response. For the purposes of this article, these methods will print the string for the corresponding key.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6j91iifhn5be7dvr1i32.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6j91iifhn5be7dvr1i32.png" alt="Screen Shot 2021-04-15 at 9.48.55 AM"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So now that we have these functions, lets implement some conditional logic to call the corresponding function with a simple if/else statement. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4xwrfoqcuz9fpf9u4r9a.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4xwrfoqcuz9fpf9u4r9a.png" alt="Screen Shot 2021-04-15 at 9.52.32 AM"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now, theres nothing wrong with handling the logic this way. It satisfies rule number one "Make it Work", but it's clunky. If we had more conditionals who knows how long this if/else statement could get, and it's not very dynamic. If we want to add a new conditional we need to find where the statement is stored and then write in a new &lt;code&gt;else if&lt;/code&gt; line. There are better ways. One would be to use a switch statement. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fckoq6n7lnc5zfijrf01o.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fckoq6n7lnc5zfijrf01o.png" alt="Screen Shot 2021-04-15 at 9.54.54 AM"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The switch statement was made for this! It shines here, just look at all of the beautiful logic thats happening. This works, and it works well, but it could be better. with all of the &lt;code&gt;break&lt;/code&gt; keywords in there case statements are difficult to reach through, and we still haven't solved how to add a new condition on the fly... Enter the hero of our story, the dispatch table. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fi7szgg18p15cs5rrfyru.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fi7szgg18p15cs5rrfyru.png" alt="Screen Shot 2021-04-15 at 9.57.04 AM"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;A dispatch table is just an object with key-value pairs. The keys are the cases from the switch statement, and the values are the functions which print our string directions. When setting up a dispatch table this way, it's important to note that the functions are not being invoked in the dispatch table and are just giving the instruction of the function to the object. By doing this, it makes importing the dispatch table much easier, as you know exactly where all of your functions are running. &lt;/p&gt;

&lt;p&gt;So, how do we trigger our functions? In a real fame you would have a loop that listens for a key press, and inside of that loop there would be a function to trigger the dispatch table like so: &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fu5306kuf488tmso3jitf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fu5306kuf488tmso3jitf.png" alt="Screen Shot 2021-04-15 at 10.04.00 AM"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;All that is happening here is that at the key of the user input, just like any other object, the dispatch table will look at the value, evaluate it, and then we invoke the function that it finds based on the key. It really is that simple! &lt;/p&gt;

&lt;p&gt;One last example to truly show off how dynamic a dispatch table can be would be a calculator. In this fake calculator there are going to be methods for math operations and will be set up in a dynamic dispatch table like so:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function add(x, y) {return x + y;}
function subtract(x, y) {return x - y;}
function multiply(x, y) {return x * y;}
function divide(x, y) {return x / y;}

let dispatch = {
    "+": add,
    "-": subtract,
    "*": multiply,
    "/": divide,
}; 

let x = 5;
let y = 4;
let operator = "+";

dispatch[operator](x, y);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Once the data is collected from user input, all that needs to be done is to look up the key of operator in the dispatch table, and run the correct function. If a programmer wanted to come in later and expand the functionality of the calculator app they could do so wherever they like by simply setting a new key value pair in the dispatch object. An example would be a function that allows users to use exponents.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function exponent(x, y) {
    return Math.pow(x, y);
}

dispatch["^"] = exponent;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In a static language, that would not be possible, because at runtime, the dispatch table is locked with the key value pairs that were programmed into it, and new key value pairs cannot be added on the fly. &lt;/p&gt;

</description>
      <category>javascript</category>
      <category>oop</category>
      <category>computerscience</category>
    </item>
    <item>
      <title>Getting Started with TypeScript</title>
      <dc:creator>philip-haines</dc:creator>
      <pubDate>Thu, 13 May 2021 19:16:43 +0000</pubDate>
      <link>https://dev.to/philiphaines/getting-started-with-typescript-2ci4</link>
      <guid>https://dev.to/philiphaines/getting-started-with-typescript-2ci4</guid>
      <description>&lt;p&gt;Getting started with TypeScript can seem scary if you look at it as an entirely new language, but in reality, TypeScript is just a layer on top of JavaScript. All of your JavaScript skills and knowledge will only help in your TypeScript journey. Let's get another thing straight, no one is expecting you to know ever piece of syntactical sugar in TypeScript, theres much better use of the finite amount of memory that we have. Just like anything else, if you can understand the concepts enough to ask google a coherent question, you're in great shape. &lt;/p&gt;

&lt;h3&gt;
  
  
  Getting Started
&lt;/h3&gt;

&lt;p&gt;So, how do you get started? Just like with many things in JavaScript, we need to download TypeScript using NPM. If you're unfamiliar with NPM you can download it &lt;a href="https://www.npmjs.com/"&gt;here&lt;/a&gt;. Once you have NPM open up a terminal and install TypeScript globally with &lt;code&gt;npm install -g typescript&lt;/code&gt;. Once that installs, thats it! TypeScript has been installed and is ready to use... BUT we still have a few things to talk about before we can get our fingers on the keys. &lt;/p&gt;

&lt;p&gt;So earlier I mentioned that TypeScript is a layer on top of JavaScript, in technical terms this is called a superset. A superset is a programming language that contains all of the features of a given language and adds a layer of functionality on top of it. With TypeScript the extra functionality is the ability to strongly type our code, and catch possible type errors on compile. This is great for working with larger files and for cutting down on debugging time, especially when working in larger teams.&lt;/p&gt;

&lt;h3&gt;
  
  
  Having the Right Setup
&lt;/h3&gt;

&lt;p&gt;Having the right set up is always the first step to success with anything, and TypeScript is no different. The first thing to do is to make sure your IDE is set up for TypeScript. If you're using VS code, good news, TypeScript Support is already baked in. The next thing to do is create a &lt;code&gt;tsconfig.json&lt;/code&gt; file. The tsconfig file allows you to customize project settings, and acts like an object with key/value pairs. You can easily create a tsconfig by running &lt;code&gt;tsc --init&lt;/code&gt; in your terminal. This file will have some default options, and some roll your own options that you can add into your project as you see fit. &lt;/p&gt;

&lt;p&gt;Since the internet runs on JavaScript and TypeScript is not technically JaveScript we're going to need to talk about how to transpile the TypeScript into JavaScript at run time. This is done by running the &lt;code&gt;tsc&lt;/code&gt; command in your terminal. The &lt;code&gt;tsc&lt;/code&gt; command looks through your root directory for the &lt;code&gt;tsconfig.json&lt;/code&gt; file, and then turn that code into JavaScript with you having to do anything else. &lt;/p&gt;

&lt;h3&gt;
  
  
  Time to Get Dirty
&lt;/h3&gt;

&lt;p&gt;Ok you've made it through the boring stuff, let's start programming. PSYCH! We need to talk about understanding the seven actual types of data that JavaScript has: &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Undefined&lt;/li&gt;
&lt;li&gt;Null&lt;/li&gt;
&lt;li&gt;Boolean&lt;/li&gt;
&lt;li&gt;Number&lt;/li&gt;
&lt;li&gt;Object&lt;/li&gt;
&lt;li&gt;String&lt;/li&gt;
&lt;li&gt;Symbol&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;These seven types are given to us by JavaScript and are dynamic types. This means that data types are checked at runtime, and will not error out your program before you actually try to run your program. TypeScript makes these dynamic types static, so that at compile time your IDE is checking the types of your data to prevent undefined or null values being passed where they shouldn't be. This can save hours and hours of debugging and trying to find single places where they data type may be incorrect. &lt;/p&gt;

&lt;p&gt;Ok, now we will really get into coding... &lt;/p&gt;

&lt;h3&gt;
  
  
  How to Type Your Data
&lt;/h3&gt;

&lt;p&gt;For each different variable that you have in your application you need to type the variable. Its super easy to do this let's check it out starting with some of the easier types.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const letsRock : boolean = true
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Breaking this down is pretty simple. We declare a new variable &lt;code&gt;letsRock&lt;/code&gt; and then set it to equal true (because who doesn't like rocking). The big difference here is that I declared &lt;code&gt;letsRock&lt;/code&gt; as a boolean type. If the value of &lt;code&gt;letsRock&lt;/code&gt; ever equals anything except a boolean we are going to get an error.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let myAge : number = 0
let myName : string = "Phil"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;the same pattern is applied to strings and numbers. You declare the variable, declare the type and then set the initial value. Thats three out of seven types down, were cooking with gas now. Let's check out some of the other types and how we can type them. This is where things get fun .&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let students: string[] = ['Matt', 'David', 'Jake']
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;On the surface, this looks really scary, but take a step back and checkout whats happening. There is a variable of &lt;code&gt;students&lt;/code&gt; being declared, and &lt;code&gt;students&lt;/code&gt; is going to be an array. Arrays are a type that is given to us with JavaScript, so in TypeScript we know that we can set variables to be arrays. The cool part is that we can define the type thats INSIDE of the array! Think about this, by declaring the type that is going to be inside of an array, that could save debugging time when an error is thrown because a piece of data doesn't match the declared data type. Are you starting to catch on to what is happening here? The alternative syntax to the above code would look like this&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let students: Arrray&amp;lt;string&amp;gt; = ['Matt', 'David', 'Jake']
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Continuing the Journey
&lt;/h3&gt;

&lt;p&gt;This should be enough to get you started with TypeScript and for you to know just enough to be dangerous. The world of TypeScript is much deeper than what we covered in this blog post, so be sure to be on the lookout for part two of this blog post. &lt;/p&gt;

&lt;p&gt;Until next time, &lt;br&gt;
Happy coding, and remember to keep that GitHub green. &lt;/p&gt;

</description>
      <category>typescript</category>
      <category>javascript</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Getting started with Vue.js </title>
      <dc:creator>philip-haines</dc:creator>
      <pubDate>Tue, 04 May 2021 17:24:41 +0000</pubDate>
      <link>https://dev.to/philiphaines/getting-started-with-vue-js-1dd8</link>
      <guid>https://dev.to/philiphaines/getting-started-with-vue-js-1dd8</guid>
      <description>&lt;h3&gt;
  
  
  So, what is Vue.js?
&lt;/h3&gt;

&lt;p&gt;Vue.js is a front-end framework, and design to make developing Single Page Applications (SPAs) a breeze. After working at Google, Evan You created Vue.js in 2014. You's main objective was to take all of the good parts of the Angular framework and make a more lightweight framework, which is the main draw of Vue.js.&lt;/p&gt;

&lt;p&gt;Vue.js is one of the "big three" front-end frameworks, the other two being Angular and React. Aside from syntax the largest differences between Vue.js, React, and Angular is the level of rigidity. Angular is a very opinionated front-end framework, meaning there is generally only one right way to achieve a desired effect, while react is on the opposite side of the spectrum and allows devs to achieve the same effect in a multitude of ways. Vue.js sits right in the middle of the two of them, which, in my opinon, is why its a great first framework to learn. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fmiro.medium.com%2Fmax%2F6000%2F1%2A4OgqQRDfBtrftDNJrVHbHw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fmiro.medium.com%2Fmax%2F6000%2F1%2A4OgqQRDfBtrftDNJrVHbHw.png" alt="Angular, React, Vue"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Getting Started
&lt;/h2&gt;

&lt;p&gt;The first thing that you will need to do is to get Vue.js set up. There are two different ways to do this: &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Using a CDN and linking Vue.js in an HTML file&lt;/li&gt;
&lt;li&gt;Using the Vue.js CLI tools and installing Vue.js on your machine&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Today we are going to be using the Vue.js CLI tools. The first thing you will need to do is make sure that you have node installed. You can check if you have node installed by running &lt;code&gt;$node -v&lt;/code&gt; in your terminal. If you do not have Node installed you will need to run &lt;code&gt;$npm install -g npm&lt;/code&gt;. Next, run &lt;code&gt;$ npm install vue&lt;/code&gt; to install the latest version of Vue.js onto your computer. &lt;/p&gt;

&lt;p&gt;Now that Vue.js is installed, make a file where your new app will live, cd into that file and run &lt;code&gt;$vue create name-of-project&lt;/code&gt;. This will initiate an options list to configure how Vue CLI scaffolds your application. You can either choose a Vue 2 default that uses Vue version 2.x, a Vue 3 default that uses Vue version 3.x, or manually select features. Manually selecting features allows you to add things like &lt;a href="https://vuex.vuejs.org/" rel="noopener noreferrer"&gt;Vuex&lt;/a&gt; or &lt;a href="https://router.vuejs.org/" rel="noopener noreferrer"&gt;Vue Router&lt;/a&gt;. There are also other options like end to end testing, Progressive Web App (PWA) support, and CSS Pre-processors allowing you to style with SASS. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftlzaduhv3f07bvtcari6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftlzaduhv3f07bvtcari6.png" alt="Screen Shot 2021-04-05 at 3.32.00 PM"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can use the up and down arrows to select which option you would like to toggle and then use the space bar to toggle the option. Continue to select configurations, and make sure to pay attention to which version of Vue.js you select to use in your project as all features are not supported by all versions. Once you select all of the required options your Vue.js app is ready to rock!  &lt;/p&gt;

&lt;p&gt;Test it out by running &lt;code&gt;$npm run serve&lt;/code&gt; in your terminal! &lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Feqgrk75x234ateewzleq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Feqgrk75x234ateewzleq.png" alt="Screen Shot 2021-04-05 at 3.46.55 PM"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  Setting up a Vue.js template
&lt;/h3&gt;

&lt;p&gt;For those coming from React the first, and largest, difference you will see in Vue.js is how components and views are set up. In react you will see that all of the JavaScript and HTML are written together in a syntax called &lt;a href="https://reactjs.org/docs/introducing-jsx.html" rel="noopener noreferrer"&gt;JSX&lt;/a&gt;, where as in Vue.js, there is a little bit more of a separation of concerns. &lt;/p&gt;

&lt;p&gt;There are three main parts to a Vue.js component: &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Template&lt;/li&gt;
&lt;li&gt;Script&lt;/li&gt;
&lt;li&gt;Style&lt;/li&gt;
&lt;/ol&gt;
&lt;h4&gt;
  
  
  Template
&lt;/h4&gt;

&lt;p&gt;The template section is where all of the HTML goes for the component or view that is being developed. HTML tags are able to accept dynamic data by using the &lt;code&gt;{{Mustache syntax}}&lt;/code&gt;. Adding double curly braces inside fo an HTML element enables the ability to add data using JavaScript syntax (data.pieceOfData). Furthermore, the Mustache syntax also allows you to write Vanilla JavaScript between the double curly braces... pretty cool, right? &lt;/p&gt;
&lt;h4&gt;
  
  
  Style
&lt;/h4&gt;

&lt;p&gt;The style tag is fairly basic but does have the ability to be scoped or global. By adding &lt;code&gt;scoped&lt;/code&gt; to the style tag, all of the styles will be local to ONLY the component or view that is currently being worked on. If global styles are required, it's recommended to write them in the App.vue file. &lt;/p&gt;
&lt;h4&gt;
  
  
  Script
&lt;/h4&gt;

&lt;p&gt;This is where all of the real magic happens. Inside of the script tag lives all of the &lt;a href="https://v1.vuejs.org/guide/events.html" rel="noopener noreferrer"&gt;methods&lt;/a&gt;, &lt;a href="https://vuejs.org/v2/guide/components-props.html" rel="noopener noreferrer"&gt;props&lt;/a&gt;, &lt;a href="https://vuejs.org/v2/guide/state-management.html" rel="noopener noreferrer"&gt;state&lt;/a&gt;, and &lt;a href="https://v3.vuejs.org/api/options-data.html#data-2" rel="noopener noreferrer"&gt;data&lt;/a&gt; for a view or component. &lt;/p&gt;
&lt;h6&gt;
  
  
  Data and Computed
&lt;/h6&gt;

&lt;p&gt;The data option in the script tag is a function that returns static data. This is where data that does not have stateful behavior, and does not need to be reactive to the users behavior can be declared. The data function will always need to return an object of the static data.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;script&amp;gt;
  export default {
   data: {
      firstName: 'Foo',
      lastName: 'Bar',
    }
  }
&amp;lt;/script&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The computed option allows for data to be manipulated and then return in the template. For the above data, if we needed an element to have read out a &lt;code&gt;fullName&lt;/code&gt;, you could simple created a function in the computed section that computes the full name for you, and returns it.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;template&amp;gt;
  &amp;lt;div id="demo"&amp;gt;{{fullName}}&amp;lt;/div&amp;gt;
&amp;lt;/template&amp;gt;

&amp;lt;script&amp;gt;
  export default {
    data: {
        firstName: 'Foo',
        lastName: 'Bar'
      },
    computed: {
      fullName: function () {
        return this.firstName + ' ' + this.lastName
      }
    }
  }
&amp;lt;/script&amp;gt; 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This &lt;code&gt;fullName&lt;/code&gt; function takes our static data of &lt;code&gt;firstName&lt;/code&gt; and &lt;code&gt;lastName&lt;/code&gt; and concatenates them into a single &lt;code&gt;fullName&lt;/code&gt; string that is accessible to the entire component. Computed functions can also be used to update and return data that is in state. &lt;/p&gt;

&lt;h6&gt;
  
  
  Methods
&lt;/h6&gt;

&lt;p&gt;Simply put, methods are functions that are associated with a particular view or component. These methods can do all sorts of things including fetch and setting data. Here is a simple example with a method called &lt;code&gt;handleClick&lt;/code&gt; that will trigger an alert with the string 'learning Vue.js':&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;template&amp;gt;
  &amp;lt;a @click="handleClick"&amp;gt;Click me!&amp;lt;/a&amp;gt;
&amp;lt;/template&amp;gt;

&amp;lt;script&amp;gt;
export default {
  methods: {
    handleClick: function() {
      alert('learning Vue.js')
    }
  }
}
&amp;lt;/script&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Methods come in handy when paired with &lt;code&gt;v-on&lt;/code&gt; &lt;a href="https://v3.vuejs.org/api/directives.html#directives" rel="noopener noreferrer"&gt;directives&lt;/a&gt; designed to handle events on elements. When this link is clicked, it will invoke the &lt;code&gt;handleClick&lt;/code&gt; method that is defined in the script tag, and the alert will fire.&lt;/p&gt;

&lt;h6&gt;
  
  
  Props and State
&lt;/h6&gt;

&lt;p&gt;In the props option, this is where you can declare values that will be passed to children components. Props act as custom attributes, declared on a component in the &lt;code&gt;Script&lt;/code&gt; tag. To declare props you simple set up a key-value pair within your export default. &lt;/p&gt;

&lt;p&gt;State is the current status of the application, and thus how it effects data. Many things can change the state of a piece of data from actions and events, to user verification. &lt;a href="https://vuejs.org/v2/guide/state-management.html#Information-for-React-Developers" rel="noopener noreferrer"&gt;State and state management&lt;/a&gt; are extremely important topics when discussing SPAs and deserves its own deep dive.  &lt;/p&gt;

&lt;h4&gt;
  
  
  Putting it All Together
&lt;/h4&gt;

&lt;p&gt;So what does it all look like when it comes together? Well, now that you're all set up, it's time to explore. Vue.js is a great way to get comfortable with the main concepts surrounding SPAs, and will hold your hand throughout the process. Make sure to have the &lt;a href="https://vuejs.org/v2/guide/" rel="noopener noreferrer"&gt;docs&lt;/a&gt; handy, and leave a comment with a link to your first Vue.js project! &lt;/p&gt;

&lt;p&gt;Happy Programming!  &lt;/p&gt;

</description>
      <category>vue</category>
      <category>javascript</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Beautify your GitHub!</title>
      <dc:creator>philip-haines</dc:creator>
      <pubDate>Mon, 03 May 2021 19:19:13 +0000</pubDate>
      <link>https://dev.to/philiphaines/beautify-your-github-40hh</link>
      <guid>https://dev.to/philiphaines/beautify-your-github-40hh</guid>
      <description>&lt;p&gt;If you have ever visited someones GitHub and noticed that they have some fancy pictures, cool emojis, and stats on their homepage you may have wondered how to make a page like that on your own. If this sounds like you, keep reading, because in this blog post I'm going to tell you exactly how to make your GitHub &lt;code&gt;README&lt;/code&gt; sparkle! &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fe1dptsjjls6mdgvjdvor.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fe1dptsjjls6mdgvjdvor.png" alt="Screen Shot 2021-05-03 at 12.23.15 PM"&gt;&lt;/a&gt;&lt;br&gt;
&lt;br&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  How to Make Your Own
&lt;/h2&gt;

&lt;h6&gt;
  
  
  (Its easier than you think!)
&lt;/h6&gt;

&lt;p&gt;Creating a GitHub profile &lt;code&gt;README&lt;/code&gt; is super simple super simple but a little hard to find by yourself. Once you are signed into GitHub, initialize a new repository by going to &lt;a href="https://github.com/new" rel="noopener noreferrer"&gt;https://github.com/new&lt;/a&gt;. Name your new repository the name of your GitHub account (hint: this can be found by hovering over your profile icon in the top right of the screen), and click "Create Repository". How easy was that? &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzxthfaope9v7iotiufm6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzxthfaope9v7iotiufm6.png" alt="Screen Shot 2021-05-03 at 11.58.53 AM"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;For a shortcut checkoff "Add a README file" when creating your repository. The &lt;code&gt;README&lt;/code&gt; has to be there in order for your new fancy profile to be fancy. Speaking of which... &lt;br&gt;
&lt;br&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Make It Stand Out
&lt;/h2&gt;

&lt;p&gt;Now that you have your GitHub &lt;code&gt;README&lt;/code&gt; created, theres a few things you need to know about making it pretty. GitHub &lt;code&gt;README&lt;/code&gt; uses something called Markdown language. You can use Markdown to add images, link, gifs, headers, and so much more. No need to memories Markdown, just use the &lt;a href="https://github.com/adam-p/markdown-here/wiki/Markdown-Here-Cheatsheet" rel="noopener noreferrer"&gt;cheat sheet&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;One thing that I really like on a GitHub profile page is a header. It's a nice personal touch, and really easy to make with a program like PhotoShop, Sketch, or even Google Docs. Or for something even easier check out &lt;a href="https://www.canva.com/search/templates?q=header" rel="noopener noreferrer"&gt;Canva Headers&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9vvgfeazzphvsvkc3opb.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9vvgfeazzphvsvkc3opb.png" alt="Screen Shot 2021-05-03 at 12.30.26 PM"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Your header could have your name, photo, job title, location, and a plethora of other things. Here are a few examples that I really like: &lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/jlengstorf" rel="noopener noreferrer"&gt;https://github.com/jlengstorf&lt;/a&gt;&lt;br&gt;
&lt;a href="https://github.com/bdougie" rel="noopener noreferrer"&gt;https://github.com/bdougie&lt;/a&gt;&lt;br&gt;
&lt;a href="https://github.com/sindresorhus" rel="noopener noreferrer"&gt;https://github.com/sindresorhus&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It's super simple to add pictures into your GitHub &lt;code&gt;README&lt;/code&gt;. If you have the file saved locally you can just drag and drop it into your Markup and its imported. If you want to add a link as a photo you can use the &lt;code&gt;&amp;lt;img /&amp;gt;&lt;/code&gt; tag and add a &lt;code&gt;src&lt;/code&gt; with a path to the photo you want to add. Remember, the &lt;code&gt;&amp;lt;img /&amp;gt;&lt;/code&gt; is a self closing tag, you can still have bugs in Markdown so be sure to close that tag! &lt;br&gt;
&lt;br&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Tell People About Yourself
&lt;/h2&gt;

&lt;p&gt;People are interested in other people, tell your story. A couple of lines of text about your dev philosophy could go a long way to showing a potential employer or collaborator who you are! Even better, give a list of things you're currently working on, excited to learn about, and link to a few of your projects. Looking for collaborators on your current projects is one of the best ways to network.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxhsirq9bjxrp3a8p667z.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxhsirq9bjxrp3a8p667z.png" alt="Screen Shot 2021-05-03 at 1.01.16 PM"&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;This is another great opportunity to also slip in an interesting fact about yourself. Make sure to keep your bullet points short and to the point. Add emojis for a little fun, who doesn't like emojis?&lt;br&gt;
&lt;br&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Highlighting Your Skills
&lt;/h2&gt;

&lt;p&gt;Displaying your skills right on your GitHub homepage is highly recommended. You worked hard for those skills, show them off! When potential employers or collaborators land on your GitHub page this small future will give them a quick understanding of the languages that you can work in. &lt;/p&gt;

&lt;p&gt;There are a couple of ways of doing this, you can have logos of all of the languages, tools, and technologies that you're adept in. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcznw99fmy9en0ro9x0u8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcznw99fmy9en0ro9x0u8.png" alt="Screen Shot 2021-05-03 at 12.29.53 PM"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The easiest way to find these icons is to use google images and then click on "tools", then "color", then "transparent". This should return a large number of &lt;code&gt;.png&lt;/code&gt; images that you can easily resize in your Markdown.&lt;br&gt;
&lt;code&gt;&amp;lt;img height="20"src="https://img.icons8.com/color/452/graphql.png"&amp;gt;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Some other awesome places to look for logos or icons are &lt;a href="https://simpleicons.org/" rel="noopener noreferrer"&gt;https://simpleicons.org/&lt;/a&gt; and if you're looking for something a little fancier, check out &lt;a href="https://shields.io" rel="noopener noreferrer"&gt;https://shields.io&lt;/a&gt;. &lt;br&gt;
&lt;br&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Show Off Your Work
&lt;/h2&gt;

&lt;p&gt;Another really good way to boast your skills is by showcasing your repos. The first way to do this is by pinning your top repos directly to your home page. While you don't technically do this in the &lt;code&gt;README&lt;/code&gt;, it's still super important to make sure that your top repositories are actually your top repos. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkh3fzj7d0ryrvtkco04o.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkh3fzj7d0ryrvtkco04o.png" alt="Screen Shot 2021-05-03 at 12.44.40 PM"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To change your pinned repositories, go to your GitHub homepage &lt;code&gt;github.com/your-user-name&lt;/code&gt; and scroll to your "pinned" section. On the top right of your currently pinned repositories, there is some clickable text that says "Customize pinned". Click that and a modal with a list of all of your work will pop up. Check off the work you want to show off, you can pin up to six repos on your home page.   &lt;/p&gt;

&lt;p&gt;If you want to take it to the next level, look no further than &lt;a href="https://github.com/anuraghazra/github-readme-stats" rel="noopener noreferrer"&gt;GitHub README Stats&lt;/a&gt;. GitHub README Stats is a tool that allows you display stats on your GitHub homepage in nicely formatted cards. You can pass in many information options such as &lt;code&gt;top_langs&lt;/code&gt;, which will give you a card for your &lt;code&gt;README&lt;/code&gt; that displays your top languages. There are many other arguments that you can pass into the stats URL and the &lt;a href="https://github.com/anuraghazra/github-readme-stats" rel="noopener noreferrer"&gt;docs&lt;/a&gt; are super helpful.&lt;br&gt;
&lt;br&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Putting it All Together
&lt;/h2&gt;

&lt;p&gt;Now that you're a Markdown master, and a champion of the GitHub homepage, go ahead and push your &lt;code&gt;README&lt;/code&gt; to the master branch and brag about your beautiful new GitHub on LinkedIn! Remember, you can always go back and edit your &lt;code&gt;README&lt;/code&gt; at any point so make sure to market test a few different setups. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffno82ya50jueyoclrkpk.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffno82ya50jueyoclrkpk.png" alt="Github-full-page"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Happy coding, and remember to keep that GitHub green!&lt;/p&gt;

</description>
      <category>github</category>
      <category>markdown</category>
      <category>webdev</category>
      <category>career</category>
    </item>
    <item>
      <title>Setting Up for Success: A Guide to ERD's</title>
      <dc:creator>philip-haines</dc:creator>
      <pubDate>Mon, 05 Apr 2021 21:02:36 +0000</pubDate>
      <link>https://dev.to/philiphaines/setting-up-for-success-a-guide-to-erd-s-12f7</link>
      <guid>https://dev.to/philiphaines/setting-up-for-success-a-guide-to-erd-s-12f7</guid>
      <description>&lt;p&gt;So, what is an ERD? To start, it stands for Entity Relationship Diagram, and it isn't actual programming. An ERD is the first step in setting yourself up for success in Object Oriented Programming (oop). As I began dipping my feet into the oop waters it quickly became clear that having a well organized plan of attack would set me up for success, this is where ERDs came in. &lt;/p&gt;

&lt;p&gt;In short, an ERD is a hand drawn diagram that represent relationships between objects in your program. Think of an ERD as an electrician's blueprint of how everything is connected under the hood. Your ERD blueprint will do the same thing.  Having the visualization of all of the methods needed for each class you create, and other data needed at initialization will save many head aches later down the road. &lt;/p&gt;

&lt;p&gt;ERD's are also important in helping other developers who may not be familiar with your project have an understand of relationships in your database. The best thing for readability is to stick to convention.&lt;/p&gt;

&lt;p&gt;These are the notations that you should use in your ERD:&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--WhQzhL7z--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ftnvlp89fwfau15gdseq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--WhQzhL7z--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ftnvlp89fwfau15gdseq.png" alt="ERD Cardinality"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So how does this all look when it's put together? &lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--vrum4m_c--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/uwisybmdlbgnkdzoq7v3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--vrum4m_c--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/uwisybmdlbgnkdzoq7v3.png" alt="Blank diagram"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If we look at this diagram you can see that we have two classes, "User" and "Food". A User can eat many Food objects, and Food objects can be eaten by many User objects. These classes are joined by a "Meal" joiner object, a User eats many Food objects at a Meal. &lt;/p&gt;

&lt;p&gt;By using an ERD there is now a clear blueprint as to the data each class initializes with, the methods that will need to run on all of the classes, and the relationships that persist.&lt;/p&gt;

&lt;p&gt;Is creating an ERD necessary? Maybe not, but hopefully this post will help you understand why it's important and how it will set you up for success on your next project. &lt;/p&gt;

</description>
      <category>ruby</category>
      <category>beginners</category>
      <category>oop</category>
    </item>
  </channel>
</rss>
