<?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: Jefferson Duong</title>
    <description>The latest articles on DEV Community by Jefferson Duong (@zukululu).</description>
    <link>https://dev.to/zukululu</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%2F126720%2F14619180-d892-4206-8583-b85d8df48254.jpeg</url>
      <title>DEV Community: Jefferson Duong</title>
      <link>https://dev.to/zukululu</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/zukululu"/>
    <language>en</language>
    <item>
      <title>Embrace the MVC!</title>
      <dc:creator>Jefferson Duong</dc:creator>
      <pubDate>Fri, 25 Jan 2019 04:24:05 +0000</pubDate>
      <link>https://dev.to/zukululu/embrace-the-mvc-48c3</link>
      <guid>https://dev.to/zukululu/embrace-the-mvc-48c3</guid>
      <description>&lt;h2&gt;
  
  
  Do you mean Marvel vs Capcom?!
&lt;/h2&gt;

&lt;p&gt;No! I'm talking about &lt;strong&gt;MODEL, VIEW, CONTROLLER!&lt;/strong&gt; MVC is an important architectural pattern, or just a methodology/guidelines to follow, in order to build an effective full stack application. The key reason for this methodology is to map out all of the entities and how they will interact with each other.&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%2Fupload.wikimedia.org%2Fwikipedia%2Fcommons%2Fthumb%2Fa%2Fa0%2FMVC-Process.svg%2F1200px-MVC-Process.svg.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%2Fupload.wikimedia.org%2Fwikipedia%2Fcommons%2Fthumb%2Fa%2Fa0%2FMVC-Process.svg%2F1200px-MVC-Process.svg.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What is Model, View, Controller?
&lt;/h2&gt;

&lt;p&gt;Creating separate sections of code that handle specific goals for the program is important and is called the &lt;strong&gt;separation of concerns&lt;/strong&gt;. A perfect example for an understanding of MVC and our separation of concerns is HTML, CSS, and JavaScript. HTML will handle the content, which is the &lt;strong&gt;model&lt;/strong&gt;, CSS handles the styling, which is the &lt;strong&gt;view&lt;/strong&gt; and JavaScript handles the logic, which is the &lt;strong&gt;control&lt;/strong&gt;. They all handle specific parts of the program, which is a proper separation of concerns. &lt;/p&gt;

&lt;p&gt;To further expand on the web development functions of each of the aspects of MVC, the &lt;strong&gt;model&lt;/strong&gt; pertains to the entities of our application. The best way for me to explain what an entity is to give an example. An individual person can be imagined as a model, USUALLY a person will always have a first name, a last name, and a favorite color. We can add all of these together to create a model that 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;{
firstName: 'Peter',
lastName: 'Parker',
favoriteColor: 'red'
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The model contains one of the most important bits of information pertaining to an application: &lt;strong&gt;the information to be handled&lt;/strong&gt;. The counterpart to this important is the controller, which handles &lt;strong&gt;how&lt;/strong&gt; the information is handled. The view is simply the different way that we may present the data from our models. In the example of a website, our &lt;strong&gt;controller&lt;/strong&gt; handles user requests and calls the appropriate routes and models and sets the proper view. An example of this would be in Express, when a user clicks a form submission button, controller will be called to render the new page. &lt;/p&gt;

&lt;h2&gt;
  
  
  Advantages
&lt;/h2&gt;

&lt;p&gt;Some of the advantages of employing the MVC architecture are code reusability, simultaneous development, and ease of modification. Code reusability is a highly desired feature of any program or application, there's even an acronym for it! DRY, Don't Repeat Yourself, is a key principle in programming, if a programmer thinks that they might repeat themselves even twice, it is highly recommended that they restructure that block of code so that it may be used repeatedly, as it likely will if the application scales larger. Simultaneous development allows for multiple developers to work on the same project, but different aspects of it to allow for much more expedient results. An example of this would be for a developer to handle the JavaScript of a website while another works on the HTML and CSS, while obviously maintaining communication to prevent syntax and parameter errors.&lt;/p&gt;

&lt;p&gt;Adopting the MVC architecture will undoubtedly increase efficiency within any program. It allows for code reusability, scaling, and separation of concerns. Though, no matter how hard the code is, it'll always be an &lt;strong&gt;EASY DAY!&lt;/strong&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Lets Learn Pug!</title>
      <dc:creator>Jefferson Duong</dc:creator>
      <pubDate>Mon, 07 Jan 2019 19:35:37 +0000</pubDate>
      <link>https://dev.to/zukululu/lets-learn-pug-3e90</link>
      <guid>https://dev.to/zukululu/lets-learn-pug-3e90</guid>
      <description>&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--9gACHj8R--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dbalas.gallerycdn.vsassets.io/extensions/dbalas/vscode-html2pug/0.0.2/1532242577062/Microsoft.VisualStudio.Services.Icons.Default" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--9gACHj8R--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dbalas.gallerycdn.vsassets.io/extensions/dbalas/vscode-html2pug/0.0.2/1532242577062/Microsoft.VisualStudio.Services.Icons.Default" width="256" height="256"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What's PUG?
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;First of all, what IS pug?&lt;/strong&gt; &lt;a href="https://pugjs.org/api/getting-started.html" rel="noopener noreferrer"&gt;Pug&lt;/a&gt; is a template engine to write our HTML documents using a blend of JavaScript and HTML's syntax. This blend allows us to do things that are utilized in both JavaScript and HTML, such as creating and storing variables, creating functions, interpolating variables, creating and filling HTML documents with the exclusion of element tags. Using pug allows for cleaner code, since element tags are excluded, while maintaining the flexibility of JavaScript by allowing us to implement variables and functions within the same file.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--JdPVD7lB--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://i.gyazo.com/d514df7a32eb3d8ba36da992893bb0e0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--JdPVD7lB--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://i.gyazo.com/d514df7a32eb3d8ba36da992893bb0e0.png" width="553" height="125"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The exclusion of element tags allows for much cleaner code. At first, I was a bit confused and spent more time on making sure the indents were in the proper place, but after adjusting I don't think I would go back to traditionally typing in an HTML file. The exclusion of tags also made it easier to debug due to lost closing tags, or any missing characters. Pug also allows for simple element creation and adding IDs or classes. A div with the class name of "hello" would simply be typed as '.hello'.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;.hello.anotherClass.andAnotherOne
        h1 I have created a div that has 3 classes, and an h1 element inside of that div!
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;However, due to the engine not using any tags, or brackets, there is a large emphasis on indents. Instead of placing content within tags, they are simply indented to show which element is the child/parent. &lt;/p&gt;

&lt;p&gt;At first, I wasn't quite sure what to do with any kind of JavaScript functionality in an HTML document while I was trying to replicate Medium's website as a classwork assignment. However, after creating it and going back and seeing that there were multiple elements repeated, I found a perfect spot to implement some JavaScript code to reduce lines in my HTML. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--HH7ZwjwX--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://i.gyazo.com/9cbfde1dcb90d9c8c0c03e4aeb424005.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--HH7ZwjwX--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://i.gyazo.com/9cbfde1dcb90d9c8c0c03e4aeb424005.png" width="684" height="320"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In this code segment, the code that you see above the for loop was repeated 5 times to produce 5 articles. Instead of creating 5 blocks of the same code, a for loop was created to create the same article 5 times. Since pug can create variables, an array can be created to store the links, and the loops can create these elements with those URLs!&lt;/p&gt;

&lt;p&gt;I have only begun to scratch the surface of pug, but I look forward to using it more!&lt;/p&gt;

</description>
      <category>pug</category>
      <category>javascript</category>
      <category>html</category>
      <category>webdev</category>
    </item>
  </channel>
</rss>
