<?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: Desmond Owusu Ansah</title>
    <description>The latest articles on DEV Community by Desmond Owusu Ansah (@desmondowusudev).</description>
    <link>https://dev.to/desmondowusudev</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%2F746256%2Fb62ee21e-d1e9-4829-80ac-2694aa629d40.jpeg</url>
      <title>DEV Community: Desmond Owusu Ansah</title>
      <link>https://dev.to/desmondowusudev</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/desmondowusudev"/>
    <language>en</language>
    <item>
      <title>Build a number guessing game in Ruby</title>
      <dc:creator>Desmond Owusu Ansah</dc:creator>
      <pubDate>Mon, 19 Sep 2022 01:16:24 +0000</pubDate>
      <link>https://dev.to/desmondowusudev/build-a-number-guessing-game-in-ruby-4b2i</link>
      <guid>https://dev.to/desmondowusudev/build-a-number-guessing-game-in-ruby-4b2i</guid>
      <description>&lt;p&gt;In this article I will show you how to create a simple number guessing game in Ruby. The game will be a command line application that will ask the user to guess a number between 0 to 9. If the user guesses correctly, the game will print a message and exit. If the user guesses incorrectly, the game will print a message and ask the user to guess again.&lt;/p&gt;

&lt;h2&gt;
  
  
  Prerequisites
&lt;/h2&gt;

&lt;p&gt;You will need to have Ruby installed on your computer. If you don't have Ruby installed, you can download it from &lt;a href="https://www.ruby-lang.org/en/downloads/"&gt;ruby-lang.org&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Getting started
&lt;/h2&gt;

&lt;p&gt;To get started, create a new file called &lt;code&gt;guessing_game.rb&lt;/code&gt; and open it in your favorite text editor. We will start by printing a welcome message to the user.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight ruby"&gt;&lt;code&gt;&lt;span class="nb"&gt;puts&lt;/span&gt; &lt;span class="s2"&gt;"Welcome to the guessing game!"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Next, we will generate a random number between 0 to 9 and store it in a variable called &lt;code&gt;secret_num&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight ruby"&gt;&lt;code&gt;&lt;span class="n"&gt;secret_num&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;rand&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt; &lt;span class="o"&gt;..&lt;/span&gt; &lt;span class="mi"&gt;9&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;rand&lt;/code&gt; method will generate a random number between 0 to 9. The &lt;code&gt;..&lt;/code&gt; operator will create a range from 0 to 9.&lt;/p&gt;

&lt;p&gt;Next, we will create a initialize the following variables:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;guess&lt;/code&gt; - this will store the user's guess&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;guess_count&lt;/code&gt; - this will store the number of guesses the user has made&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;guess_limit&lt;/code&gt; - this will store the maximum number of guesses the user can make&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;out_of_guesses&lt;/code&gt; - this will store a boolean value indicating if the user has reached the maximum number of guesses
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight ruby"&gt;&lt;code&gt;&lt;span class="n"&gt;guess&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kp"&gt;nil&lt;/span&gt;
&lt;span class="n"&gt;guess_count&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;
&lt;span class="n"&gt;guess_limit&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;
&lt;span class="n"&gt;out_of_guesses&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kp"&gt;false&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Next, we will create a while loop that will run as long as the user has not reached the maximum number of guesses and the user has not guessed the secret number.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight ruby"&gt;&lt;code&gt;&lt;span class="k"&gt;while&lt;/span&gt; &lt;span class="n"&gt;guess&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="n"&gt;secret_num&lt;/span&gt; &lt;span class="n"&gt;and&lt;/span&gt; &lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="n"&gt;out_of_guesses&lt;/span&gt;
    &lt;span class="c1"&gt;# if guess count is less than guess limit then increment guess count&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;guess_count&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;guess_limit&lt;/span&gt;
        &lt;span class="nb"&gt;puts&lt;/span&gt; &lt;span class="s2"&gt;"Enter your guessed number"&lt;/span&gt;
        &lt;span class="n"&gt;guess&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;gets&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;chomp&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;to_i&lt;/span&gt;
        &lt;span class="n"&gt;guess_count&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="k"&gt;else&lt;/span&gt; 
        &lt;span class="c1"&gt;# if guess count is greater than guess limit then set out_of_guesses to true&lt;/span&gt;
        &lt;span class="n"&gt;out_of_guesses&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kp"&gt;true&lt;/span&gt;
        &lt;span class="k"&gt;break&lt;/span&gt;
    &lt;span class="k"&gt;end&lt;/span&gt;
&lt;span class="k"&gt;end&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;gets&lt;/code&gt; method will read a line from the user's input. The &lt;code&gt;chomp&lt;/code&gt; method will remove the newline character from the end of the string. The &lt;code&gt;to_i&lt;/code&gt; method will convert the string to an integer.&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;if&lt;/code&gt; statement will check if the user has reached the maximum number of guesses. If the user has reached the maximum number of guesses, the &lt;code&gt;out_of_guesses&lt;/code&gt; variable will be set to &lt;code&gt;true&lt;/code&gt; and the &lt;code&gt;while&lt;/code&gt; loop will exit.&lt;/p&gt;

&lt;p&gt;Next, we will check if the user has reached the maximum number of guesses. If the user has reached the maximum number of guesses, we will print a message to the user and exit the game. If the user has not reached the maximum number of guesses, we will print a message to the user and ask them to guess again.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight ruby"&gt;&lt;code&gt;&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;out_of_guesses&lt;/span&gt;
    &lt;span class="nb"&gt;puts&lt;/span&gt; &lt;span class="s2"&gt;"You lose!"&lt;/span&gt;
    &lt;span class="nb"&gt;puts&lt;/span&gt; &lt;span class="s2"&gt;"You have reached the maximum number of guesses."&lt;/span&gt;
    &lt;span class="nb"&gt;puts&lt;/span&gt; &lt;span class="s2"&gt;"The secret number was &lt;/span&gt;&lt;span class="si"&gt;#{&lt;/span&gt;&lt;span class="n"&gt;secret_num&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;
&lt;span class="k"&gt;else&lt;/span&gt;
    &lt;span class="nb"&gt;puts&lt;/span&gt; &lt;span class="s2"&gt;"Congratulations! You won!"&lt;/span&gt;
    &lt;span class="nb"&gt;puts&lt;/span&gt; &lt;span class="s2"&gt;"You guessed the secret number &lt;/span&gt;&lt;span class="si"&gt;#{&lt;/span&gt;&lt;span class="n"&gt;secret_num&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s2"&gt; and you did it in &lt;/span&gt;&lt;span class="si"&gt;#{&lt;/span&gt;&lt;span class="n"&gt;guess_count&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s2"&gt; guesses."&lt;/span&gt;
&lt;span class="k"&gt;end&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Finally, your code should look like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight ruby"&gt;&lt;code&gt;&lt;span class="nb"&gt;puts&lt;/span&gt; &lt;span class="s2"&gt;"Welcome to the number guessing game!"&lt;/span&gt;

&lt;span class="n"&gt;secret_num&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;rand&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt; &lt;span class="o"&gt;..&lt;/span&gt; &lt;span class="mi"&gt;9&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;guess&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kp"&gt;nil&lt;/span&gt;
&lt;span class="n"&gt;guess_count&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;
&lt;span class="n"&gt;guess_limit&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;
&lt;span class="n"&gt;out_of_guesses&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kp"&gt;false&lt;/span&gt;

&lt;span class="k"&gt;while&lt;/span&gt; &lt;span class="n"&gt;guess&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="n"&gt;secret_num&lt;/span&gt; &lt;span class="n"&gt;and&lt;/span&gt; &lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="n"&gt;out_of_guesses&lt;/span&gt;
    &lt;span class="c1"&gt;# if guess count is less than guess limit then increment guess count&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;guess_count&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;guess_limit&lt;/span&gt;
        &lt;span class="nb"&gt;puts&lt;/span&gt; &lt;span class="s2"&gt;"Enter your guessed number"&lt;/span&gt;
        &lt;span class="n"&gt;guess&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;gets&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;chomp&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;to_i&lt;/span&gt;
        &lt;span class="n"&gt;guess_count&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="k"&gt;else&lt;/span&gt; 
        &lt;span class="c1"&gt;# if guess count is greater than guess limit then set out_of_guesses to true&lt;/span&gt;
        &lt;span class="n"&gt;out_of_guesses&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kp"&gt;true&lt;/span&gt;
        &lt;span class="k"&gt;break&lt;/span&gt;
    &lt;span class="k"&gt;end&lt;/span&gt;
&lt;span class="k"&gt;end&lt;/span&gt;

&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;out_of_guesses&lt;/span&gt;
    &lt;span class="nb"&gt;puts&lt;/span&gt; &lt;span class="s2"&gt;"You lose!"&lt;/span&gt;
    &lt;span class="nb"&gt;puts&lt;/span&gt; &lt;span class="s2"&gt;"You have reached the maximum number of guesses."&lt;/span&gt;
    &lt;span class="nb"&gt;puts&lt;/span&gt; &lt;span class="s2"&gt;"The secret number was &lt;/span&gt;&lt;span class="si"&gt;#{&lt;/span&gt;&lt;span class="n"&gt;secret_num&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;
&lt;span class="k"&gt;else&lt;/span&gt;
    &lt;span class="nb"&gt;puts&lt;/span&gt; &lt;span class="s2"&gt;"Congratulations! You won!"&lt;/span&gt;
    &lt;span class="nb"&gt;puts&lt;/span&gt; &lt;span class="s2"&gt;"You guessed the secret number &lt;/span&gt;&lt;span class="si"&gt;#{&lt;/span&gt;&lt;span class="n"&gt;secret_num&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s2"&gt; and you did it in &lt;/span&gt;&lt;span class="si"&gt;#{&lt;/span&gt;&lt;span class="n"&gt;guess_count&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s2"&gt; guesses."&lt;/span&gt;
&lt;span class="k"&gt;end&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To run the game, open a terminal and navigate to the directory where you saved the &lt;code&gt;guessing_game.rb&lt;/code&gt; file. Then run the following command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ruby guessing_game.rb
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;In this article, we created a simple number guessing game in Ruby. The game will ask the user to guess a number between 0 to 9. If the user guesses correctly, the game will print a message and exit. If the user guesses incorrectly, the game will print a message and ask the user to guess again.&lt;/p&gt;

&lt;h2&gt;
  
  
  Follow me
&lt;/h2&gt;

&lt;p&gt;If you enjoyed this article, please follow me on &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Github &lt;a href="https://github.com/Owusu-Desmond"&gt;@Owusu-Desmond&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Twitter &lt;a href="https://twitter.com/DesmondOwusuDev"&gt;@DesmondOwusuDev&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;LinkedIn &lt;a href="https://www.linkedin.com/in/desmond-owusu-ansah-09274a223/"&gt;@desmond-owusu-ansah&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Youtube &lt;a href="https://www.youtube.com/channel/UCJGz0BLcCjlkqrn47eexJXg"&gt;@Desmond Owusu Ansah&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

</description>
    </item>
    <item>
      <title>Learn React Concept and Create your first app with React</title>
      <dc:creator>Desmond Owusu Ansah</dc:creator>
      <pubDate>Sun, 31 Jul 2022 02:04:29 +0000</pubDate>
      <link>https://dev.to/desmondowusudev/learn-react-concept-and-create-your-first-app-with-react-27g</link>
      <guid>https://dev.to/desmondowusudev/learn-react-concept-and-create-your-first-app-with-react-27g</guid>
      <description>&lt;p&gt;In this article, we will learn what and why React. We will also create our first React application.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is React?
&lt;/h2&gt;

&lt;p&gt;React is a JavaScript library created by Facebook and released in the May of 2003 for front-end development. &lt;br&gt;
Front-end development consists of HTML, CSS, and JavaScript. As a front-end developer, you will easily find it is very difficult for the front-end with HTML, CSS, and JavaScript when a website or web app is more interactive (have a lot of different moving parts). Eventually, Facebook developers decided there must have a better way to manage these difficulties and that was when &lt;strong&gt;React&lt;/strong&gt; was created as a JavaScript library to make front-end development easier and faster.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why React?
&lt;/h2&gt;

&lt;p&gt;Interactive websites need to update the DOM(Document Object Model) whenever a change happens. Compared to other libraries that manipulate the DOM, React uses a Virtual DOM (a lightweight copy of the actual DOM) that allow updating the part of the website that has changed and this increases the speed of updates. &lt;/p&gt;

&lt;h2&gt;
  
  
  How to use React
&lt;/h2&gt;

&lt;p&gt;You can use react in two ways &lt;strong&gt;Adding react to your website&lt;/strong&gt; or &lt;strong&gt;Creating react app&lt;/strong&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Adding React to a website
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;p&gt;React can be added to a website without any special tools and installations. But before that, we have to include the React library as &lt;strong&gt;two script tags&lt;/strong&gt; to the head of the HTML Document&lt;/p&gt;


&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;script &lt;/span&gt;&lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;"https://unpkg.com/react@16/umd/react.development.js"&lt;/span&gt; &lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nx"&gt;crossorigin&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nt"&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;

&lt;span class="nt"&gt;&amp;lt;script &lt;/span&gt;&lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;"https://unpkg.com/react-dom@16/umd/react-&amp;gt;dom.development.js"&lt;/span&gt; &lt;span class="na"&gt;crossorigin&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt; 
&lt;/code&gt;&lt;/pre&gt;


&lt;p&gt;Next, we need to add another script, to enable the use of JSX.&lt;br&gt;
JSX stands for JavaScript XML. JSX allows us to write HTML in React. JSX makes it easier to write and add HTML in React.&lt;/p&gt;


&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;script &lt;/span&gt;&lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;"https://unpkg.com/babel-standalone@6/babel.min.js"&lt;/span&gt;&lt;span class="err"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="na"&gt;script&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt; 
&lt;/code&gt;&lt;/pre&gt;

&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Creating react app
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;p&gt;Facebook has created a tool called &lt;a href="https://create-react-app.dev/"&gt;Create React App&lt;/a&gt; that makes it easy to set up a React project with a command!&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Now, we will be creating our first react app called &lt;code&gt;my-app&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;To get started, make sure you have a recent version of &lt;a href="https://nodejs.org/en/"&gt;Node&lt;/a&gt; installed on your machine.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;After the installation of the node, Run the command below in your terminal with the path you want to create the app.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="n"&gt;npx&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;create-react-app&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;my-app&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;


&lt;ul&gt;
&lt;li&gt;After the execution of this command, this will install all the required dependencies and a directory name &lt;code&gt;my-app&lt;/code&gt; will be created in the path you run the command. Change the directory to the &lt;code&gt;my-app&lt;/code&gt; by running the command below in the terminal.&lt;/li&gt;
&lt;/ul&gt;


&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="n"&gt;cd&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;my-app&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;


&lt;ul&gt;
&lt;li&gt;Run the app with this command.&lt;/li&gt;
&lt;/ul&gt;


&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="n"&gt;npm&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;start&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;


&lt;ul&gt;
&lt;li&gt;Start the app on &lt;strong&gt;localhost:3000&lt;/strong&gt; in any browser. This is the default output of our project in the browser:&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--t3nk_9ui--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4evlstu5nbzbainc7yvt.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--t3nk_9ui--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4evlstu5nbzbainc7yvt.png" alt="Create react app default output" width="880" height="404"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  React Project Structure
&lt;/h2&gt;

&lt;p&gt;Let's explore the structure of our project by opening it using a code editor.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Now, this is the project structure after creating react app. By default, it contains two directories &lt;code&gt;public&lt;/code&gt; and &lt;code&gt;src&lt;/code&gt;, a &lt;code&gt;ReadMe.md&lt;/code&gt; file that contains how the app can be run, and other information about the app. It also contains a &lt;code&gt;package,json&lt;/code&gt;, and &lt;code&gt;package-lock.json&lt;/code&gt; file which contains the dependencies installed.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--N_nLNk2C--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/anfp1fa8l5oczhaf6zm6.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--N_nLNk2C--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/anfp1fa8l5oczhaf6zm6.PNG" alt="Create react app default structure " width="331" height="217"&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;&lt;em&gt;The &lt;code&gt;public&lt;/code&gt; folder contains files related to how the application will display on the client, the most important of those being &lt;code&gt;index.html&lt;/code&gt;, which is the HTML template of our page:&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--IHHnrdRL--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jjlrzwzs0hxggk8393c8.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--IHHnrdRL--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jjlrzwzs0hxggk8393c8.PNG" alt="React app public directory structure " width="331" height="136"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;The &lt;code&gt;src&lt;/code&gt; folder contains all of the JavaScript, CSS, and image files that will be compiled into a bundle file and injected into &lt;code&gt;index.html&lt;/code&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Zav-4Bbs--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/k5rai61zu3mydtwlerwd.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Zav-4Bbs--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/k5rai61zu3mydtwlerwd.PNG" alt="React app src directory structure " width="326" height="198"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Although there are other files in the src folder that comes with Create React App when it is generated, the two files below are the only critical files:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;index.js&lt;/strong&gt;: This file is the entry point into our application. In the index.js file, a method called &lt;code&gt;ReactDOM.render()&lt;/code&gt; is used to find an element with &lt;code&gt;id="root"&lt;/code&gt; in the HTML and add our React application inside of that element.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;App.js&lt;/strong&gt;: This file is the main component that will be rendered to the DOM, which currently includes the React logo image and the default text, that we see in the output.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  How is React App compiled?
&lt;/h2&gt;

&lt;p&gt;React uses a &lt;code&gt;file loader&lt;/code&gt;. In the case of Create React App, Webpack is used to set up.&lt;br&gt;
Webpack creates a "bundle" file containing the content of multiple files that need to be "bundled" together and it is all added together into a single file and injected into the &lt;code&gt;index.html&lt;/code&gt; file for compilation.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt; : &lt;em&gt;Webpack search for all CSS, JavaScript, and images in the &lt;code&gt;src&lt;/code&gt; directory and create a bundle for them so they should always be in your &lt;code&gt;src&lt;/code&gt; folder in case of Create React App&lt;/em&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Thank you for reading, and let's connect!
&lt;/h2&gt;

&lt;p&gt;Thank you for reading my blog. Feel free to subscribe to my email newsletter and connect on &lt;br&gt;
&lt;a href="https://www.linkedin.com/in/desmond-owusu-ansah-09274a223/"&gt;LinkedIn&lt;/a&gt;&lt;br&gt;
&lt;a href="https://github.com/Owusu-Desmond"&gt;GitHub &lt;/a&gt;&lt;br&gt;
&lt;a href="https://twitter.com/DesmondOwusuDev"&gt;Twitter&lt;/a&gt;&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>webdev</category>
      <category>react</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Software Development Best Practices(DRY, KISS and YAGNI)</title>
      <dc:creator>Desmond Owusu Ansah</dc:creator>
      <pubDate>Sun, 17 Jul 2022 01:29:53 +0000</pubDate>
      <link>https://dev.to/desmondowusudev/best-practicesdry-kiss-and-yagni-2a60</link>
      <guid>https://dev.to/desmondowusudev/best-practicesdry-kiss-and-yagni-2a60</guid>
      <description>&lt;h2&gt;
  
  
  What is DRY, KISS, YAGNI?
&lt;/h2&gt;

&lt;p&gt;They are just acronyms of common best practices and best principles to write clean code. In this article, we will discuss what they mean and why they are important. Let's first discuss "why clear code is important"&lt;/p&gt;

&lt;h2&gt;
  
  
  Importance of clean code in software development.
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;p&gt;Would be great to know why it's important to make code easier to maintain and understandable. Would be great to cover some of the background of it. E.g. code is much more often read compared to written. It helps when working in teams. It helps other engineers to get quicker in context. Clean code improves code quality and gives confidence in software development. &lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Now let's get to the principles that have been embraced by the community, independent of the language you are working on. Some of the most popular are:&lt;/p&gt;

&lt;h3&gt;
  
  
  DRY
&lt;/h3&gt;

&lt;p&gt;DRY simply means (&lt;em&gt;Don't repeat yourself!&lt;/em&gt;). This principle clearly means we should try to avoid having duplicated code. Instead, we should reuse your code when possible.&lt;/p&gt;

&lt;p&gt;To make this clear let us discuss this scenario;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;A student was asked to write a JavaScript program to reverse two words &lt;code&gt;begins&lt;/code&gt; and &lt;code&gt;resume&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Student code&lt;/em&gt; &lt;/p&gt;


&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// reverse "begins"&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;reverseBegins&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
   &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;reverseWord&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;begins&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;split&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;''&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nx"&gt;reverse&lt;/span&gt;&lt;span class="p"&gt;().&lt;/span&gt;&lt;span class="nx"&gt;join&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;''&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
   &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;reverseWord&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;reverseBegins&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt; &lt;span class="c1"&gt;// prints snigeb&lt;/span&gt;

&lt;span class="c1"&gt;// reverse "good"&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;reverseGood&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
   &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;reverseWord&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;good&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;split&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;''&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nx"&gt;reverse&lt;/span&gt;&lt;span class="p"&gt;().&lt;/span&gt;&lt;span class="nx"&gt;join&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;''&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
   &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;reverseWord&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;reverseGood&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt; &lt;span class="c1"&gt;// prints doog&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;


&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Did the Student follow DRY?&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;No&lt;/em&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Why the student didn't follow DRY&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;&lt;strong&gt;Explanation&lt;/strong&gt;: This student code works perfectly as expected but it duplicates a block of code that performs the same function hence the code above does not obeys the DRY principle. Assume how complicated and duplicated the above code will be if the student were asked to reverse five(5) words&lt;/em&gt;.😂&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;How can this student improve the code to make it DRY?&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;The student can use a function with a parameter. So whenever the student wants to reverse a word, the student can pass the word as a parameter when the function is called. For instance, In the code below, a function called &lt;code&gt;reverseWord&lt;/code&gt; takes in  &lt;code&gt;word&lt;/code&gt; as a parameter which reverses any word that will be passed as a parameter when the function is called. So it now will be simple when I have to reverse five(5) words as compared to the student code.&lt;/em&gt;&lt;/p&gt;


&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// reverse word function&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;reverseWord&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;word&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;reverseWord&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;word&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;split&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;''&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nx"&gt;reverse&lt;/span&gt;&lt;span class="p"&gt;().&lt;/span&gt;&lt;span class="nx"&gt;join&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;''&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;reverseWord&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;reverseWord&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;begins&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="c1"&gt;// prints snigeb&lt;/span&gt;
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;reverseWord&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;good&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="c1"&gt;// prints doog&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  KISS
&lt;/h3&gt;

&lt;p&gt;KISS means (&lt;em&gt;Keep It Simple, Stupid&lt;/em&gt;). KISS simply means we should try to avoid unnecessary complexity, we shouldn't over-engineer our code and there should be no further explanations. Our code should be simple, small, and easy to understand.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Let's see if the JavaScript code below which gets and returns items from the &lt;code&gt;localStrorage&lt;/code&gt; of the browser but returns an empty array if there are no items in the &lt;code&gt;localStrorage&lt;/code&gt;.&lt;/p&gt;


&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// get items from localStorage function&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;getItemsFromStore&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;items&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;JSON&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;parse&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;localStorage&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;getItem&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Items&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nx"&gt;items&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;[];&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;items&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;


&lt;p&gt;I understand, if someone says nothing is wrong with this code but let's realize that the use of &lt;code&gt;if-function&lt;/code&gt; in this code makes it complicated and long.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;The code below is simple, small, and easy to understand which follows the KISS principle because it far away from been complicated. &lt;br&gt;
In the code below the &lt;code&gt;items&lt;/code&gt; variable is representing two things &lt;code&gt;JSON.parse(localStorage.getItem("Items"))&lt;/code&gt; and an empty array &lt;code&gt;[]&lt;/code&gt;. The &lt;code&gt;items&lt;/code&gt; variable only returns an empty array &lt;code&gt;[]&lt;/code&gt; when &lt;code&gt;JSON.parse(localStorage.getItem("Items"))&lt;/code&gt; is falsy which is exactly the same as the using the &lt;code&gt;if-statement&lt;/code&gt; to check if it’s falsy.&lt;/em&gt; &lt;/p&gt;


&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// get items from localStorage function&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;getItemsFromStore&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;items&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;JSON&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;parse&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;localStorage&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;getItem&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Items&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="p"&gt;[];&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;items&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  YAGNI
&lt;/h3&gt;

&lt;p&gt;YAGNI fully means (&lt;em&gt;You Aren't Gonna Need It&lt;/em&gt;).The YAGNI principle says you shouldn't add anything you don't strictly need. Functionality should only be implemented in a program when it is clear that it is really needed. Try to avoid the temptation of adding the most trendy technologies just because you think they may be useful in the future. Add things gradually, when they are really needed.&lt;/p&gt;

&lt;h2&gt;
  
  
  Thank you for reading, and let's connect!
&lt;/h2&gt;

&lt;p&gt;Thank you for reading my blog. Feel free to subscribe to my email newsletter and connect on &lt;a href="https://www.linkedin.com/in/desmond-owusu-ansah-09274a223/"&gt;LinkedIn&lt;/a&gt; or &lt;a href="https://web.facebook.com/desmondOwusuDev"&gt;Facebook&lt;/a&gt;&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>discuss</category>
      <category>programming</category>
    </item>
    <item>
      <title>Open this link and see one of my javascript application programs.</title>
      <dc:creator>Desmond Owusu Ansah</dc:creator>
      <pubDate>Fri, 10 Dec 2021 12:33:12 +0000</pubDate>
      <link>https://dev.to/desmondowusudev/open-this-link-and-see-one-of-my-javascript-application-programs-5k</link>
      <guid>https://dev.to/desmondowusudev/open-this-link-and-see-one-of-my-javascript-application-programs-5k</guid>
      <description>&lt;p&gt;This program is a quadratic equation solver which solves quadratic equations with second degree..&lt;br&gt;
I am going to write a program for an equation with degree third.&lt;br&gt;
Please try this program and send me feedback.&lt;br&gt;
Here is the link.&lt;br&gt;
&lt;a href="https://complex-quadratic-equation-solver.netlify.app/"&gt;https://complex-quadratic-equation-solver.netlify.app/&lt;/a&gt;&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>programming</category>
    </item>
  </channel>
</rss>
