<?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: Bob Cavezza</title>
    <description>The latest articles on DEV Community by Bob Cavezza (@cavezza).</description>
    <link>https://dev.to/cavezza</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%2F217726%2F758f2cc1-f6f3-43e2-a59a-8592c37e9172.jpg</url>
      <title>DEV Community: Bob Cavezza</title>
      <link>https://dev.to/cavezza</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/cavezza"/>
    <language>en</language>
    <item>
      <title>The Simple Guide to HTML SVGs</title>
      <dc:creator>Bob Cavezza</dc:creator>
      <pubDate>Tue, 27 Aug 2019 20:44:18 +0000</pubDate>
      <link>https://dev.to/cavezza/the-simple-guide-to-html-svgs-461j</link>
      <guid>https://dev.to/cavezza/the-simple-guide-to-html-svgs-461j</guid>
      <description>&lt;p&gt;You want to work with D3, but you don’t understand how SVGs are rendered in the browser. This makes it very difficult to understand HTML code that D3 outputs. Let’s tackle some of these issues.&lt;/p&gt;

&lt;p&gt;The code we will be looking at today was generated by D3. However, in this example, we’re not looking at D3. We’re looking only at the SVG code rendered in HTML.&lt;/p&gt;

&lt;p&gt;This is very important because when working with D3, you will typically be creating SVGs. If you’re not familiar with how an SVG looks and behaves, debugging D3 code will be very difficult.&lt;/p&gt;

&lt;p&gt;Before getting started, I want you to keep one thing in mind when looking at this code. SVG code, in its simplest form, is putting shapes on a canvas. In the example below, we will draw an SVG canvas and place shapes and text on that canvas. That’s all we’re doing. Don’t let this code deter you. It’s nothing more than drawings a canvas, and then drawing shapes on that canvas. There might be syntax you’ve never seen before, but learning is fun!&lt;/p&gt;

&lt;p&gt;&lt;iframe height="600" src="https://codepen.io/cavezza/embed/xxKdbGM?height=600&amp;amp;default-tab=result&amp;amp;embed-version=2"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;See the Pen &lt;a href="https://codepen.io/cavezza/pen/xxKdbGM/" rel="noopener noreferrer"&gt;Displaying an SVG graph in HTML&lt;/a&gt; by Bob Cavezza (&lt;a href="https://codepen.io/cavezza" rel="noopener noreferrer"&gt;@cavezza&lt;/a&gt;) on &lt;a href="https://codepen.io" rel="noopener noreferrer"&gt;CodePen&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Don’t forget that CodePen is interactive! You should interact with the CodePen and play around with the values. Change some values, see what happens. Remove an element and see how it changes how the graph is displayed on your screen.&lt;/p&gt;

&lt;p&gt;Let’s start looking at the code.&lt;/p&gt;

&lt;p&gt;First, we have an &lt;code&gt;&amp;lt;svg&amp;gt;&lt;/code&gt; tag that is creating an area where we can draw the elements we see. In essence, this tag is drawing our canvas. This creates a canvas that is 600 pixels wide and 400 pixels high. Now that we have the canvas ready, it’s time to start putting shapes on that canvas.&lt;/p&gt;

&lt;p&gt;Now, to place items on this canvas, we have to tell the canvas the x and y coordinates for each item. On an SVG canvas, the coordinates start at the top left. If we want &lt;code&gt;0,0&lt;/code&gt;, that would be the very top left. If we want &lt;code&gt;600,400&lt;/code&gt;, that would give us the very bottom right. The graphic below should help explain this better than text can.&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%2Fibuildmvps.com%2Fwp-content%2Fuploads%2F2019%2F08%2FScreen-Shot-2019-08-27-at-4.51.55-PM.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%2Fibuildmvps.com%2Fwp-content%2Fuploads%2F2019%2F08%2FScreen-Shot-2019-08-27-at-4.51.55-PM.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Let’s continue looking at the code. The next line of code is:&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;g class="axis axis-y" transform="translate(40, 40)" fill="none" font-size="10" font-family="sans-serif" text-anchor="end"&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;&amp;lt;g&amp;gt;&lt;/code&gt; is an interesting sub element of &lt;code&gt;&amp;lt;svg&amp;gt;&lt;/code&gt;. It’s the only element besides &lt;code&gt;&amp;lt;svg&amp;gt;&lt;/code&gt; itself that isn’t drawing a shape. &lt;code&gt;&amp;lt;g&amp;gt;&lt;/code&gt; a container that is used to group other SVG elements. “The important aspect of a &lt;code&gt;&amp;lt;g&amp;gt;&lt;/code&gt; element to know is that transformations applied to the &lt;code&gt;&amp;lt;g&amp;gt;&lt;/code&gt; element are performed on its child elements and its attributes are inherited by its children” (&lt;a href="https://developer.mozilla.org/en-US/docs/Web/SVG/Element/g%20" rel="noopener noreferrer"&gt;from Mozilla mdn&lt;/a&gt;). You can test this out in the CodePen by taking the transform of a grouping element, removing it from the g element, and putting it on each of its descendants.&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%2Fibuildmvps.com%2Fwp-content%2Fuploads%2F2019%2F08%2FScreen-Recording-2019-08-26-at-11.47-PM.gif" 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%2Fibuildmvps.com%2Fwp-content%2Fuploads%2F2019%2F08%2FScreen-Recording-2019-08-26-at-11.47-PM.gif"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;What’s important to note is what the &lt;code&gt;transform&lt;/code&gt; attribute does. Transform defines a list of definitions that are applied to it and its children. The most common one you often see is &lt;code&gt;translate(x, y)&lt;/code&gt;. What this does is moves the item and its children to the right x amount of pixels and down y amount of pixels.&lt;/p&gt;

&lt;p&gt;There are other, more complex transform options. You will be able to do some really cool animations when you learn transforms well and combine them with animations in D3.&lt;/p&gt;

&lt;p&gt;In the next line, we encounter the &lt;code&gt;&amp;lt;path&amp;gt;&lt;/code&gt; element.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;&amp;lt;path class="domain" stroke="#f00" d="M-6,0.5H0.5V320.5H-6"&amp;gt;&amp;lt;/path&amp;gt;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Path is an intriguing element and what I believe to be the most complex element in SVG land. In the &lt;code&gt;&amp;lt;path&amp;gt;&lt;/code&gt; element, the magic happens in the &lt;code&gt;d=&lt;/code&gt; area. I am still not able to decipher what the specific values inside the &lt;code&gt;d&lt;/code&gt; attribute do in a path element. When you draw more complex line graphs, that value can grow to hundreds or thousands of characters. What a path does is draws on the canvas. It is used to draw more complex objects than simple shapes.&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;&amp;lt;path&amp;gt;&lt;/code&gt;in our example is the only one that isn’t a simple line or a simple shape. This particular &lt;code&gt;&amp;lt;path&amp;gt;&lt;/code&gt; object draws a line with two ends sticking out of it. Instead of a typical line that looks like | (a line), they look like ] (a line with two lines sticking out at the ends). This might be the simplest &lt;code&gt;&amp;lt;path&amp;gt;&lt;/code&gt; element you’ll ever see as they get extremely more complex.&lt;/p&gt;

&lt;p&gt;Here’s a screenshot of changing the color of that path so you can fully understand what I mean.&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%2Fibuildmvps.com%2Fwp-content%2Fuploads%2F2019%2F08%2FScreen-Shot-2019-08-27-at-2.44.14-PM.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%2Fibuildmvps.com%2Fwp-content%2Fuploads%2F2019%2F08%2FScreen-Shot-2019-08-27-at-2.44.14-PM.png"&gt;&lt;/a&gt;In this screenshot, the fill color of the y axis was changed so you can see the exact shape that hte path object is drawing.&lt;/p&gt;

&lt;p&gt;Although we’re not looking at it here, &lt;code&gt;&amp;lt;path&amp;gt;&lt;/code&gt;s are where D3 really starts to shine. Since the values in the &lt;code&gt;d&lt;/code&gt; attribute are so complex, a tool like D3 is important to be able to write code that other developers will understand when building these complex path objects.&lt;/p&gt;

&lt;p&gt;On the next line, we run into the &lt;code&gt;&amp;lt;g&amp;gt;&lt;/code&gt; element again.&lt;code&gt;&amp;lt;g class="tick" opacity="1"&amp;gt;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Since we discussed the &lt;code&gt;&amp;lt;g&amp;gt;&lt;/code&gt; element earlier, we now know that this will add the &lt;code&gt;tick&lt;/code&gt; class to all of its descendants and will also pass the &lt;code&gt;opacity&lt;/code&gt; of 1 to all of its descendants (two elements – a &lt;code&gt;&amp;lt;line&amp;gt;&lt;/code&gt; element and a &lt;code&gt;&amp;lt;text&amp;gt;&lt;/code&gt; element).&lt;/p&gt;

&lt;p&gt;Next, we see the &lt;code&gt;&amp;lt;line&amp;gt;&lt;/code&gt; element. As you might have guessed, a line element draws a simple line: &lt;code&gt;&amp;lt;line stroke="#000" x2="520" transform="translate(0,29.59)"&amp;gt;&amp;lt;/line&amp;gt;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Stroke is the color of the line. &lt;code&gt;x2&lt;/code&gt; is the x coordinate where the line ends. &lt;code&gt;x1&lt;/code&gt;‘s default value is 0. Since there are no values for &lt;code&gt;x1&lt;/code&gt;, &lt;code&gt;y1&lt;/code&gt;, or &lt;code&gt;y2&lt;/code&gt;, we know that they all default to 0. Due to the inherited transforms, this specific element’s own “grid system” starts where the transforms have it start.&lt;/p&gt;

&lt;p&gt;Next, we run into the &lt;code&gt;&amp;lt;text&amp;gt;&lt;/code&gt; element. And this SVG element does exactly what you expect it to, it renders text on the SVG canvas. The reason we have a &lt;code&gt;&amp;lt;text&amp;gt;&lt;/code&gt; element within SVG elements is so you can place it on the canvas by giving it x and y coordinates.&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;x&lt;/code&gt; attribute tells you where that element should be placed on the &lt;code&gt;x&lt;/code&gt;coordinate plane. The &lt;code&gt;dy&lt;/code&gt; attribute is a little different. This tells you where the element should be placed on the y axis in comparison to the previous element. In this example, we are placing it 0.32 ems away from the line element before it. If you’re not familiar with &lt;code&gt;em&lt;/code&gt;, it’s the same as the computed font-size of an element. Alternatives to use (instead of an &lt;code&gt;em&lt;/code&gt;) are &lt;code&gt;pixel&lt;/code&gt;s or &lt;code&gt;rem&lt;/code&gt;s. You can also use percentages in the &lt;code&gt;dy&lt;/code&gt; attribute.&lt;/p&gt;

&lt;p&gt;What this first pattern does that we just looked at is draw the y axis and the horizontal lines along the y axis. Then, it draws the horizontal line on the grid next to 90 and placed the text of 90 onto the grid.&lt;/p&gt;

&lt;p&gt;Now, you will see this pattern repeated a few times as the rest of those horizontal lines and text field numbers are placed on the grid.&lt;br&gt;&lt;br&gt;
Once that is complete, you will see an almost identical grouping of elements that add values to the x axis. Here is the complete code that draws all the lines of the canvas (not including the graph rectangles themselves). You should now be able to understand this entire block of code since we went through all of the building blocks above.&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;g class="axis axis-y" transform="translate(40, 40)" fill="none" font-size="10" font-family="sans-serif" text-anchor="end"&amp;gt;
    &amp;lt;path class="domain" stroke="#f00" d="M-6,0.5H0.5V320.5H-6"&amp;gt;&amp;lt;/path&amp;gt;
    &amp;lt;g class="tick" opacity="1"&amp;gt;
        &amp;lt;line stroke="#000" x2="520" transform="translate(0,29.59)"&amp;gt;&amp;lt;/line&amp;gt;
        &amp;lt;text fill="#000" x="-10" dy="0.32em" transform="translate(0,29.59)"&amp;gt;90&amp;lt;/text&amp;gt;
    &amp;lt;/g&amp;gt;
    &amp;lt;g class="tick" opacity="1" transform="translate(0,126.56)"&amp;gt;
        &amp;lt;line stroke="#000" x2="520"&amp;gt;&amp;lt;/line&amp;gt;
        &amp;lt;text fill="#000" x="-10" dy="0.32em"&amp;gt;60&amp;lt;/text&amp;gt;
    &amp;lt;/g&amp;gt;
    &amp;lt;g class="tick" opacity="1" transform="translate(0,223.53)"&amp;gt;
        &amp;lt;line stroke="#000" x2="520"&amp;gt;&amp;lt;/line&amp;gt;
        &amp;lt;text fill="#000" x="-10" dy="0.32em"&amp;gt;30&amp;lt;/text&amp;gt;
    &amp;lt;/g&amp;gt;
    &amp;lt;g class="tick" opacity="1" transform="translate(0,320.5)"&amp;gt;
        &amp;lt;line stroke="#000" x2="520"&amp;gt;&amp;lt;/line&amp;gt;
        &amp;lt;text fill="#000" x="-10" dy="0.32em"&amp;gt;0&amp;lt;/text&amp;gt;
    &amp;lt;/g&amp;gt;
&amp;lt;/g&amp;gt;
&amp;lt;g class="axis axis-x" transform="translate(40, 360)" fill="none" font-size="10" font-family="sans-serif" text-anchor="middle"&amp;gt;
    &amp;lt;path class="domain" stroke="#000" d="M0.5,6V0.5H520.5V6"&amp;gt;&amp;lt;/path&amp;gt;
    &amp;lt;g class="tick" opacity="1" transform="translate(87.16,0)"&amp;gt;
        &amp;lt;line stroke="#000" y2="6"&amp;gt;&amp;lt;/line&amp;gt;
        &amp;lt;text fill="#000" y="9" dy="0.71em"&amp;gt;Mon&amp;lt;/text&amp;gt;
    &amp;lt;/g&amp;gt;
    &amp;lt;g class="tick" opacity="1" transform="translate(260.5,0)"&amp;gt;
        &amp;lt;line stroke="#000" y2="6"&amp;gt;&amp;lt;/line&amp;gt;
        &amp;lt;text fill="#000" y="9" dy="0.71em"&amp;gt;Tues&amp;lt;/text&amp;gt;
    &amp;lt;/g&amp;gt;
    &amp;lt;g class="tick" opacity="1" transform="translate(433.83,0)"&amp;gt;
        &amp;lt;line stroke="#000" y2="6"&amp;gt;&amp;lt;/line&amp;gt;
        &amp;lt;text fill="#000" y="9" dy="0.71em"&amp;gt;Wed&amp;lt;/text&amp;gt;
    &amp;lt;/g&amp;gt;
&amp;lt;/g&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;What’s left is the drawing of the graphing elements themselves. At this point, I’m not sure if you would be surprised or expecting to learn that these three graphing elements are nothing more than rectangles.&lt;br&gt;&lt;br&gt;
Here is the full code to build the three rectangles on our graph:&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;rect class="bar-line" transform="translate(40, 40)" height="320" width="153.33" x="10" y="0"&amp;gt;&amp;lt;/rect&amp;gt;
&amp;lt;rect class="bar-line" transform="translate(40, 40)" height="203.63" width="153.33" x="183.33" y="116.36"&amp;gt;&amp;lt;/rect&amp;gt;
&amp;lt;rect class="bar-line" transform="translate(40, 40)" height="132.52" width="153.33" x="356.66" y="187.47"&amp;gt;&amp;lt;/rect&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;&amp;lt;rect&amp;gt;&lt;/code&gt;s are one of the more simple SVG elements. You apply a height and width, and then also the starting x and y coordinates.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;And that’s it for this visualization!&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;At this point, you know enough SVG code to be able to create graphs that you can reasonably expect to be needed at your job. Congratulations! Most people don’t fully understand SVGs in order to explain it to other engineers.&lt;br&gt;&lt;br&gt;
Today, you achieved that milestone!&lt;/p&gt;

&lt;p&gt;At this point, you probably didn’t fully understand one or two of the elements from the CodePen. If that’s the case, you should go and change some of the CodePen values to see what happens to the visualization when those values are changed. Playing with code is the easiest way to make sure you understand it.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Get my periodic email with the best resources and links online&lt;/strong&gt;&lt;br&gt;
&lt;a href="https://tinyletter.com/rcavezza" rel="noopener noreferrer"&gt;https://tinyletter.com/rcavezza&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Read more at my blog&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="http://ibuildmvps.com" rel="noopener noreferrer"&gt;http://ibuildmvps.com&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Connect with me&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="http://twitter.com/cavezza" rel="noopener noreferrer"&gt;http://twitter.com/cavezza&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="http://linkedin.com/in/cavezza" rel="noopener noreferrer"&gt;http://linkedin.com/in/cavezza&lt;/a&gt;&lt;/p&gt;

</description>
      <category>d3</category>
      <category>svg</category>
      <category>webdev</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Create a Graph Fast With This Simplest Guide to D3</title>
      <dc:creator>Bob Cavezza</dc:creator>
      <pubDate>Tue, 27 Aug 2019 02:37:58 +0000</pubDate>
      <link>https://dev.to/cavezza/create-a-graph-fast-with-this-simplest-guide-to-d3-1af8</link>
      <guid>https://dev.to/cavezza/create-a-graph-fast-with-this-simplest-guide-to-d3-1af8</guid>
      <description>&lt;p&gt;&lt;a href="https://d3js.org/" rel="noopener noreferrer"&gt;D3.js&lt;/a&gt; does two things: (1) It adds HTML to a page and (2) it binds data to that HTML. That’s it. The simplest example of this you will ever see of D3 data are bar charts binded to pixel size. Most examples of D3 in the wild use SVGs or Path html elements. Understanding those are almost different skills entirely. In this tutorial, we’re going to look at D3 code that does not require any knowledge of SVGs or Paths whatsoever.&lt;br&gt;&lt;br&gt;
&lt;em&gt;Caveat: This isn’t a graph that you would want to put into production. This is a very simple example showing what D3 does.&lt;/em&gt;&lt;br&gt;&lt;br&gt;
Let’s take a look at some code and then dissect it to see exactly what’s going on behind the scenes.&lt;/p&gt;

&lt;p&gt;&lt;iframe height="600" src="https://codepen.io/cavezza/embed/pozPzdM?height=600&amp;amp;default-tab=result&amp;amp;embed-version=2"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;See the Pen &lt;a href="https://codepen.io/cavezza/pen/pozPzdM/" rel="noopener noreferrer"&gt;The Simplest d3 example you’ll ever see&lt;/a&gt; by Bob Cavezza (&lt;a href="https://codepen.io/cavezza" rel="noopener noreferrer"&gt;@cavezza&lt;/a&gt;) on &lt;a href="https://codepen.io" rel="noopener noreferrer"&gt;CodePen&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;As you can see, this code is generating a bar graph with no labels and no axes. In this post, we will dissect the code line by line to see what is happening.&lt;/p&gt;

&lt;p&gt;If you want to recreate this, you will need all three elements as seen in the CodePen. You need the html and to load the d3 script into your page. You will also need to style the &lt;code&gt;single-line-bar&lt;/code&gt; class. The most important part of this code is the javascript section as that is where we’re using D3. Let’s dive into the code.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const data = [4, 30, 15, 16, 23];

d3.select('#chart')
  .selectAll('div')
  .data(data)
  .enter()
  .append('div')
  .classed('single-bar', true)
  .style('height', (d) =&amp;gt; ( d + 'px'));

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The very first line is the data we will graph. &lt;code&gt;const data = [4, 30, 15, 16, 23];&lt;/code&gt; is a plain javascript array containing five integers. In the next line, we start to see D3 specific syntax.&lt;/p&gt;

&lt;p&gt;The first line of d3, &lt;code&gt;d3.select('#chart')&lt;/code&gt; works in the exact same way that a CSS selector works. You are selecting the area in your HTML where you want to create your visualization. These selectors work in the exact same way they would work in any front end framework. &lt;code&gt;#&lt;/code&gt;s are appended for ids, &lt;code&gt;.&lt;/code&gt;s are appended for classes, and any HTML element would be selected like &lt;code&gt;d3.select('div')&lt;/code&gt;. Other selectors will work too,&lt;/p&gt;

&lt;p&gt;The next thing that you will notice is that D3 supports chaining. Notice there isn’t a semicolon after the first line. The result of the first line is an object that we can chain additional d3 commands to. This is neat because the output of every method can then be used by the next method.&lt;/p&gt;

&lt;p&gt;The next line, &lt;code&gt;.selectAll('div')&lt;/code&gt;, selects all &lt;code&gt;div&lt;/code&gt;s that live inside &lt;code&gt;#chart&lt;/code&gt;. This is intriguing because there are no &lt;code&gt;div&lt;/code&gt;s that live inside the &lt;code&gt;#chart&lt;/code&gt; div in our sample HTML. When this occurs, D3 returns an empty selection. I know this is confusing, but let’s continue to break down the rest of the code and this will make sense soon.&lt;/p&gt;

&lt;p&gt;The magic starts to happen in the next line. In &lt;code&gt;.data(data)&lt;/code&gt;, we are binding data to the div elements. &lt;code&gt;.data&lt;/code&gt; is calling the data method in d3. The&lt;code&gt;data&lt;/code&gt; variable inside the parentheses is a reference to our array of integers we want to graph. We initialized this variable on the first line of our code. The data is now binded to our d3 object, but we still have the issue that there are no divs inside the &lt;code&gt;#chart&lt;/code&gt; element. So we’re binding this data to nothing?!?!?&lt;/p&gt;

&lt;p&gt;This is where &lt;code&gt;.enter&lt;/code&gt; comes into play. If there is a mismatch in number of elements we have selected and the data we binded it to, &lt;code&gt;.enter()&lt;/code&gt; allows us to add div elements to make up the difference. &lt;code&gt;.enter()&lt;/code&gt; is usually followed by an &lt;code&gt;.append&lt;/code&gt;. Our example here is no different.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Important note: There is a corresponding &lt;code&gt;exit&lt;/code&gt; method that can be used to remove elements in a similar way that &lt;code&gt;enter&lt;/code&gt; adds elements.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Now that we called &lt;code&gt;.enter()&lt;/code&gt;, we now have to append values to the selection to bridge the gap from 0 &lt;code&gt;div&lt;/code&gt;s to the number of integers in our array. Since we call &lt;code&gt;.append('div')&lt;/code&gt;, what this does is adds the difference of number of divs to get to 5 (the length of our array).&lt;/p&gt;

&lt;p&gt;If you cut off the rest of the code here, you will see 5 empty divs inside chart.&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%2Fibuildmvps.com%2Fwp-content%2Fuploads%2F2019%2F08%2FScreen-Shot-2019-08-26-at-9.24.56-PM-1024x543.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%2Fibuildmvps.com%2Fwp-content%2Fuploads%2F2019%2F08%2FScreen-Shot-2019-08-26-at-9.24.56-PM-1024x543.png"&gt;&lt;/a&gt;Here, you can see that if you don’t add the single-bar class and the styled height, your html will still render on the page, but it will not display since it’s not styled and it has no height.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;.classed&lt;/code&gt; assigns a class to all the divs you are appending if the second parameter is true. In our example, &lt;code&gt;.classed('single-bar', true)&lt;/code&gt; assigns a &lt;code&gt;single-bar&lt;/code&gt; class to every &lt;code&gt;div&lt;/code&gt; that we just appended because &lt;code&gt;true&lt;/code&gt; will always be truthy.&lt;/p&gt;

&lt;p&gt;The final line &lt;code&gt;.style('height', (d) =&amp;gt; ( d + 'px'));&lt;/code&gt; adds an inline style attribute to every div that we appended. The first parameter defines the inline style element. The second parameter is a javascript function with &lt;code&gt;d&lt;/code&gt; referring to each specific item in our data array.&lt;/p&gt;

&lt;p&gt;If you’re not familiar with fat arrow functions, don’t worry. The line is the exact same as the following:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;.style('height', function(d) {
    return d + 'px';
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can call &lt;code&gt;d&lt;/code&gt; whatever you want, but &lt;code&gt;d&lt;/code&gt; is generally the convention you’ll see in D3 code. Since &lt;code&gt;d&lt;/code&gt; refers to each data item in the array, the first appended div element, it will render as &lt;code&gt;style="height: 4px;"&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;As you can probably tell, all this D3 code is doing is creating HTML elements. &lt;strong&gt;That is all D3 does!&lt;/strong&gt; It creates and binds data to HTML elements.&lt;br&gt;&lt;br&gt;
In our example above, the d3 code created this html output:&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;div id="chart"&amp;gt;
    &amp;lt;div class="single-bar" style="height: 4px;"&amp;gt;&amp;lt;/div&amp;gt;
    &amp;lt;div class="single-bar" style="height: 30px;"&amp;gt;&amp;lt;/div&amp;gt;
    &amp;lt;div class="single-bar" style="height: 15px;"&amp;gt;&amp;lt;/div&amp;gt;
    &amp;lt;div class="single-bar" style="height: 16px;"&amp;gt;&amp;lt;/div&amp;gt;
    &amp;lt;div class="single-bar" style="height: 23px;"&amp;gt;&amp;lt;/div&amp;gt;
&amp;lt;/div&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Don’t forget the importance of the CSS in this example. If you comment out the css in the CodePen, the graph stops appearing.&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%2Fibuildmvps.com%2Fwp-content%2Fuploads%2F2019%2F08%2FScreen-Shot-2019-08-26-at-9.38.57-PM-1024x480.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%2Fibuildmvps.com%2Fwp-content%2Fuploads%2F2019%2F08%2FScreen-Shot-2019-08-26-at-9.38.57-PM-1024x480.png"&gt;&lt;/a&gt;A screenshot of our CodePen guide showing that if you comment out the css, the graph will not display&lt;/p&gt;

&lt;p&gt;This happens because when you create empty divs, there is no minimum width. You are left with HTML elements that you created , but cannot see.&lt;/p&gt;

&lt;p&gt;The CSS in our example sets the width of each div, assigns space in between each div, sets the background color of each div, and sets a display value so they will display next to each other like a graph.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;.single-bar {
    display: inline-block;
    background: #4285F4;
    width: 8px;
    margin-right: 2px;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;There is a lot of buzz around D3 because of the crazy graphs it helps create. Everything will get much more complicated as you need to build more complex visualizations. You will need to learn SVGs and Path HTML elements. But don’t let D3 scare you. At the end of the day, it’s just HTML, CSS, and javascript.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Get my periodic email with the best resources and links online&lt;/strong&gt;&lt;br&gt;
&lt;a href="https://tinyletter.com/rcavezza" rel="noopener noreferrer"&gt;https://tinyletter.com/rcavezza&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Read more at my blog&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="http://ibuildmvps.com" rel="noopener noreferrer"&gt;http://ibuildmvps.com&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Connect with me&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="http://twitter.com/cavezza" rel="noopener noreferrer"&gt;http://twitter.com/cavezza&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="http://linkedin.com/in/cavezza" rel="noopener noreferrer"&gt;http://linkedin.com/in/cavezza&lt;/a&gt;&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>beginners</category>
      <category>javascript</category>
      <category>d3</category>
    </item>
    <item>
      <title>How do you add images to the feed for a post?</title>
      <dc:creator>Bob Cavezza</dc:creator>
      <pubDate>Mon, 26 Aug 2019 22:39:02 +0000</pubDate>
      <link>https://dev.to/cavezza/how-do-you-add-images-to-the-feed-for-a-post-2l2d</link>
      <guid>https://dev.to/cavezza/how-do-you-add-images-to-the-feed-for-a-post-2l2d</guid>
      <description>&lt;p&gt;I tried using &lt;code&gt;cover_image&lt;/code&gt; in the metadata. That applied an image to the post itself, but the image didn't appear in feeds for that image. For example, images appear like the following:&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%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Feh5ujzxf4tjbdwxigjxo.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%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Feh5ujzxf4tjbdwxigjxo.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Is there something additional you need to do in order to make this happen?&lt;/p&gt;

&lt;p&gt;Here are my guesses:&lt;br&gt;
1.) Cover images need to fix certain width/height constraints to appear in the feeds&lt;br&gt;
2.) Images need to be approved to appear in the feeds&lt;br&gt;
3.) There's another metadata tag I need to add to posts. &lt;/p&gt;

&lt;p&gt;Any help would be appreciated. &lt;/p&gt;

&lt;p&gt;For additional context: Here's a screenshot of my post with the &lt;code&gt;cover_image&lt;/code&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%2Fthepracticaldev.s3.amazonaws.com%2Fi%2F3ruqexxmunuefw970xko.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%2Fthepracticaldev.s3.amazonaws.com%2Fi%2F3ruqexxmunuefw970xko.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Here's a screenshot of my post in the feed:&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%2Fthepracticaldev.s3.amazonaws.com%2Fi%2F16hm4ua5stk2ezto0hy1.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%2Fthepracticaldev.s3.amazonaws.com%2Fi%2F16hm4ua5stk2ezto0hy1.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>help</category>
      <category>meta</category>
    </item>
    <item>
      <title>A Linter: The Magic Bullet To Improve Your Engineering Team</title>
      <dc:creator>Bob Cavezza</dc:creator>
      <pubDate>Sun, 25 Aug 2019 18:49:12 +0000</pubDate>
      <link>https://dev.to/cavezza/a-linter-the-magic-bullet-to-improve-your-engineering-team-222n</link>
      <guid>https://dev.to/cavezza/a-linter-the-magic-bullet-to-improve-your-engineering-team-222n</guid>
      <description>&lt;p&gt;A linter is formally classified as a &lt;a href="https://searchwindevelopment.techtarget.com/definition/static-analysis" rel="noopener noreferrer"&gt;Static Code Analysis&lt;/a&gt; tool. It is usually a command line tool and it parses a project’s code to look for patterns. It then checks the patterns it finds against generally accepted standards (or custom rules you think are important).&lt;/p&gt;

&lt;p&gt;The primary purposes of a linter are to find errors, find bugs, and help enforce a standardized coding style in a project. When you implement a linter, it will do much more!&lt;/p&gt;

&lt;p&gt;In the javascript ecosystem, the linters you will see most often are &lt;a href="https://palantir.github.io/tslint/" rel="noopener noreferrer"&gt;TSLint&lt;/a&gt; and &lt;a href="https://eslint.org/" rel="noopener noreferrer"&gt;ESLint&lt;/a&gt;. Both can be installed via &lt;a href="https://www.npmjs.com/" rel="noopener noreferrer"&gt;npm&lt;/a&gt; and can make your software development lifecycle much faster.&lt;/p&gt;

&lt;p&gt;In this post, I’m going to discuss why linters are important. Then, I’m going to show the typical ways in which linters are used.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Note: Most of my recent work has been in Angular. All examples in this post are using TSLint by way of the angular command line &lt;code&gt;ng Lint&lt;/code&gt;&lt;/em&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Linting is very important for a well functioning engineering team.
&lt;/h1&gt;

&lt;h2&gt;
  
  
  It finds errors in your code.
&lt;/h2&gt;

&lt;p&gt;Let’s take a look at a quick example. &lt;/p&gt;

&lt;p&gt;Here’s a common scenario that happens when writing code: a typo. Take a quick look at how the linter in your IDE would handle this.&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%2Fibuildmvps.com%2Fwp-content%2Fuploads%2F2019%2F08%2FScreen-Shot-2019-08-22-at-5.42.16-PM.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%2Fibuildmvps.com%2Fwp-content%2Fuploads%2F2019%2F08%2FScreen-Shot-2019-08-22-at-5.42.16-PM.png"&gt;&lt;/a&gt;Common Linting Scenario&lt;/p&gt;

&lt;p&gt;A linter will catch this very quickly and you won’t think twice about it. Since the typo is underlined, you fix it very quickly and it takes less than two seconds. Imagine a scenario where you didn’t have a linter hooked up to your IDEA. You may continue writing code until you want to see how this works in a browser (let’s assume you’re not doing &lt;a href="https://technologyconversations.com/2013/12/20/test-driven-development-tdd-example-walkthrough/" rel="noopener noreferrer"&gt;TDD&lt;/a&gt; in this example).&lt;/p&gt;

&lt;p&gt;If you didn’t have a linter installed, you would probably continue writing code until you reached a point where you wanted to test it. You would upload your browser and it wouldn’t behave as expected. Maybe the date doesn’t look as expected. You might run a debugger or console.log a few items to see what’s occurring. Let’s say that it takes you less than 5 minutes to find the bug and fix it. Maybe it takes 30 seconds. Regardless, this could have been fixed in two seconds if you had used a linter. These little things add up over the course of a day, a week, a month, and a year. &lt;/p&gt;

&lt;p&gt;Without a linter, finding the bug in your testing is the best case scenario. What’s the worst case scenario? Maybe, you never noticed a bug at all and this made it into production. I can easily imagine a scenario where you’re working with a codebase that has limited or no test coverage.&lt;/p&gt;

&lt;h2&gt;
  
  
  It increases team morale
&lt;/h2&gt;

&lt;p&gt;Did you ever have a pull request that was torn to shreds by your fellow engineers? It’s not a fun experience.&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%2Fibuildmvps.com%2Fwp-content%2Fuploads%2F2019%2F08%2FScreen-Shot-2019-08-25-at-2.09.13-PM-1024x214.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%2Fibuildmvps.com%2Fwp-content%2Fuploads%2F2019%2F08%2FScreen-Shot-2019-08-25-at-2.09.13-PM-1024x214.png"&gt;&lt;/a&gt;Pull Requests numerous comments are bad for an engineer’s ego&lt;/p&gt;

&lt;p&gt;It hurts your confidence. It can sometimes damage relationships with fellow engineers if they are brash with their comments.&lt;/p&gt;

&lt;p&gt;Sometimes with on a PR with numerous comments, an engineer might hold back from commenting on other things.&lt;/p&gt;

&lt;p&gt;A linter helps alleviate these issues by cutting down on comments related to coding style, clear mistakes, and bugs. When you hook a linter up to your Continuous Integration Pipeline or Continuous Deployment Pipeline (will be referred to as CI/CD pipeline in the rest of the article), you find those issues and stop the build before this gets to the pull request step.&lt;/p&gt;

&lt;p&gt;Since a pull request now can’t get opened with these stylistic issues or clear errors in the code, this reduces the comments fellow engineers might make on a pull request. &lt;/p&gt;

&lt;p&gt;This helps increase confidence of the individual engineer opening up the PR and reduces resentment towards other engineers. &lt;/p&gt;

&lt;h2&gt;
  
  
  It forces a cohesive, agreed upon style
&lt;/h2&gt;

&lt;p&gt;Imagine you are a junior developer and you just opened up your first pull request. You are very proud of this accomplishment!&lt;/p&gt;

&lt;p&gt;About an hour later you get your first comment. Veronica suggests that you should use a fat arrow function instead of the traditional javascript syntax. You’re eager to get this first pull request merged, so you quickly make that change and push code back up.&lt;/p&gt;

&lt;p&gt;A half hour later, you get another comment on your PR. This time, it’s Michael suggesting that the code you just changed to a fat arrow function might be better off in the traditional javascript syntax.&lt;/p&gt;

&lt;p&gt;Shit.&lt;/p&gt;

&lt;p&gt;This happens to junior developers all the time.&lt;/p&gt;

&lt;p&gt;Engineers come in all shapes and sizes. They come from different backgrounds and worked with different languages in the past. Good engineers are opinionated. Good codebases are opinionated too.&lt;/p&gt;

&lt;p&gt;An agreed upon style is important for modern teams. You should have a style guideline that is supported by linting rules. If your team prefers fat arrow functions, make sure that’s a linting rule. If it prefers traditional javascript functions, make sure that’s the rule. &lt;/p&gt;

&lt;p&gt;Your team should follow these rules unless there’s a few good reason to break it.&lt;/p&gt;

&lt;p&gt;This helps code readability, code understandability, and the junior engineer experience.&lt;/p&gt;

&lt;h2&gt;
  
  
  It helps create a better overall architecture
&lt;/h2&gt;

&lt;p&gt;Now that small errors and stylistic issues are being caught by the linter, peers on your team can now focus on other issues in your code. &lt;/p&gt;

&lt;p&gt;Maybe the code doesn’t make use of the new architecture your team has adopted. Maybe there’s an inefficient line of code that will take long to execute as you scale. Maybe you named a function in a confusing way that might trip up others in the future.&lt;/p&gt;

&lt;p&gt;Now that these style issues, clear bugs, and minor issues have been caught in the linter, the engineers on your development team can focus on deeper, more important issues.&lt;/p&gt;

&lt;p&gt;This in turn, helps create a better overall architecture and codebase.&lt;/p&gt;

&lt;h1&gt;
  
  
  In practice, you would typically use a linter in three different places
&lt;/h1&gt;

&lt;p&gt;These were all mentioned earlier in this post, but I wanted to make sure I mentioned them all explicitly here.&lt;/p&gt;

&lt;h2&gt;
  
  
  In your IDE
&lt;/h2&gt;

&lt;p&gt;When connected to your IDE, linting errors will be underlined automatically so you can see them in real time when writing code.&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%2Fibuildmvps.com%2Fwp-content%2Fuploads%2F2019%2F08%2FScreen-Shot-2019-08-22-at-5.42.16-PM.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%2Fibuildmvps.com%2Fwp-content%2Fuploads%2F2019%2F08%2FScreen-Shot-2019-08-22-at-5.42.16-PM.png"&gt;&lt;/a&gt;Common Linting Scenario&lt;/p&gt;

&lt;h2&gt;
  
  
  In the command line
&lt;/h2&gt;

&lt;p&gt;You can take a look at all the linting issues in your codebase by typing a command into your terminal. In an angular project, you would type &lt;code&gt;ng lint&lt;/code&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%2Fibuildmvps.com%2Fwp-content%2Fuploads%2F2019%2F08%2Flinting-errors-command-line-1024x826.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%2Fibuildmvps.com%2Fwp-content%2Fuploads%2F2019%2F08%2Flinting-errors-command-line-1024x826.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  In Your CI/CD Pipeline
&lt;/h2&gt;

&lt;p&gt;Your CI/CD pipeline will use the terminal command to run the linter in your pipeline. You can then set the rules as you see fit to fail a build when a certain threshold is crossed.&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%2Fibuildmvps.com%2Fwp-content%2Fuploads%2F2019%2F08%2Flinter_bitbucket_pipelines_failure.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%2Fibuildmvps.com%2Fwp-content%2Fuploads%2F2019%2F08%2Flinter_bitbucket_pipelines_failure.png"&gt;&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%2Fibuildmvps.com%2Fwp-content%2Fuploads%2F2019%2F08%2Flinter-bitbucket-pipelines-failure.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%2Fibuildmvps.com%2Fwp-content%2Fuploads%2F2019%2F08%2Flinter-bitbucket-pipelines-failure.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;A linter is engineering team’s best friend. They make your team faster, they make your team happier, they increase overall code quality, and they prevent bugs from getting into production.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Get my periodic email with the best resources and links online&lt;/strong&gt;&lt;br&gt;
&lt;a href="https://tinyletter.com/rcavezza" rel="noopener noreferrer"&gt;https://tinyletter.com/rcavezza&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Read more at my blog&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="http://ibuildmvps.com" rel="noopener noreferrer"&gt;http://ibuildmvps.com&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Connect with me&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="http://twitter.com/cavezza" rel="noopener noreferrer"&gt;http://twitter.com/cavezza&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="http://linkedin.com/in/cavezza" rel="noopener noreferrer"&gt;http://linkedin.com/in/cavezza&lt;/a&gt;&lt;/p&gt;

</description>
      <category>career</category>
      <category>productivity</category>
      <category>javascript</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Always Be Improving</title>
      <dc:creator>Bob Cavezza</dc:creator>
      <pubDate>Tue, 20 Aug 2019 01:46:16 +0000</pubDate>
      <link>https://dev.to/cavezza/always-be-improving-3717</link>
      <guid>https://dev.to/cavezza/always-be-improving-3717</guid>
      <description>&lt;h2&gt;
  
  
  You should always improving, but should you strengthen a strength or improve a weakness?
&lt;/h2&gt;

&lt;p&gt;Getting better is difficult. You need to make time to improve. I’m pretty good at that. What I’m not good at is picking an area to work on.&lt;/p&gt;

&lt;p&gt;On any given evening, I’ll think to myself, “Should I strengthen a strength or should I improve a weakness?” It’s a tough question.  There’s no definitive answer.&lt;/p&gt;

&lt;p&gt;In fact, I read between 3 and 10 books at a time (&lt;a href="https://www.bustle.com/p/reading-more-than-one-book-at-a-time-actually-has-some-pretty-incredible-benefits-73777"&gt;There’s a lot of benefits to this!&lt;/a&gt;). In any given evening, based on my challenges of the past day or my mood, I’ll pick up a different book. I’ll read a few pages. I’ll learn something new or interesting. Then, I’ll write some notes in my notebook.&lt;/p&gt;

&lt;p&gt;Some nights I’ll read a book that will help me get better at something I’m good at. Maybe this would be front end development or management. Other nights, I’ll work on something I know I need to improve. These days, this is usually something like executive presence, strategy, or infrastructure.&lt;/p&gt;

&lt;p&gt;I’m currently working towards a &lt;a href="https://www.extension.harvard.edu/academics/graduate-degrees/software-engineering-degree"&gt;Master’s Degree in Software Engineering at Harvard University’s Extension School&lt;/a&gt;. For weeks, I’ll go back and fourth on which courses to take. Should I work on something that will help me improve my day to day work? Should I work on something that I have no knowledge of whatsoever? Should I put every possibility in a top hat and pick one at random?&lt;/p&gt;

&lt;p&gt;Last Fall, I decided to take a &lt;a href="https://www.extension.harvard.edu/course-catalog/courses/cloud-devopsmdashbasics-and-modern-techniques/15869?keyword=devops"&gt;DevOps course&lt;/a&gt;. It focused mostly on AWS and its services. I learned about S3, EC2, VPCs, Internet Gateways, Nat Gateways, Cloud Formation, Ansible, Jenkins, and a few other technologies and services. This was a textbook “improving a weaknesses” strategy.&lt;/p&gt;

&lt;p&gt;Earlier this Spring, I took “&lt;a href="https://www.extension.harvard.edu/course-catalog/courses/web-application-development-using-nodejs/25038?keyword=node.js"&gt;Internet Applications using Node.js and Angular&lt;/a&gt;“. This was textbook example of the “strengthening a strength” strategy. At &lt;a href="http://fincura.com"&gt;FINCURA&lt;/a&gt;, I wear multiple hats. One of those hats is the frontend architect – and we use Angular. Needless to say, I learned a few interesting tidbits about Angular I didn’t already know. It was also fun to learn more about Node.&lt;/p&gt;

&lt;p&gt;This Fall, I’m getting out of my comfort zone and taking two classes! I’m going to strengthen a strength (Data visualizations with a focus on d3) and improve a weakness (Java! “Java, Hadoop, Lamba Expressions, and Streams).&lt;/p&gt;

&lt;p&gt;It’s your call if you want to strengthen a strength or improve a weakness. There’s no right or wrong answer. You can even be like me and do both depending on your mood.&lt;/p&gt;

&lt;p&gt;The key is to always be improving. Always try to get better. People often overestimate what they can do in a week, but underestimate what they can do in ten years. Keep moving. Keep improving.&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>webdev</category>
      <category>productivity</category>
      <category>career</category>
    </item>
    <item>
      <title>Front End Architecture for Angular Applications</title>
      <dc:creator>Bob Cavezza</dc:creator>
      <pubDate>Tue, 07 May 2019 00:44:55 +0000</pubDate>
      <link>https://dev.to/cavezza/front-end-architecture-for-angular-applications-g4i</link>
      <guid>https://dev.to/cavezza/front-end-architecture-for-angular-applications-g4i</guid>
      <description>&lt;p&gt;In my current role as Director of Product Engineering at &lt;a href="http://fincura.com"&gt;FINCURA&lt;/a&gt;, I’m often thinking about our front end architecture. For our front end application, we use Angular.&lt;/p&gt;

&lt;p&gt;Angular architecture comes down to three main players: services, container components, and presentation components.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://ibuildmvps.com////wp-content/uploads/2019/05/Screen-Shot-2019-05-06-at-5.37.42-PM.png"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--kzab25Vg--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://ibuildmvps.com///wp-content/uploads/2019/05/Screen-Shot-2019-05-06-at-5.37.42-PM-1024x557.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I’m going to explain each of these pieces separately, but to get a snapshot of what’s going on, take a look at this diagram:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://ibuildmvps.com////wp-content/uploads/2019/05/angular-component-based-architecture.jpg"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--e2hwn4_8--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://ibuildmvps.com///wp-content/uploads/2019/05/angular-component-based-architecture.jpg" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;[Image by Claudo Clavijo from his slideshare deck at &lt;a href="https://www.slideshare.net/paucls/angular-and-redux"&gt;https://www.slideshare.net/paucls/angular-and-redux&lt;/a&gt;]&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Services&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Services will do the heavy lifting for your application. They should contain all business logic in your application because business logic will typically be used system-wide. In order to ensure maximum reusability, make sure you can access business rules easily. Angular’s dependency injection for services makes it trivial to reuse service methods site-wide.&lt;/p&gt;

&lt;p&gt;If you’re not using Redux, you will want to store system-wide state in services. One common example is keeping the current logged in user as a variable in the &lt;code&gt;UserService&lt;/code&gt;. It is an alternative option to store common state in a system-wide container component that is the master parent. However, if you do this, there will be instances in your application where you pass a &lt;code&gt;user&lt;/code&gt; variable down in many places. You can expect most components to need the &lt;code&gt;user&lt;/code&gt; variable at different times. I call this “Input() Hell” and it’s not all that different from “callback” hell.&lt;/p&gt;

&lt;p&gt;Services don’t have any visual output. They process data for components and then components are the part of the infrastructure that display information.&lt;/p&gt;

&lt;p&gt;According to &lt;a href="https://angular.io/guide/testing#service-tests"&gt;Angular’s official documentation&lt;/a&gt;, “(&lt;a href="https://angular.io/guide/testing#testing-services-with-the-testbed"&gt;services are the easiest files to unit test&lt;/a&gt;". Generally, when you test services, you don’t need to worry about the Angular TestBed. Services aren’t much more than regular javascript classes. My go-to method for testing services are to instantiate the service classes with their dependencies mocked with jasmine’s “createSpyObj” method. Once I do that, I can write tests as if I was dealing with a regular javascript class. Here’s a quick example of a test I wrote a few weeks ago:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;describe('PortfolioService', () =\&amp;gt; {
  let portfolioService: PortfolioService
  const apiServiceSpy = jasmine.createSpyObj('ApiService', {'send': of( {   response: { objects: [] }} ) } );

  beforeEach(() =\&amp;gt; {
    portfolioService = new PortfolioService(apiServiceSpy);
  });

  describe('#cssColorNumber', () =\&amp;gt; {
    beforeEach(() =\&amp;gt; {
      const portfolios = [
        { name: 'Portfolio1', id: 0 },
        { name: 'Portfolio2', id: 1 },
        { name: 'Portfolio3', id: 2 },
        { name: 'Portfolio4', id: 13 },
        { name: 'Portfolio5', id: 14 },
      ]; 
      portfolioService.portfolios = portfolios;
    }); 

    it('returns id index +1 of id found', () =\&amp;gt; {
      const expectedResult = 5;
      const result = portfolioService.cssColorNumber({name: 'Portfolio5', id: 14});
      expect(result).toEqual(expectedResult);
    }); 
  });
});
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;In the test above, we are testing the output of a method that returns the index+1 of objects found in an array by their id. Before each test, we instantiate the service class with a mocked dependency injection. We apply sample data to the service we are testing. Then, we are able to test this with a simple expectation. No TestBed needed and no complicated setup that typically comes with the TestBed.&lt;/p&gt;

&lt;p&gt;In summary, services should contain all business logic for your application, contain shared state over different pieces of the application, perform all api calls, and have no visual output. They are also much easier to test than presentation components.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Container Components&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Container components get their name because they contain presentation components, and always pass data down to these presentation component layers. They are sometimes referred to as smart components. In many cases, you will have nested container components that pass data down to other containers, which eventually pass data down to presentation components.&lt;/p&gt;

&lt;p&gt;It’s difficult to get a true sense of what this looks like without an example, so let’s take a look at how this works in practice.&lt;/p&gt;

&lt;p&gt;Let’s take a look at my LinkedIn homepage. This is what I see when I log into LinkedIn.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://ibuildmvps.com/wp-content/uploads/2019/08/linkedin_homepage_for_angular_post-1024x511.png"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Pdt-ZuZF--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://ibuildmvps.com/wp-content/uploads/2019/08/linkedin_homepage_for_angular_post-1024x511.png" alt=""&gt;&lt;/a&gt; [click image to enlarge]&lt;/p&gt;

&lt;p&gt;Here’s an attempt to break this up based on what I assume LinkedIn’s container components and presentation components are (in their front end architecture). Note: Most of my abilities to mock up container components and presentation components comes from reading &lt;a href="https://reactjs.org/docs/thinking-in-react.html"&gt;Thinking in React&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://ibuildmvps.com////wp-content/uploads/2019/05/Screen-Shot-2019-05-06-at-6.37.27-PM.png"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--_zE7w622--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://ibuildmvps.com///wp-content/uploads/2019/05/Screen-Shot-2019-05-06-at-6.37.27-PM-1024x522.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The different colors represent the hierarchies of container components. The main focus for drawing components in this example is the left side navigation bar and all of its parents (which are also container components). The entire page is wrapped by a red line. This will typically be called “app-component” in an application. The next yellow layer of hierarchy separates the top navigation bar from the main wrapper component, which will represent the body of the page. The pink layer is the container for the sidebar. After that, the orange breaks up each of the clearly separated panels. Then the panels are further subdivided into separate child components. The red, yellow, purple, and orange are all container components. Once we get past that, it’s a little more hazy depending on what exactly the application is doing and how granular LinkedIn builds its presentation components. Once you get down to the green layer, you are now looking at presentation components. It’s pretty easy to tell how the top 2 green rectangles and the bottom two green rectangles are probably reused presentation components based on how similar they look.&lt;/p&gt;

&lt;p&gt;In our Angular application, we utilize a technique that React has made famous called “lifting state up” (&lt;a href="https://reactjs.org/docs/lifting-state-up.html"&gt;https://reactjs.org/docs/lifting-state-up.html)&lt;/a&gt;. This means that we store the state used by numerous different components at their lowest shared parent component.&lt;/p&gt;

&lt;p&gt;Let’s use LinkedIn’s homepage for this example as well. In our current working example, we have one instance of a user’s avatar on the page. A product manager has come to us and has told us that she wants to add a new item to the top navigation component that contains the user’s avatar. The mockup she gives us looks like this:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://ibuildmvps.com/wp-content/uploads/2019/05/mockup_pm_gave_us.png"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--LBLOmeWB--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://ibuildmvps.com/wp-content/uploads/2019/05/mockup_pm_gave_us.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;[The mockup our PM has given us. Click to enlarge]&lt;/p&gt;

&lt;p&gt;If we look closely at the page that we marked up with the component structure, we can see that we already have the avatar on the page. One option is to call our user service again as part of the navigation component, but http calls are expensive. Instead, we want to move where we store the user’s avatar information up to a common parent of both the side navigation bar and the top navigation header. That common parent is the component that we highlighted with a red outline – “app-component”.&lt;/p&gt;

&lt;p&gt;If we are currently calling the UserService.getUser method in the orange panel container component, we will now want to call that method in app component (the red wrapper). Then, we will pass down the avatar url as “@Input()”s down to the yellow, down to the maroon, and then down to the orange, where it lived to begin with. We will also pass that same value down to the yellow navigation component and to its children where the new html element will live and display the avatar on the navigation bar.&lt;/p&gt;

&lt;p&gt;Containers do not do a lot of heavy lifting for the visual components, but they do have a key presentation responsibility. That responsibility is the placement of presentation components. A good rule of thumb is that you don’t want presentation components to have margin css attributes. The positioning of presentation components should generally be controlled by their parent container components.&lt;/p&gt;

&lt;p&gt;Testing container components is generally the hardest of the three types of files we discuss in this article. The main reason for this is the handling of state. State changes and angular lifecycle methods need to be tested. This causes added testing complexity. A key reason to separate out container components and presentation components is so you test container components less and presentation components more.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Presentation components&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Presentation components are sometimes referred to as “dumb” components, used mostly to display information. Presentation components will inherit all data and events (@Input()s and @Output()s) from parent components. They are entirely visual output components.&lt;/p&gt;

&lt;p&gt;Continuing with our LinkedIn example, we can see a presentation wrapped in green:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://ibuildmvps.com////wp-content/uploads/2019/05/Screen-Shot-2019-05-06-at-6.37.27-PM.png"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--_zE7w622--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://ibuildmvps.com///wp-content/uploads/2019/05/Screen-Shot-2019-05-06-at-6.37.27-PM-1024x522.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This presentation component is used four times on this page, in two separate places. You can reasonably guess what the inputs and outputs are for this presentation component.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://ibuildmvps.com/wp-content/uploads/2019/05/who_viewed_your_profile.png"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--8iq4y57I--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://ibuildmvps.com/wp-content/uploads/2019/05/who_viewed_your_profile.png" alt=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The inputs and outputs for this component will probably look something like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;@Input() label  
@Input() value
@Output() onClickLabel
@Output() onClickValue
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;These inputs and outputs are passed in by their parents.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why separate container and presentation components?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;There are three reasons: (1) reusability, (2) testability, and (3) ease of use for HTML/CSS designers.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;(1) Reusability&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;If you break components down into smaller and smaller pieces, you will be able to reuse different components in different areas of your code. You can see this in the LinkedIn example with the green outlines on the sidebar. This is all about the “DRY” (don’t repeat yourself) principle. If you didn’t break those green outlines into presentation components, you would have coded the same thing twice. If you later got instructions to change something there, you would have to make changes in multiple places. Doing this usually leads to bugs.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;(2) Testability&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Presentation components are much easier to test than container components. When you remove state and lifecycle methods as concerns, testing is much easier. Yes, you do need to test container components. It’s a part of writing good, maintainable code. However, the more testing you can do in presentation components, the better off you will be.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;(3) HTML/CSS Developers&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Many software teams have varying degrees of skillsets. It is not unusual to have someone on the team that knows HTML and CSS really well, but little javascript. When you separate presentation components and container components, it is now a lot easier for HTML/CSS specialists to tweak design-related code. Using a tool like &lt;a href="https://storybook.js.org/"&gt;Storybook&lt;/a&gt; works wonders on letting HTML/CSS developers control design elements.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Conclusion&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This architecture has worked well for us. Separating logic into services, container components, and presentation components has made testing easier. Having a well tested codebase has allowed us to have a much more stable application.&lt;/p&gt;

&lt;p&gt;Breaking components down into presentation components has increased our code reusability. Code reusability has allowed us to deliver features faster and introduce less bugs.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Read more at my blog&lt;/strong&gt;&lt;br&gt;
&lt;a href="http://ibuildmvps.com"&gt;http://ibuildmvps.com&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Connect with me&lt;/strong&gt;&lt;br&gt;
&lt;a href="http://twitter.com/cavezza"&gt;http://twitter.com/cavezza&lt;/a&gt;&lt;br&gt;
&lt;a href="http://linkedin.com/in/cavezza"&gt;http://linkedin.com/in/cavezza&lt;/a&gt;&lt;/p&gt;

</description>
      <category>frontend</category>
      <category>angular</category>
      <category>javascript</category>
      <category>webdev</category>
    </item>
    <item>
      <title>9 software engineering job search and interview tips from the last 3 years</title>
      <dc:creator>Bob Cavezza</dc:creator>
      <pubDate>Mon, 26 Jun 2017 01:33:10 +0000</pubDate>
      <link>https://dev.to/cavezza/9-software-engineering-job-search-and-interview-tips-from-the-last-3-years-1bhb</link>
      <guid>https://dev.to/cavezza/9-software-engineering-job-search-and-interview-tips-from-the-last-3-years-1bhb</guid>
      <description>&lt;p&gt;Over the last three years, I was at a startup, a large company, and a smaller company inside a larger company. I’ve interviewed. I’ve been interviewed. I’ve been the deciding vote and I’ve watched great people get passed over. I’ve seen whiteboarding, pair programming, coderpad technical interviews, hacker rank challenges, take home assignments, written tests, and just about everything else you can imagine.&lt;/p&gt;

&lt;p&gt;Here are the things I’ve learned during this time. This post should help you if you’re looking for new opportunities, if you were recently laid off, or if you’re fresh out of college or a coding school. &lt;/p&gt;

&lt;h1&gt;
  
  
  Finding Opportunities
&lt;/h1&gt;

&lt;h2&gt;
  
  
  Make a list of companies you want to work for
&lt;/h2&gt;

&lt;p&gt;This is probably my favorite part of looking for a new job. You have a blank canvas. You can work anywhere. Ever wanted to live in Hawaii? Hell – now’s the time. Ever wanted to work for a cool company like EA Sports, Google, or Facebook? Put it on your list. The world is your oyster. Don’t limit yourself to companies similar to where you’ve worked at in the past.&lt;/p&gt;

&lt;p&gt;Also – ignore job postings. A lot of great positions are filled by internal referrals and never get posted to job sites. If you put in the time, you should be able to get a referral for almost any company you’re interested in applying to.&lt;/p&gt;

&lt;p&gt;I would suggest making a list of at least 15 companies to give you a chance to sample many different types. You don’t want to limit your search to just a few companies, but rather, a larger pool. Some people you will email and will never respond. This can get disheartening if you’re only waiting for that one email, but if you’re looking at 15 different companies at once, you won’t fixate on one person not getting back to you. You should also view this like a conversion funnel. X% of the jobs you apply to will give you a phone call. A percentage of that number will get you on another call for a technical interview. A percentage of that number will bring you in for an in-person interview. A percentage of that number will give you an offer. In an ideal world, you will have multiple offers you can choose between.&lt;/p&gt;

&lt;p&gt;This may be difficult to keep track of, so I highly recommend keeping a Google spreadsheet of all current opportunities. Also, you should add companies to the pipeline as opportunities don’t turn into offers.&lt;/p&gt;

&lt;h2&gt;
  
  
  Always look for a referral
&lt;/h2&gt;

&lt;p&gt;You should always look for a referral for any opportunity.&lt;/p&gt;

&lt;p&gt;A friend in HR once told me that hiring a friend is better than hiring a friend of a friend. Hiring a friend of a friend is is better than a referral from someone you work with. And a coworker’s referral is better than a random resume from a job board.&lt;/p&gt;

&lt;p&gt;When it comes down to a decision to hire someone, it always makes hiring managers feel a little better if someone is vouching for that person – even if its subtle. Put yourself in the hiring manager’s shoes. Random people are risky. There’s no one vouching for them.&lt;/p&gt;

&lt;p&gt;In an ideal scenario, your best friend works for the company you are applying to, but it’s more likely that you have a common LinkedIn connection. When you do, reach out to the common connection. Let them know you’re interested in working at their connection’s company and then ask for an introduction via email or on LinkedIn.&lt;/p&gt;

&lt;p&gt;If your mutual friend sent the intro, you should thank your friend for the intro and then ask that other person for coffee. I would tell them that I’m an engineer and I’m interested in opportunities at their company. And I’d also mention that I’d like to learn more about the culture and what it’s like to work there.&lt;/p&gt;

&lt;p&gt;If a mutual friend doesn’t send the intro, you can always email the person you wanted to get connected to directly (or send them a request on LinkedIn). If you want to email them directly, there’s a chrome extension called &lt;a href="http://hunter.io" rel="noopener noreferrer"&gt;hunter.io&lt;/a&gt; that will make it easy to find their email address.&lt;/p&gt;

&lt;h2&gt;
  
  
  Be open to different opportunities
&lt;/h2&gt;

&lt;p&gt;During the course of your job hunt, you will get random emails and LinkedIn messages about different job opportunities. When you get this type of email, give the company a shot. There’s really no downside. Even if you weren’t initially interested in the company, you might love the people and the culture there.&lt;/p&gt;

&lt;p&gt;When I was job hunting a few years ago, a friend mentioned opportunities at Liberty Mutual early in my job search. I didn’t give the opportunity a lot of consideration. I knew I wanted to work in a startup environment – not at a larger company. Boy, was I wrong! I’m really lucky I changed my mind and explored opportunities at Liberty because it ended up being the perfect fit for me. If I didn’t give it a chance, I would have never found out how great it was.&lt;/p&gt;

&lt;h1&gt;
  
  
  The Interview
&lt;/h1&gt;

&lt;h2&gt;
  
  
  Know the format before the technical interview
&lt;/h2&gt;

&lt;p&gt;It’s okay to ask the format of a technical interview. Most of the time, companies will tell you what to expect. If you know the types of questions you should expect in an interview, you’ll be able to practice and prepare for the specific format. It’s a different mindset going in if you’re writing on the whiteboard vs. on a computer.&lt;/p&gt;

&lt;p&gt;One of the mistakes I frequently made was that I would try to improve weaknesses from the last technical interview instead of work on what I needed to succeed on the next technical interview. While you need to make sure you’re fixing up your weaknesses, you also need to be prepared for the next interview.&lt;/p&gt;

&lt;p&gt;Knowing if pseudo code is okay or if you need to know specific syntax is important. Whiteboarding is a different mindset than writing on a computer. A timed hacker rank challenge is different than exercises on &lt;a href="http://coderpad.io" rel="noopener noreferrer"&gt;coderpad&lt;/a&gt; vs. a take home technical assignment. Just like any mid-term, knowing the format of the test will help you prepare.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://ibuildmvps.com////wp-content/uploads/2017/06/programming_whiteboard-620x465-100594253-primary.idge_.jpg" rel="noopener noreferrer"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fibuildmvps.com%2F%2Fwp-content%2Fuploads%2F2017%2F06%2Fprogramming_whiteboard-620x465-100594253-primary.idge_.jpg" alt="programming_whiteboard-620x465-100594253-primary.idge"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Don’t mention your weaknesses
&lt;/h2&gt;

&lt;p&gt;I am a very firm believer that it is the company’s job in technical interviews to assess your technical competencies.&lt;/p&gt;

&lt;p&gt;If you feel worse about your front-end experience versus your back-end experience, don’t let them know that. First of all, it’s their job to assess your skills. Second, developers are often harder on themselves than other people. Just because you don’t love your front-end skillsets doesn’t mean other people won’t be envious of what you can do.&lt;/p&gt;

&lt;p&gt;Also, don’t make excuses as you code. I’ve seen it happen. I’ve done it in the past. I’ve also heard this mentioned in interview debriefings. If you mention you are not great at something, your interviewers will take your words and mention them later. Even if you are being humble, what you say often becomes “the truth” in technical interviews. Make it hard for them. Don’t speak about your faults. Put your best foot forward. Be confident. Let them know you are competent in all parts of your work, and put the work on them to be able to prove otherwise.&lt;/p&gt;

&lt;h2&gt;
  
  
  Make sure you are prepared
&lt;/h2&gt;

&lt;p&gt;Research company interview reviews on &lt;a href="http://glassdoor.com" rel="noopener noreferrer"&gt;GlassDoor&lt;/a&gt;. Don’t assume the questions will be the same, but you can expect similar questions based on available reviews.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.amazon.com/Cracking-Coding-Interview-Programming-Questions/dp/0984782850" rel="noopener noreferrer"&gt;Cracking the Coding Interview Book&lt;/a&gt; – This book is fantastic! I highly recommend it if you are interviewing. It has a lot of commonly asked behavioral and technical questions. It helps you brush up on CS fundamentals and commonly asked MVC and OOP questions. If you are interviewing, you must buy this book!&lt;/p&gt;

&lt;p&gt;Go through &lt;a href="http://hackerrank.com" rel="noopener noreferrer"&gt;HackerRank&lt;/a&gt; challenges – A lot of companies will use tools like HackerRank to decide if they should bring you into the office to give you an in-person interview. If companies are using this, you should use the platform in order to practice. They provide many different options for algorithm, data structure, and other types of challenges. They also have dozens of languages available for you to code in.&lt;/p&gt;

&lt;p&gt;Check out &lt;a href="https://www.interviewcake.com/" rel="noopener noreferrer"&gt;InterviewCake&lt;/a&gt;. Interview Cake is one of the best kept secrets in programming interviews. If you aren’t great at technical interviews, check out this website. It’s the only resource online that recreates a technical algorithm interview (which you often see when an interviewer asks you to use &lt;a href="https://coderpad.io/" rel="noopener noreferrer"&gt;coderpad&lt;/a&gt;). It will have you create an initial solution. It will ask you if you can do better. It will show you how you can do better and how the algorithmic efficiency of your solution can be increased. It will teach you how to ace algorithm interviews. It’s probably the best resource you will find online to help you solve these challenges. Don’t take my word for it, go try their demo and you will see why it’s so great!&lt;/p&gt;

&lt;h1&gt;
  
  
  Post Interview
&lt;/h1&gt;

&lt;h2&gt;
  
  
  Learn from every interview
&lt;/h2&gt;

&lt;p&gt;I had an “interviewing notebook” during my job search. In it, I would write down every term I didn’t fully understand. If I was asked a question and I wasn’t happy with my response, I would write it down. Taking note of your mistakes is the first part in correcting them.&lt;/p&gt;

&lt;p&gt;I suggest writing these things down in the middle of an interview. If you don’t feel okay doing that, make sure you open up your notebook as soon as your interview is over, and scribble everything you remember not being able to answer efficiently.&lt;/p&gt;

&lt;p&gt;If you don’t know the answer to a question once, that’s okay – it happens. If you fail to answer the same question from multiple interviews, that’s your own fault. Make sure you go back in this notebook when you get home and look up what you didn’t fully understand. Software development is about continuous learning.&lt;/p&gt;

&lt;h2&gt;
  
  
  Go back to the fundamentals
&lt;/h2&gt;

&lt;p&gt;Depending on the company you are interviewing with, they may want you to know a lot about Big O notation, data structures, and algorithms. This is something self taught developers often struggle with. You can take 2 online classes for free to level up your skills and fully understand these concepts. I highly recommend &lt;a href="https://www.youtube.com/watch?v=ZFjhkohHdAA&amp;amp;list=PLOtl7M3yp-DV69F32zdK7YJcNXpTunF2b" rel="noopener noreferrer"&gt;Steve Skiena’s Algorithms class&lt;/a&gt; and &lt;a href="http://www.infocobuild.com/education/audio-video-courses/computer-science/cs61a-fall2010-berkeley.html" rel="noopener noreferrer"&gt;Brian Harvey’s Intro to Computer Science&lt;/a&gt; class.&lt;/p&gt;

&lt;p&gt;Even if you never learned them, CS fundamentals aren’t too tough to learn. I recommend going over &lt;a href="http://teachyourselfcs.com" rel="noopener noreferrer"&gt;teachyourselfcs.com&lt;/a&gt; and following their recommendations to fill in knowledge gaps.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://ibuildmvps.com////blog/wp-content/uploads/2017/06/learning-from-mistakes-8-638.jpg" rel="noopener noreferrer"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fibuildmvps.com%2F%2F%2F%2Fblog%2Fwp-content%2Fuploads%2F2017%2F06%2Flearning-from-mistakes-8-638.jpg" alt="learning-from-mistakes-8-638"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Ask for feedback explicitly from your interviewers
&lt;/h2&gt;

&lt;p&gt;You should already be writing down what you think you did wrong in your interviews. However, this isn’t always good enough. You also need to find out what the interviewer’s reasons were for passing on you if you don’t get an offer.&lt;/p&gt;

&lt;p&gt;I suggest explicitly asking interviewers why they passed on you. You should ask for feedback from your interviewer. You should mention that you’re always trying to improve, and you need to find out what to focus on. Ask them if they can provide any feedback on your interview or suggestions on what you should focus on as you continue your job search.&lt;/p&gt;

&lt;p&gt;Companies don’t really have incentives to give you this feedback, but a few will provide it to you if you explicitly ask. Not all feedback is created equal, but any negative feedback you get from a company is a gift. It tells you exactly what you need to improve. It tells you why you didn’t get the offer. You won’t always get it, but make sure you follow-up and ask at least twice for feedback after an interview.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Read more at my blog&lt;/strong&gt;&lt;br&gt;
&lt;a href="http://ibuildmvps.com" rel="noopener noreferrer"&gt;http://ibuildmvps.com&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Connect with me&lt;/strong&gt;&lt;br&gt;
&lt;a href="http://twitter.com/cavezza" rel="noopener noreferrer"&gt;http://twitter.com/cavezza&lt;/a&gt;&lt;br&gt;
&lt;a href="http://linkedin.com/in/cavezza" rel="noopener noreferrer"&gt;http://linkedin.com/in/cavezza&lt;/a&gt;&lt;/p&gt;

</description>
      <category>career</category>
      <category>programming</category>
      <category>beginners</category>
      <category>codenewbie</category>
    </item>
  </channel>
</rss>
