<?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: Simon</title>
    <description>The latest articles on DEV Community by Simon (@simondoescoding).</description>
    <link>https://dev.to/simondoescoding</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%2F824114%2Ff06b9ebb-4aa4-4777-8636-0737ea6c826b.jpg</url>
      <title>DEV Community: Simon</title>
      <link>https://dev.to/simondoescoding</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/simondoescoding"/>
    <language>en</language>
    <item>
      <title>What Is a Flexbox? And What Do I Put In It?</title>
      <dc:creator>Simon</dc:creator>
      <pubDate>Tue, 08 Mar 2022 10:40:28 +0000</pubDate>
      <link>https://dev.to/simondoescoding/what-is-a-flexbox-and-what-do-i-put-in-it-m5j</link>
      <guid>https://dev.to/simondoescoding/what-is-a-flexbox-and-what-do-i-put-in-it-m5j</guid>
      <description>&lt;h2&gt;
  
  
  I Like To KISS
&lt;/h2&gt;

&lt;p&gt;If you have read any of my other blog posts, you'll know I like to keep things simple stupid (KISS) and get straight to the point. Flexbox is essentially a way that allows a container to best fill the space available. The rest of the background of Flexbox is a bit boring so we'll skip and get into some code &amp;amp; examples 😁&lt;/p&gt;

&lt;h2&gt;
  
  
  How Do I Use a Flexbox?
&lt;/h2&gt;

&lt;p&gt;To set a container to use flexbox we use the CSS property "display" and set the value to "flex"; this will enable a flex context for all its direct children. We now have a flexbox container! Congrats! 🥳&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--gGfkVyHE--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1646731827246/DLHaWv89E.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--gGfkVyHE--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1646731827246/DLHaWv89E.png" alt="Flexbox Container.png" width="880" height="495"&gt;&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;.flex-container {
    display: flex;
}

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

&lt;/div&gt;



&lt;h3&gt;
  
  
  What Now?
&lt;/h3&gt;

&lt;p&gt;There are a number of properties that we can set in order to manipulate the behaviour of our flexbox. Let's take a look at some of these:&lt;/p&gt;

&lt;h4&gt;
  
  
  Properties for flexbox container
&lt;/h4&gt;

&lt;p&gt;&lt;strong&gt;flex-direction&lt;/strong&gt; This is how we define if the flexbox's items will be displayed vertically (column) or horizontally (row). We can also set the items to be displayed in reverse by suffixing the property value with "-reverse".&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--uKraDQIX--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1646732042579/gs9MJEyvv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--uKraDQIX--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1646732042579/gs9MJEyvv.png" alt="FlexDirection.png" width="880" height="495"&gt;&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;.flex-container {
    flex-direction: row | row-reverse | column | column-reverse;
}

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

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;flex-wrap&lt;/strong&gt; By default, flexbox will try to put all items onto a single line regardless of the container boundary. We can change this by adding a property to the flexbox container, flex-wrap.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;.flex-container {
    flex-wrap: nowrap | wrap | wrap-reverse;
}

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

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;nowrap (default): all flex items will be on one line&lt;/li&gt;
&lt;li&gt;wrap: flex items will wrap onto multiple lines, from top to bottom.&lt;/li&gt;
&lt;li&gt;wrap-reverse: flex items will wrap onto multiple lines from bottom to top.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;flex-flow&lt;/strong&gt; flex-flow is a shorthand that amalgamates both flex-direction and flex-wrap.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;.flex-container {
    flex-flow: column wrap;
}

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

&lt;/div&gt;



&lt;h4&gt;
  
  
  Properties for flexbox children (flex items)
&lt;/h4&gt;

&lt;p&gt;&lt;strong&gt;order&lt;/strong&gt; By default flex items are displayed in the order that they appear in the flexbox container. However, we can control the order in which they are displayed with the "order" property. Any items that have the same order value will display in the order they appear in the flexbox container.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;.flex-item {
    order: 5
}

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

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;flex-grow&lt;/strong&gt; flex-grow allows an item to grow to fill the space of its flexbox container; a unitless value that acts as a proportion to the other flex items in the container. If all items have a value of 1 the remaining space in the container will be distributed evenly to all children. If one flex item has a flex-grow value of 2 then this item will occupy twice as much space as items with a value of 1.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;.flex-item {
    flex-grow: 1
}

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

&lt;/div&gt;



&lt;h2&gt;
  
  
  The Real Reason People Use Flexbox
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Centering an item!
&lt;/h3&gt;

&lt;p&gt;To center an item inside a flexbox we need to have a couple of things. Firstly we need a flexbox container, then we need at least one flex item.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;.flex-container {
    display: flex;
}

.flex-item {
    width: 100px;
}


&amp;lt;div class="flex-container"&amp;gt;
    &amp;lt;div class="flex-item"&amp;gt;
        Item #1
    &amp;lt;/div&amp;gt;
&amp;lt;/div&amp;gt;

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

&lt;/div&gt;



&lt;p&gt;Now we need to add a property to center the flex item horizontally; we'll use "justify-content" to do that! Lets add that in to the flexbox container css.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;.flex-container {
    display: flex;
    justify-content: center;
}

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

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Perfect!&lt;/strong&gt; We've centered the item horizontally. Now let's center it vertically. To do this we'll use the "align-items" property in the flexbox container CSS. We'll also add some height to the container so we can see the centered working correctly.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;.flex-container {
    min-height: 500px;
    display: flex;
    justify-content: center;
    align-items: center;
}

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

&lt;/div&gt;



&lt;p&gt;Don't believe me that this actually works? Here's a codepen for you to see it in action and you can have a play around with the different values.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://codepen.io/Simon_9/full/OJOYbjZ"&gt;https://codepen.io/Simon_9/full/OJOYbjZ&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Other Values For Flex Positioning
&lt;/h4&gt;

&lt;p&gt;Flex is great to center an element horizontally and vertically inside a container but there are other values we can set to change the display of the flex items.&lt;/p&gt;

&lt;h5&gt;
  
  
  Justify-Content
&lt;/h5&gt;

&lt;ul&gt;
&lt;li&gt;flex-start (default): items are shifted towards the start of the flex-direction.&lt;/li&gt;
&lt;li&gt;flex-end: items are shifted towards the end of the flex-direction.&lt;/li&gt;
&lt;li&gt;start: items are shifted towards the start of the writing-mode direction.&lt;/li&gt;
&lt;li&gt;end: items are shifted towards the end of the writing-mode direction.&lt;/li&gt;
&lt;li&gt;left: items are shifted towards the left edge of the container unless that doesn’t make sense with the flex-direction, then it behaves like a start.&lt;/li&gt;
&lt;li&gt;right: items are shifted towards the right edge of the container unless that doesn’t make sense with the flex-direction, then it behaves like an end.&lt;/li&gt;
&lt;li&gt;center: items are centred along the center line&lt;/li&gt;
&lt;li&gt;space-between: items are evenly distributed&lt;/li&gt;
&lt;li&gt;space-around: items are evenly distributed with equal space around them.&lt;em&gt;Note that visually the spaces aren’t equal, since all the items have equal space on both sides. The first item will have one unit of space against the container edge, but two units of space between the next item because that next item has its own spacing that applies.&lt;/em&gt;
&lt;/li&gt;
&lt;li&gt;space-evenly: items are distributed so that the spacing between any two items (and the space to the edges) is equal.&lt;/li&gt;
&lt;/ul&gt;

&lt;h5&gt;
  
  
  Align-Items
&lt;/h5&gt;

&lt;ul&gt;
&lt;li&gt;stretch (default): stretch to fill the container (still respects the min-width/max-width)&lt;/li&gt;
&lt;li&gt;flex-start / start / self-start: items are placed at the start of the cross axis. The difference between these is subtle and is about respecting the flex-direction rules or the writing-mode rules.&lt;/li&gt;
&lt;li&gt;flex-end / end / self-end: items are placed at the end of the cross axis. The difference again is subtle and is about respecting flex-direction rules vs. writing-mode rules.&lt;/li&gt;
&lt;li&gt;center: items are centred vertically&lt;/li&gt;
&lt;li&gt;baseline: items are aligned such as their baselines align&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Feedback Time
&lt;/h2&gt;

&lt;p&gt;I'd love to know your thoughts on this article! Don't forget to leave a reaction so I know if you enjoyed it! Aaaaand come say hello on Twitter! &lt;a href="https://twitter.com/simondoescoding"&gt;@SimonDoesCoding&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Basic Intro to Functional Programming</title>
      <dc:creator>Simon</dc:creator>
      <pubDate>Fri, 04 Mar 2022 15:00:54 +0000</pubDate>
      <link>https://dev.to/simondoescoding/basic-intro-to-functional-programming-3io2</link>
      <guid>https://dev.to/simondoescoding/basic-intro-to-functional-programming-3io2</guid>
      <description>&lt;h2&gt;
  
  
  Functional Programming Background
&lt;/h2&gt;

&lt;p&gt;Functional programming is a programming paradigm that avoids shared state, mutability and side effects; this is done by using pure functions. Because functional programming aims to avoid side effects and mutability it makes unit testing easier.&lt;/p&gt;

&lt;h3&gt;
  
  
  Huh? A Pure Function? What is that?
&lt;/h3&gt;

&lt;p&gt;In simple terms, a pure function will always return the same result if the inputs are the same AND the function does not have any side effects.&lt;/p&gt;

&lt;h3&gt;
  
  
  I Still Don't Understand
&lt;/h3&gt;

&lt;p&gt;Okay, okay let's have a look at some code. This first example is a pure function, it has no side effects and given the same inputs it will always return the same output.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const sum = (a, b) =&amp;gt; a + b;

sum(1, 4); // the answers 5
sum(1, 4); // the answers still 5
sum(1, 4); // guess what... its still 5

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

&lt;/div&gt;



&lt;p&gt;Lets now have a look at an impure function and see if we can figure out what is going to be returned&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const randSum = (a, b) =&amp;gt; a + b + Math.random() * 10;

randSum(1, 4); // what will be returned?
randSum(1, 4); // whats going to be returned this time?
randSum(1, 4); // surely you can get one out of three right?

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

&lt;/div&gt;



&lt;p&gt;So why is this an impure function? Simple, each time the function is called with the same inputs, the output is going to be different; this makes it unpredictable and therefore difficult to unit test.&lt;/p&gt;

&lt;h3&gt;
  
  
  Basics Out of the Way
&lt;/h3&gt;

&lt;p&gt;Okay, we've got through the simple pure and impure functions, lets look at another function and let's figure out if it's pure or impure.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const delta = 5;
const deltaSum = (a,b) =&amp;gt; {
    delta = 4;
    return a + b + delta;
}

deltaSum(5,6); // returns 15
deltaSum(5,6); // still returns 15

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

&lt;/div&gt;



&lt;p&gt;So when the inputs are the same, the value returned is always the same so surely this is a pure function right?&lt;/p&gt;

&lt;p&gt;Wrong!&lt;/p&gt;

&lt;p&gt;This function is also impure as the function relies on a global variable and the function has side effects by changing (or mutating if you prefer) the global variable from inside the function.&lt;/p&gt;

&lt;h3&gt;
  
  
  Other examples of impure functions
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Using console.log() inside of a function makes the function impure as this is an external API and not a javascript method. &lt;/li&gt;
&lt;li&gt;Throwing exceptions makes the function impure because our function now has a side effect&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Time To Be Realistic
&lt;/h3&gt;

&lt;p&gt;It's all well and good on paper saying that every function needs to be pure but in reality, we need to write to the console, we need to throw exceptions and we might even have to mutate state occasionally.&lt;/p&gt;

&lt;p&gt;So what can we do?&lt;/p&gt;

&lt;p&gt;We can create a clear boundary between the parts of our code that are pure and which are impure; this lets us and any other developers know what to expect.&lt;/p&gt;

&lt;h3&gt;
  
  
  Overall
&lt;/h3&gt;

&lt;p&gt;This is not everything that makes up functional programming but just a single part. Functional programming certainly has its place and it makes predicting and unit testing code a lot easier. I would recommend reading up on functional programming if you are eager to learn new things and broaden your horizons.&lt;/p&gt;

&lt;h2&gt;
  
  
  You Da Best
&lt;/h2&gt;

&lt;p&gt;I appreciate you reading this article and I hope you learned something new! If did enjoy the article I'd appreciate your sharing and adding a reaction on the article 👍&lt;/p&gt;

</description>
    </item>
    <item>
      <title>I Just Had My Mind Blown: Variables In Vanilla CSS 🤯</title>
      <dc:creator>Simon</dc:creator>
      <pubDate>Thu, 03 Mar 2022 13:48:21 +0000</pubDate>
      <link>https://dev.to/simondoescoding/i-just-had-my-mind-blown-variables-in-vanilla-css-55h1</link>
      <guid>https://dev.to/simondoescoding/i-just-had-my-mind-blown-variables-in-vanilla-css-55h1</guid>
      <description>&lt;p&gt;Yesterday, I was having a little chat with a friend on Twitter about creating HTML templates; this is something I'd looked at doing before but I wasn't able to provide the level of customizability that I would have liked. I have been trying to aim my templates at non-technical users who may not have any knowledge of CSS or HTML. As you can imagine, it's quite difficult to change a picture or brand colours when the user has no idea what HTML or CSS is.&lt;/p&gt;

&lt;p&gt;After chatting with my friend, I thought it'd be best to just have a very detailed .README file that explains everything that the user would need to change and how they would go about doing it. I got off on a tangent, as I usually do, and started googling things and then I stumbled across something... the holy grail! Exactly what I had been looking for! Variables in vanilla CSS! 🤯🤯🤯🤯🤯&lt;/p&gt;

&lt;h3&gt;
  
  
  I Found It!
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--y8ahIAad--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1646313611392/_XoLWWFPr.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--y8ahIAad--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1646313611392/_XoLWWFPr.png" alt="image.png" width="880" height="578"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I had to refresh the page a few times to make sure I wasn't getting trolled, I checked the date to make sure it wasn't April Fools Day but no, this was real! All my problems... well most of my coding problems were solved!&lt;/p&gt;

&lt;h3&gt;
  
  
  Here's how you do it
&lt;/h3&gt;

&lt;p&gt;Enough of my life story, lets looks at how we actually implement this!&lt;/p&gt;

&lt;p&gt;You have a psuedo-class in your CSS file and create a custom property inside that; this property can then be used throughout the CSS file.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;:root {
    --primary-color: #C0B9DD;
}

.some-class {
    background-color: var(--primary-color);
}

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

&lt;/div&gt;



&lt;p&gt;Here's a quick codepen I put together so you can see it working for yourselves!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://codepen.io/Simon_9/pen/yLPGwOp"&gt;https://codepen.io/Simon_9/pen/yLPGwOp&lt;/a&gt;&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>webdesign</category>
      <category>css</category>
      <category>coding</category>
    </item>
    <item>
      <title>7 Fun, Cool &amp; Free APIs For Your Next Project</title>
      <dc:creator>Simon</dc:creator>
      <pubDate>Tue, 01 Mar 2022 14:01:43 +0000</pubDate>
      <link>https://dev.to/simondoescoding/7-fun-cool-free-apis-for-your-next-project-e53</link>
      <guid>https://dev.to/simondoescoding/7-fun-cool-free-apis-for-your-next-project-e53</guid>
      <description>&lt;h2&gt;
  
  
  A Small list of free APIs for your next project!
&lt;/h2&gt;

&lt;p&gt;Just a quick list of fun and free APIs that you can use for your next web development project.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;a href="https://pokeapi.co/docs/v2"&gt;Poke API&lt;/a&gt; - Access all pokemon data including characters, sprites, moves, stats and more!&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.boredapi.com/"&gt;Bored API&lt;/a&gt; - Generates random activities for you to do when you're bored&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://superheroapi.com/"&gt;Super Hero API&lt;/a&gt; - Data on superheroes from both comic universes&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://api.chucknorris.io/"&gt;Chuck Norris Jokes API&lt;/a&gt; - Generates a random Chuck Norris joke&lt;/li&gt;
&lt;li&gt;
&lt;a href="http://www.omdbapi.com/"&gt;Movie Database&lt;/a&gt; - Obtain movie information &lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.thecocktaildb.com/api.php"&gt;Cocktail API&lt;/a&gt; - Find information on cocktails, how to make them, ingredients or generate a random cocktail!&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://github.com/sameerkumar18/geek-joke-api"&gt;Geeky Jokes API&lt;/a&gt; - Fetches a random geeky/programming related joke&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;I created a simple Pokedex using Poke API &lt;a href="https://my-pokemon-pokedex.vercel.app/"&gt;My Pokedex&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  I'd love to see what you make with these APIs!
&lt;/h4&gt;

&lt;h3&gt;
  
  
  Have Fun!
&lt;/h3&gt;

</description>
    </item>
    <item>
      <title>Red Light. Green Light... Refactor: Test Driven Development</title>
      <dc:creator>Simon</dc:creator>
      <pubDate>Tue, 01 Mar 2022 11:44:31 +0000</pubDate>
      <link>https://dev.to/simondoescoding/red-light-green-light-refactor-test-driven-development-28bh</link>
      <guid>https://dev.to/simondoescoding/red-light-green-light-refactor-test-driven-development-28bh</guid>
      <description>&lt;h2&gt;
  
  
  What Am I On About?
&lt;/h2&gt;

&lt;p&gt;Let's get straight to the point. Test Driven Development or TDD for short, is an approach to software development where unit tests drive the design and development of the code; with TDD, tests are written and implemented before any code is written. We're going to focus on a TDD approach called "Red, Green, Refactor".&lt;/p&gt;

&lt;h2&gt;
  
  
  Red, Green, Refactor
&lt;/h2&gt;

&lt;p&gt;There are three stages of development for this TDD approach. Can you guess what they are?&lt;/p&gt;

&lt;h4&gt;
  
  
  Well Done! Give yourself a gold star! ⭐
&lt;/h4&gt;

&lt;p&gt;They are, of course, "Red", "Green" and then "Refactor"&lt;/p&gt;

&lt;h3&gt;
  
  
  Red
&lt;/h3&gt;

&lt;p&gt;Let's firstly look at "Red" and what this means. The "Red" stage is always your starting point in this approach of TDD and this is where you think about &lt;em&gt;what&lt;/em&gt; you want to develop. The purpose of this phase is to define what you want to implement but not writing any logic to make the feature actually work.&lt;/p&gt;

&lt;h4&gt;
  
  
  Time For Some Code
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;public interface ICalculateAreas
{

}

public class AreaCalculator : ICalculateAreas
{

}

[TestClass]
public class TestDrivenDevelopmentExample 
{
    private ICalculateAreas _areaCalculator;

    [TestInitialize]
    public void Setup() 
    {
        _areaCalculator = new AreaCalculator();
    }

    [TestMethod]
    public void TestDrivenDevelopmentExample_AreaCalculator_CalculateQuadrilaterals() 
    {
        var expected = 24;

        var actual = _areaCalculator.CalculateQuadrilaterals();

        Assert.AreEqual(expected, actual);
    }
}

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

&lt;/div&gt;



&lt;p&gt;So in the code snippet above, we have a C# interface, class and test class. The interface and class are empty and purposely don't contain any methods or logic; this is to satisfy the Red stage.&lt;/p&gt;

&lt;p&gt;Before we even run this in Visual Studio we will get an error that looks something like this: &lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--vhADF5Yy--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1646131119982/d8UDG4TzD.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--vhADF5Yy--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1646131119982/d8UDG4TzD.png" alt="image.png" width="880" height="29"&gt;&lt;/a&gt;Have you ever been so happy to see a failing test or an error in your code?&lt;/p&gt;

&lt;h4&gt;
  
  
  Brilliant! We have completed the Red stage!
&lt;/h4&gt;

&lt;h3&gt;
  
  
  Green
&lt;/h3&gt;

&lt;p&gt;Time for "Green" and you guessed it... that means we're going to make this test pass BUT we are going to do the very minimum to get this test to build &amp;amp; pass; we'll think about making the method clean, readable and efficient later.&lt;/p&gt;

&lt;p&gt;In our example above, we want our CalculateQuadrilaterals() method to return the same value as our expected variable, in this case, that's 24. So, what's the first thing we need to do to get this thing building &amp;amp; passing?&lt;/p&gt;

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

&lt;p&gt;Need another minute?&lt;/p&gt;

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

&lt;h4&gt;
  
  
  Correct! We need to create the method
&lt;/h4&gt;

&lt;p&gt;Firstly, we need to create the method to please Visual Studio. Let's go ahead and do that; we need to add the method to our interface and then to our class.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;public interface ICalculateArea
{
    decimal CalculateQuadrilaterals();
}

public class AreaCalculator : ICalculateArea
{
    public decimal CalculateQuadrilaterals()
    {
        throw new System.NotImplementedException();
    }
}

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

&lt;/div&gt;



&lt;p&gt;Done! Visual Studio is happy but our test is failing. Let's make it pass. We'll add in a couple of hardcoded values so that the method returns our expected value.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;public class AreaCalculator : ICalculateArea
{
    public decimal CalculateQuadrilaterals()
    {
        var height = 4;
        var width = 6;

        return height * width;
    }
}

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

&lt;/div&gt;



&lt;h4&gt;
  
  
  OMG! It's passed!
&lt;/h4&gt;

&lt;h3&gt;
  
  
  Refactor
&lt;/h3&gt;

&lt;p&gt;Congratulations, we've written some code that not only builds but it also passes! However... there is a slight problem with our code. What about quadrilaterals that have an area of anything BUT 24? We've hardcoded in the values to return the arbitrary value of 24. What if the height was 14 and the width was 26? Would our method be able to calculate that? Nah, we're always going to get 24. Let's change that by refactoring our code. That's right, in the Refactor stage we're going to refactor our code... who'd of thought it? This stage is important as we want to refactor our code; thinking of performance, readability amongst other things, but ensuring that our test still passes.&lt;/p&gt;

&lt;p&gt;For our code we want the height and width to be passed into our method and remove the hardcoded values. We'll add parameters into our method, remember to add the params into the interface as well.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;public interface ICalculateArea
{
    decimal CalculateQuadrilaterals(decimal height, decimal width);
}

public class AreaCalculator : ICalculateArea
{
    public decimal CalculateQuadrilaterals(decimal height, decimal width)
    {
        return height * width;
    }
}

[TestClass]
public class TestDrivenDevelopmentExample
{
    private ICalculateArea _areaCalculator;

    [TestInitialize]
    public void Setup()
    {
        _areaCalculator = new AreaCalculator();
    }

    [TestMethod]
    public void TestDrivenDevelopmentExample_AreaCalculator_CalculateQuadrilaterals()
    {
        var height = 4;
        var width = 6;
        var expected = 24;

        var actual = _areaCalculator.CalculateQuadrilaterals(height, width);

        Assert.AreEqual(expected, actual);
    }
}

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

&lt;/div&gt;



&lt;p&gt;We've added parameters into our method for the height and width of the quadrilateral we are trying to calculate the area for; we've removed the hardcoded height and width variable; we've added height and width variables into our unit test and passed them into the CalculateQuadrilaterals method.&lt;/p&gt;

&lt;h4&gt;
  
  
  Moment of truth... does our test still pass?
&lt;/h4&gt;

&lt;h3&gt;
  
  
  SUCCESS!
&lt;/h3&gt;

&lt;p&gt;We've done it! We've gone through all the stages of Red, Green, Refactor. This is obviously a very simple example of using Red, Green, Refactor but no matter how complex the feature is, the stages and principles remain the same.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Becoming A Software Developer: Simon's Story</title>
      <dc:creator>Simon</dc:creator>
      <pubDate>Mon, 29 Nov 2021 15:20:31 +0000</pubDate>
      <link>https://dev.to/simondoescoding/becoming-a-software-developer-simons-story-41dp</link>
      <guid>https://dev.to/simondoescoding/becoming-a-software-developer-simons-story-41dp</guid>
      <description>&lt;h2&gt;
  
  
  My Computer Background
&lt;/h2&gt;

&lt;p&gt;Ever since I knew what a computer was, I was obsessed. Video games, games on the internet, videos, Minesweeper, anything you could do on a computer I was a fan of. Whenever anyone in my family had a problem with their computer, they rang me and it made me feel like Bill Gates even though I was just turning it off and on again 😂&lt;/p&gt;

&lt;p&gt;Moving forward a few years, my best friend had a PC custom built and naturally, I wanted one! I ordered essentially the same PC that he had. After a while, some of the newer games weren't running as smoothly as I wanted them to so I started investigating how I make mine run better. When the PC was on its last legs, I started taking the PC apart and looking at the different parts inside the case and I was just fascinated with everything!&lt;/p&gt;

&lt;p&gt;I saved my money and purchased a new motherboard, a new CPU, some new RAM and a GPU. Put it all together inside the old case and voila! New, shiny, up to date PC and something I could be proud of! Something I'd learned about and built all on my own! I still have that PC today! I have added more RAM and SSD's since then but it's still very usable.&lt;/p&gt;

&lt;h2&gt;
  
  
  Computer Education
&lt;/h2&gt;

&lt;p&gt;When it came time to select which subjects I wanted to do for my GCSE's, IT was one of my options. However, IT was mainly how to use Word, Excel and Access databases; not exactly the thrill of building my own PC.&lt;/p&gt;

&lt;p&gt;On to college! If I'm being honest, I didn't research the courses available at my college and instead I took subjects that I felt comfortable with; one of which was IT. I couldn't tell you what I learned during that first year of college in IT... something about the Computer Misuse Act or something? Maybe? 🤷 Towards the end of my first year, one of my friends that I had played basketball with for a couple of years said that he was taking "Computing"... Wait what?!?! There's ANOTHER computer course? What's that about? I did a bit of research on it and low and behold its how a computer works, its writing code, learning parts of a computer! I immediately spoke to the college and decided to drop IT and take Computing going into my second year. I loved that class! I wasn't the best in my class by far but it was the lesson I looked forward to the most.&lt;/p&gt;

&lt;h2&gt;
  
  
  Change of Plan
&lt;/h2&gt;

&lt;p&gt;Throughout my GCSE's &amp;amp; A-Levels I always saw myself having a job as a... can you guess?&lt;/p&gt;

&lt;p&gt;Did you say "Software Developer"?&lt;/p&gt;

&lt;p&gt;If you did, you'd be wrong! I was deadset on becoming a Police Officer! Yep, that's right a Police Office, pretty far from sitting in a basement doing coding. Despite this ambition to join the Police, I chose Computer Systems Engineering to study at university with the hope to join the Police after completing my degree. I had it all planned out. My family had it all planned out.&lt;/p&gt;

&lt;h2&gt;
  
  
  University - The Biggest Regret of My Life
&lt;/h2&gt;

&lt;p&gt;I got the grades required to get into my first choice of university! Hooray... I should be excited right? I wasn't. I was going to miss my girlfriend. She still had another year of university and she was my best friend. The university I had chosen was on the other side of the country. "Well, why did you choose that university?" I can hear you all asking but it was one of the few computer courses that didn't require an A-Level in Maths. I didn't want to go but my family made it very clear I'd be letting them down if I didn't go.&lt;/p&gt;

&lt;p&gt;I moved across the country to university where I basically didn't leave my room, only for lessons and lectures. I didn't interact with anyone, I barely ate anything. I was miserable. My girlfriend came to visit for a week when she was off college and I just wanted to leave university! So that's what I did! I spoke to the university and said I didn't want to be there anymore, they suggested deferring my place for a year so I could return in a year if I wanted to. I had a week or two to pack my stuff and move out of the accommodation whilst they processed my deferral. The relief I felt was UNREAL! A huge weight had been lifted off me. I'd let my family down but I just didn't care, I was just so excited to leave. I was going home... but to do what?&lt;/p&gt;

&lt;h2&gt;
  
  
  Road To Software Developer
&lt;/h2&gt;

&lt;p&gt;During the time of me moving out of university, I managed to secure an interview for an apprenticeship in Web Development. The apprenticeship was not close to home and was going to be an hours commute on the train. Believe me, paying for trains as well as feeding myself, paying for my car and leisure activities is not an easy feat and I honestly don't know how I managed it. I kept reminding myself that the year's worth of experience would be crucial to getting a job at the end of it, so I persevered.&lt;/p&gt;

&lt;p&gt;Did I learn a lot from my apprenticeship? Not really.&lt;/p&gt;

&lt;p&gt;Did it help me get a job at the end of it? Definitely! What I had been telling myself the entire year finally paid off! I got a job as a junior web developer at a real company. They actually wanted to pay me, what I considered, a lot of money to do real work for them, to do real problem solving! I couldn't believe it!&lt;/p&gt;

&lt;p&gt;Did I learn a lot from my first job? Yes. To this day, I still think I learned more from my first job than from my apprenticeship. There is an awful lot to learn on paper but real world code is not like the textbooks. Luckily, the senior took me under his wing and helped as much as possible and the IT Director made sure I had plenty of "little projects" for him.&lt;/p&gt;

&lt;h2&gt;
  
  
  Where Am I Now?
&lt;/h2&gt;

&lt;p&gt;So here we are 10+ years later and I'm still coding but now I'm trying to take a whole new path. Freelancing and becoming a content creator for programming. I've been on Twitter for the past couple of months and there are so many people trying to learn to code, asking which path is best. In reality, no two people's journeys are the same. What might work for one person, doesn't work for someone else.&lt;/p&gt;

&lt;p&gt;Alls I can say to anyone wanting to learn to code, just do it! Be self-taught. Go on boot camps. Get a degree. Whatever it takes!&lt;/p&gt;

&lt;p&gt;For the ones that have already started on their journey and are worrying about finding a job, wondering "Am I ready?". You are ready! Even if you don't meet the job requirements to a T, apply anyway! Practice your soft skills, they go a long way!&lt;/p&gt;

&lt;p&gt;If I was to only apply for jobs where I met every single bit of criteria on the job description, I still wouldn't get a job. What's the worst that can happen? They say no? They don't reply? Is that really the end of the world?&lt;/p&gt;

&lt;p&gt;Anyway, this is just my story. I can't wait to hear your stories too!&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Is Web3 &amp; Blockchain The Future Of Web Development?</title>
      <dc:creator>Simon</dc:creator>
      <pubDate>Tue, 23 Nov 2021 09:16:09 +0000</pubDate>
      <link>https://dev.to/simondoescoding/is-web3-blockchain-the-future-of-web-development-1fc5</link>
      <guid>https://dev.to/simondoescoding/is-web3-blockchain-the-future-of-web-development-1fc5</guid>
      <description>&lt;p&gt;Recently I delved into the unknown and started reading and learning about Web3 and blockchain; this is the latest trend circling around Twitter so my interest was peaked 👀&lt;/p&gt;

&lt;h3&gt;
  
  
  Web3
&lt;/h3&gt;

&lt;p&gt;But what on earth is Web3? and what is blockchain for that matter? Let's start with an easy one... what is Web3? Web3 is a collection of Javascript libraries that allows an application to interact with an Ethereum node remotely or locally or more simply put it allows an application to work with blockchain.&lt;/p&gt;

&lt;p&gt;So far so good? &lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--53TjWfrq--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1637656743139/vvrmtNG1v.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--53TjWfrq--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1637656743139/vvrmtNG1v.png" alt="Untitled design (1).png" width="880" height="306"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Blockchain
&lt;/h3&gt;

&lt;p&gt;So we're all crystal clear on what Web3 is right? Now to tackle blockchain 😬 Basically, a blockchain is a special database that stores information in a way that makes it near impossible to hack or change. The information stored is essentially a digital ledger of transactions; each of these transactions is duplicated across all the nodes on the blockchain.&lt;/p&gt;

&lt;p&gt;Okay, blockchain done ✅ &lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--LS-mxlT2--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1637656667632/ICOV9hzFP.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--LS-mxlT2--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1637656667632/ICOV9hzFP.png" alt="Untitled design.png" width="880" height="306"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  What happens next?
&lt;/h3&gt;

&lt;p&gt;So we know what Web3 is (roughly), we know what blockchain is (kinda)... how on earth do we use it?&lt;/p&gt;

&lt;p&gt;So let's open VS Code and create a new project... just kidding! I'll cover all that in another post 😛&lt;/p&gt;

&lt;p&gt;In all seriousness, how do we interact with the blockchain? We write something called smart contracts. I can already hear it... "what is a smart contract?" so let's find out&lt;/p&gt;

&lt;h3&gt;
  
  
  Smart Contracts
&lt;/h3&gt;

&lt;p&gt;In simple terms, a smart contract is a program that is stored on a blockchain that runs when certain conditions are met. Smart contracts allow developers to manipulate the data stored in the blockchain.&lt;/p&gt;

&lt;p&gt;We've covered what Web3, Blockchain and Smart Contracts are, now for the question you've all wanted to know the answer to and the entire reason you came in the first place... Is Web3 &amp;amp; blockchain the future of web development?&lt;/p&gt;

&lt;h3&gt;
  
  
  Is Web3 &amp;amp; Blockchain the future of Web Development?
&lt;/h3&gt;

&lt;p&gt;One thing I can't stand when I read blog posts is when there is no clear opinion to answer the topic of the blog post. I could easily say that Web3 &amp;amp; Blockchain MIGHT be the future of web development but I'm not gonna. I want to give my honest opinion and if I'm wrong, I'm wrong and I'll move on with my life.&lt;/p&gt;

&lt;h3&gt;
  
  
  Drumroll Please
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--STtQSiPS--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1637658513085/jbWnedWOEm.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--STtQSiPS--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1637658513085/jbWnedWOEm.png" alt="Untitled design (2).png" width="880" height="306"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;No. No, I don't think Web3 &amp;amp; Blockchain is the future of web development. It certainly has it's place on the web and it will be perfect for certain companies but I don't see the industry moving into Web3 &amp;amp; Blockchain. There doesn't seem to be a need for it from a freelance/agency point of view. A traditional database, back end and front end site will get the job done. Considering crypto payments need to be made whenever a new smart contract is deployed to blockchain will deter many developers. Buying and investing in cryptocurrency, like any investment, is a risk and I don't see an investment like that being the cornerstone of web development.&lt;/p&gt;

&lt;h5&gt;
  
  
  There, I said it!
&lt;/h5&gt;

&lt;p&gt;Will that stop me from learning Web3 and Blockchain? Absolutely not, there definitely will be a market for it and I see it as being quite a niche market and one that companies will pay $$$ for&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
