<?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: Favourite Jome</title>
    <description>The latest articles on DEV Community by Favourite Jome (@favouritejome).</description>
    <link>https://dev.to/favouritejome</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%2F389401%2F805c193b-b1aa-47bd-8fa9-ff5b503c2b9b.jpg</url>
      <title>DEV Community: Favourite Jome</title>
      <link>https://dev.to/favouritejome</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/favouritejome"/>
    <language>en</language>
    <item>
      <title>Overcoming Challenges When Moving from Create React App (CRA) to Vite: Debugging Tips</title>
      <dc:creator>Favourite Jome</dc:creator>
      <pubDate>Wed, 08 Mar 2023 18:20:50 +0000</pubDate>
      <link>https://dev.to/favouritejome/overcoming-challenges-when-moving-from-create-react-app-cra-to-vite-debugging-tips-jlk</link>
      <guid>https://dev.to/favouritejome/overcoming-challenges-when-moving-from-create-react-app-cra-to-vite-debugging-tips-jlk</guid>
      <description>&lt;p&gt;At my work, we have a reasonably large codebase using Create React App (CRA) and the codebase started feeling slow, starting up the server took forever, and hot module reload took forever to reflect changes on the browser also, so at that point, I knew I had to move to the &lt;strong&gt;Next Generation Frontend Tooling - Vite 🔥&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In this article, I'll go over the 5 challenges I encountered in migrating and updating dependencies, how I fixed them, and some Vite-specific things that just had to be done.&lt;/p&gt;

&lt;p&gt;Please note that this article is centred on the libraries which my work codebase uses, so it might not cover all possible errors, you might encounter will migrating from CRA to Vite. Some of the libraries mentioned in the article and used in the codebase are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://mui.com/"&gt;MUI&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://reactjs.org/"&gt;React&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://www.npmjs.com/package/react-phone-input-2"&gt;React-phone-input-2&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;e.t.c&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Context before Successfully Migrating to Vite
&lt;/h2&gt;

&lt;p&gt;Before I successfully migrated from CRA to Vite, I had failed in the past and given up because of the pill of errors I encountered. The way started the process of migrating was by finding articles about the migration process and following them, step by step, yet I ended up with errors the articles didn't account for.&lt;/p&gt;

&lt;p&gt;So I decided to go with the divide-and-conquer approach (without recursion 😏), by initializing a Vite project from scratch and setting up the project gradually, while adding new necessary files from the CRA codebase to the Vite codebase.&lt;/p&gt;

&lt;p&gt;Essentially, I had two branches managed by git, one for the codebase with CRA and another with Vite. The Vite branch was pulled from the CRA branch but then all the files were deleted to initialise the Vite application.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;There might have been a better way for this process, but that's what I did, and it's tedious but it works 🤧&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  Challenges and Errors I encountered
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1. The JSX syntax extension is not currently enabled
&lt;/h3&gt;

&lt;p&gt;The very first error I encountered was: &lt;strong&gt;The JSX syntax extension is not currently enabled&lt;/strong&gt; which means that if you have a file that has a React component that returns JSX, then the file extension should be &lt;strong&gt;.jsx&lt;/strong&gt; and not &lt;strong&gt;.js.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Here's how the error shows on the terminal:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--LEMczpFL--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn.hashnode.com/res/hashnode/image/upload/v1677716627119/e5722fcc-7295-4880-ae11-b4561326f618.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--LEMczpFL--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn.hashnode.com/res/hashnode/image/upload/v1677716627119/e5722fcc-7295-4880-ae11-b4561326f618.png" alt="" width="800" height="155"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;All the files in the codebase were using &lt;strong&gt;.js&lt;/strong&gt; as the file extension and now Vite was saying I have to move 50+ files to &lt;strong&gt;.jsx&lt;/strong&gt; 🤯.&lt;/p&gt;

&lt;p&gt;Evan You, the creator of Vite, gave a good reason why &lt;strong&gt;.jsx&lt;/strong&gt; extension should be used with files that return JSX. The response from Evan You was mentioned in the issue: &lt;a href="https://github.com/vitejs/vite/issues/769"&gt;Add an option to transpile .js file with esbuild Issue #769&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/vitejs/vite/issues/769#issuecomment-780593283"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--FLaojn_O--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn.hashnode.com/res/hashnode/image/upload/v1677717208376/e5fd9239-7f8f-4bbe-a6b4-65ac895ba8b2.png" alt="Evan You Response To: Add an option to transpile .js file with esbuild" width="800" height="200"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Solution
&lt;/h3&gt;

&lt;p&gt;The way I overcame this challenge was by using a tool called &lt;a href="https://learn.microsoft.com/en-us/windows/powertoys/"&gt;&lt;strong&gt;PowerToys&lt;/strong&gt;&lt;/a&gt; created by Microsoft. It comes with a feature named &lt;strong&gt;PowerRename,&lt;/strong&gt; which allowed me to rename multiple file extensions at the same time quickly. So I renamed all the file extensions from &lt;strong&gt;.js&lt;/strong&gt; to &lt;strong&gt;.jsx&lt;/strong&gt; provided the file contains some form of JSX being returned.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Visit here to learn about the feature PowerRename offers: &lt;a href="https://learn.microsoft.com/en-us/windows/powertoys/powerrename"&gt;PowerToys PowerRename utility for Windows | Microsoft Learn&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  2. Upgrading dependencies in the codebase
&lt;/h3&gt;

&lt;p&gt;Since I was already making a large change to the codebase, by migrating from CRA to Vite, I thought to myself, why not update all the dependencies to the latest and greatest version?&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Honestly, I don't know who sent me to do this, cause it ended up being a terrible experience 🤣&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;One of the dependencies that had lots of breaking changes was Material UI now called MUI. Before upgrading, Material UI v4.11.2 was used in the codebase along with some of its peer dependencies like Material Icons around similar versions.&lt;/p&gt;

&lt;p&gt;Upgrading to MUI v5 introduced a lot of changes, to where components were imported from, all the packages' import names were changed from &lt;code&gt;@material-ui/*&lt;/code&gt; to &lt;code&gt;@mui/*&lt;/code&gt; and many more changes.&lt;/p&gt;

&lt;p&gt;I mean, just look at this mess MUI put me through 😅&lt;/p&gt;

&lt;p&gt;&lt;a href="https://mui.com/material-ui/migration/migration-v4/#replace-all-imports"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--4nMtY7na--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn.hashnode.com/res/hashnode/image/upload/v1678268478242/08657db3-3571-42af-8325-a6227ccda445.png" alt="" width="800" height="340"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Other dependencies had some changes too, which I had to implement due to the upgrade, but none was as stressful as MUI, hence, I'm only mentioning MUI in this section.&lt;/p&gt;

&lt;p&gt;Another problem that came with upgrading Material UI was changes to where components are imported from. For example, the Button component in Material UI v4 is imported from &lt;code&gt;@material-ui/core/&lt;/code&gt; while MUI v5 is from &lt;code&gt;@mui/material/&lt;/code&gt;. So I had to be aware, that not only the prefix &lt;code&gt;@material-ui/&lt;/code&gt; was changed but also&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Material UI v4 example for the Button component:&lt;/em&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import Button from '@material-ui/core/Button';
// ----------------- OR -------------------- //
import { Button } from '@material-ui/core';

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

&lt;/div&gt;



&lt;p&gt;&lt;em&gt;MUI v5 example for the Button component:&lt;/em&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import Button from '@mui/material/Button';
// ----------------- OR -------------------- //
import { Button } from '@mui/material';

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

&lt;/div&gt;



&lt;p&gt;So how did I overcome the changes that MUI brought?&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;I failed to upgrade from React 17 to 18 in my work codebase because I wasn't ready for the stress, especially now that components are rendered twice and I might need to change the architecture of how useEffect is used 😏.&lt;/p&gt;

&lt;p&gt;Maybe I'll do this later in the future... 😤&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  Solution
&lt;/h3&gt;

&lt;p&gt;There was no way I could go over 500+ files that depended on Material UI and change them to the new MUI structure manually. To overcome this challenge, I relied on VS Code Search and Replace feature.&lt;/p&gt;

&lt;p&gt;From the image below, you'll see that 601 files had the word &lt;strong&gt;@material-ui/&lt;/strong&gt; , which needed to be replaced with &lt;strong&gt;@mui/&lt;/strong&gt;. Luckily for me VS Code did the replacement in a bliss.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--gwiKqWJY--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn.hashnode.com/res/hashnode/image/upload/v1678271655654/c33dc8fe-57ee-482c-a60c-9c0b1cb3a036.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--gwiKqWJY--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn.hashnode.com/res/hashnode/image/upload/v1678271655654/c33dc8fe-57ee-482c-a60c-9c0b1cb3a036.png" alt="" width="317" height="166"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Using the Search and Replace feature in VS Code, I was able to quickly make global fixes on the codebase.&lt;/p&gt;

&lt;p&gt;Reading the documentation for the dependencies I upgrade was a huge help, like documentation of MUI has a migration step, so I was aware of the breaking changes, which can be found here: &lt;a href="https://mui.com/material-ui/migration/migration-v4/#replace-all-imports"&gt;Migrating to v5: getting started - Material UI (&lt;/a&gt;&lt;a href="http://mui.com"&gt;mui.com&lt;/a&gt;&lt;a href="https://mui.com/material-ui/migration/migration-v4/#replace-all-imports"&gt;)&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Error: Minified React error
&lt;/h3&gt;

&lt;p&gt;The error &lt;strong&gt;&lt;em&gt;Minified React error&lt;/em&gt;&lt;/strong&gt; was caused by the library &lt;a href="https://www.npmjs.com/package/react-phone-input-2"&gt;&lt;code&gt;react-phone-input-2&lt;/code&gt;&lt;/a&gt; used in the codebase. This error was also one that gave me a tough time, to figure out, cause it worked fine on the development server but shows the error on production.&lt;/p&gt;

&lt;p&gt;The root of the error, explained by &lt;a href="https://github.com/sodatea"&gt;sodatea&lt;/a&gt; is that many packages follow a bad practice that breaks Rollup ESM-CJS interop.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Truthfully, I don't know enough about how Vite works with Rollup, and how libraries are made, so I'll direct you to the root of this error, explained by &lt;a href="https://github.com/sodatea"&gt;sodatea&lt;/a&gt; here &lt;a href="https://github.com/vitejs/vite/issues/2139#issuecomment-1024852072"&gt;https://github.com/vitejs/vite/issues/2139#issuecomment-1024852072&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;a href="https://github.com/vitejs/vite/issues/2139#issuecomment-1024852072"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--h1BUzmI6--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn.hashnode.com/res/hashnode/image/upload/v1678278432335/e09f0f19-d6ae-41ad-80ea-a692465b102c.png" alt="" width="800" height="341"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Fortunately, the discussion about the problem on the Vite repository led me to discover a solution.&lt;/p&gt;

&lt;h3&gt;
  
  
  Solution
&lt;/h3&gt;

&lt;p&gt;Before I mention the solution, here's the issue raised for the error on the Vite repository: &lt;a href="https://github.com/vitejs/vite/issues/2139"&gt;Encountered Minified React error in the production environment&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It has 71 participants contributing to the discussion and still the issue isn't closed, so it seems there are still some libraries that may cause the error.&lt;/p&gt;

&lt;p&gt;The solution to this problem was to check if the imported component has the property &lt;code&gt;default&lt;/code&gt; if it has the property &lt;code&gt;default&lt;/code&gt;, then the default component should be used otherwise the component should be used.&lt;/p&gt;

&lt;p&gt;Here's a snippet to check for default components in the &lt;code&gt;react-phone-input-2&lt;/code&gt; library and the solution to my problem.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import RPI from "react-phone-input-2"; 

const ReactPhoneInput = RPI.default ? RPI.default : RPI;

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

&lt;/div&gt;



&lt;p&gt;Thanks to &lt;a href="https://github.com/Kylar13"&gt;Kylar13&lt;/a&gt; for his comment, I was able to detect that it was the &lt;code&gt;react-phone-input-2&lt;/code&gt; library that was giving me the error, but then from the issue discussions, I could have other libraries installed that could have the same problem.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/vitejs/vite/issues/2139#issuecomment-1133130323"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--h7Ky26e5--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn.hashnode.com/res/hashnode/image/upload/v1678279616052/72ea048d-753d-423c-ac5a-afe9866b3dac.png" alt="" width="800" height="276"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So I needed a permanent fix, luckily after going through the 80+ comments on the issue I found a permanent fix posted by &lt;a href="https://github.com/Boni0"&gt;Boni0&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Here's the full discussion by Boni0: &lt;a href="https://github.com/vitejs/vite/issues/2139#issuecomment-1399098579"&gt;https://github.com/vitejs/vite/issues/2139#issuecomment-1399098579&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/vitejs/vite/issues/2139#issuecomment-1399098579"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--VJVR8rEc--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn.hashnode.com/res/hashnode/image/upload/v1678280270865/84d04281-b70a-4f0e-8f94-b20e542bb57d.png" alt="" width="800" height="652"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;But here's the solution I ended up using in my codebase, which works fine now.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/vitejs/vite/issues/2139#issuecomment-1405624744"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--uoC-95mC--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn.hashnode.com/res/hashnode/image/upload/v1678280450807/0233c2b8-385f-4710-87be-726a5b4f66dd.png" alt="" width="800" height="539"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  4. Uncaught ReferenceError: makeStyles_default is not defined
&lt;/h3&gt;

&lt;p&gt;This is one of that errors that can make one cry and regret migrating to Vite 😅. Why do I say this? (&lt;em&gt;assume you heard me ask the question 😄&lt;/em&gt;) Because the error is unpredictable and comes and goes while blocking you from doing anything in development. Also, the error comes in different forms, it could be &lt;code&gt;Uncaught ReferenceError: Box_default is not defined&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;I guess the issue is with MUI, not working properly with ESM or something like that, though I found a solution that works, I can't say the root of the problem.&lt;/p&gt;

&lt;h3&gt;
  
  
  Solution
&lt;/h3&gt;

&lt;p&gt;Remember I mentioned the error is unpredictable, so take this solution with a grain of salt, cause I don't know why the issue comes up.&lt;/p&gt;

&lt;p&gt;From the issue - &lt;a href="https://github.com/vitejs/vite/issues/1853"&gt;Exported variable in chunk is not defined Issue #1853&lt;/a&gt;, I found out it's better to use &lt;a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import#named_import"&gt;named import&lt;/a&gt; while importing components from MUI.&lt;/p&gt;

&lt;p&gt;So use this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import { Box } from '@mui/material';

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

&lt;/div&gt;



&lt;p&gt;Instead of:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import Box from '@mui/material/Box';

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

&lt;/div&gt;



&lt;p&gt;Also, from the issue, it was mentioned to add &lt;code&gt;esm&lt;/code&gt; as the suffix to the package MUI.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/vitejs/vite/issues/1853#issuecomment-793026832"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Yopl_afe--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn.hashnode.com/res/hashnode/image/upload/v1678284575117/3bbf10ad-34b9-4aa5-90e5-b9fc118747f1.png" alt="" width="800" height="452"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So I did this on my end, in the &lt;code&gt;vite.config.js&lt;/code&gt; file:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--GeNSs14e--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn.hashnode.com/res/hashnode/image/upload/v1678285108690/25e73dff-9b5e-43b1-a3ae-e326780d00f2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--GeNSs14e--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn.hashnode.com/res/hashnode/image/upload/v1678285108690/25e73dff-9b5e-43b1-a3ae-e326780d00f2.png" alt="" width="477" height="121"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  5. Uncaught TypeError: styled_default is not a function
&lt;/h3&gt;

&lt;p&gt;This error is also one that's unpredictable and is caused by MUI. I've encountered this error more than once, and I haven't found a permanent fix for it, I just hope I wouldn't see it again.&lt;/p&gt;

&lt;p&gt;The error doesn't allow me to make changes on development, so all I saw on the browser is a blank white screen, hence I had to fix it.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--YpF7dLe1--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn.hashnode.com/res/hashnode/image/upload/v1678285227445/52000ce9-d03b-40f5-960d-0a0014f062c4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--YpF7dLe1--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn.hashnode.com/res/hashnode/image/upload/v1678285227445/52000ce9-d03b-40f5-960d-0a0014f062c4.png" alt="" width="393" height="62"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;At the point of writing this article, I still got this error and here's a comment I made on the issue - &lt;a href="https://github.com/mui/material-ui/issues/32727"&gt;Popper.js:9 Uncaught TypeError: styled_default is not a function&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/mui/material-ui/issues/32727#issuecomment-1447936047"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--c9It9zZO--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn.hashnode.com/res/hashnode/image/upload/v1678285829860/1be4618f-b1e1-46cd-ba72-06dde7f41ab2.png" alt="" width="800" height="308"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Proposed Solution
&lt;/h3&gt;

&lt;p&gt;From the issue mentioned above, the solution which works most time is to delete the &lt;code&gt;node_modules&lt;/code&gt; folder and reinstall all your dependencies.&lt;/p&gt;

&lt;p&gt;Another solution that worked for someone is to use &lt;code&gt;@vitejs/plugin-react-swc&lt;/code&gt; instead of &lt;code&gt;@vitejs/plugin-react&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;I have tried all the proposed solutions on the issue - &lt;a href="https://github.com/mui/material-ui/issues/32727"&gt;Popper.js:9 Uncaught TypeError: styled_default is not a function&lt;/a&gt;, must times it works, while sometimes it doesn't. I'll leave it at that, though currently, I don't get the error.&lt;/p&gt;

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

&lt;p&gt;Do I regret migrating from Create-React-App to Vite? No, maybe a little, Yes, cause I have to go through lots of issues to figure things out.&lt;/p&gt;

&lt;p&gt;Was there an improvement in server startup time, installing dependencies, and production build? Yessss, Vite is so fast. Blazingly fast 🔥.&lt;/p&gt;




&lt;p&gt;So I cloned the legacy codebase, the one using Create-React-App, installed the dependencies and started the server. It took &lt;strong&gt;5 min, and 34 sec&lt;/strong&gt; for the server to startup and reflect on the browser 😫.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Y6sRVPce--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn.hashnode.com/res/hashnode/image/upload/v1678290350144/ad5534ba-866d-463a-bd09-824184ffc607.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Y6sRVPce--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn.hashnode.com/res/hashnode/image/upload/v1678290350144/ad5534ba-866d-463a-bd09-824184ffc607.png" alt="" width="800" height="427"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The above test was done when I was starting the server for the first time, the second time I started the server, it took &lt;strong&gt;1 min and 33 secs&lt;/strong&gt; which is fairly okay I guess. But Vite took &lt;strong&gt;35 secs&lt;/strong&gt; for the browser to show the webpage fully loaded though it wasn't the first time I had started the server.&lt;/p&gt;




&lt;p&gt;Would I ever use MUI for any reason in the future? Definitely, NO. If not that it would be a tug of war to remove MUI from my work codebase, I would have removed it.&lt;/p&gt;

&lt;p&gt;With all of this, I leave with this, if you're migrating from CRA to Vite, and you're using MUI in your codebase, just know you're in for soup 🤣.&lt;/p&gt;

&lt;p&gt;If you found this article helpful in a way, do like, share and follow me for more articles. Also, if you have a simpler approach or solution to solve the issues I mentioned in the article, please drop them in the comment, I'll love to see them.&lt;/p&gt;

&lt;p&gt;I'll make sure to keep this article updated if I encounter more errors or bugs due to the migration.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Thanks for reading!&lt;/strong&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>4 Features in VSCode I use to speed up my Workflow</title>
      <dc:creator>Favourite Jome</dc:creator>
      <pubDate>Sat, 18 Feb 2023 05:32:46 +0000</pubDate>
      <link>https://dev.to/favouritejome/4-features-in-vscode-i-use-to-speed-up-my-workflow-3km9</link>
      <guid>https://dev.to/favouritejome/4-features-in-vscode-i-use-to-speed-up-my-workflow-3km9</guid>
      <description>&lt;p&gt;Visual Studio Code (VS Code) is my favourite code editor, even though I haven't tried all the possible code editors out there, I can say VS Code is my best 😊. In this article, we'll go over 4 features this great editor has, which make it just right, to speed up productivity and a lifesaver at best.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Searching Capabilities
&lt;/h2&gt;

&lt;p&gt;The search feature is just amazing in VS Code and there are several modes of searching too, we could search for files, symbols (which means variable names, function names and so on), references, etc. but let's go over the 3 search features I mostly make use of.&lt;/p&gt;

&lt;h3&gt;
  
  
  1a) Command Palette (Ctrl+Shift+P)
&lt;/h3&gt;

&lt;p&gt;The Command Palette allows you to have all the functionalities of VS Code in one place. Functionalities such as all GIT commands (like push, pull, etc.), reloading the window, and so on can be accessed from the command palette, but that's not all.&lt;/p&gt;

&lt;p&gt;The command palette gives room for many commands, but let's go over just one, which allows us to navigate the various files in the codebase, by their file names or symbols. To work with the navigating feature, the command is &lt;strong&gt;Ctrl + P&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;And when the command &lt;strong&gt;Ctrl + P&lt;/strong&gt; is typed, the interface appears like the image below, and of course, shows your files in your codebase, allowing you to jump through files quickly.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--GijOrplc--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn.hashnode.com/res/hashnode/image/upload/v1676547997772/9b916ca3-bfdd-49d8-9a02-7e37cea3f54f.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--GijOrplc--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn.hashnode.com/res/hashnode/image/upload/v1676547997772/9b916ca3-bfdd-49d8-9a02-7e37cea3f54f.png" alt="" width="631" height="444"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Bonus trick, you could press the command &lt;strong&gt;Ctrl + P&lt;/strong&gt; multiple times, to navigate down through the files showing on the command palette. In the case of the image above, if &lt;strong&gt;Ctrl + P&lt;/strong&gt; is typed again, the file &lt;strong&gt;ChartTiles.jsx&lt;/strong&gt; will be selected. Then to up the files, you can make use of &lt;strong&gt;Ctrl + Shift + P&lt;/strong&gt; provided, you were on the navigating palette.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;To view all other amazing commands you have access to using the command palette, please visit &lt;a href="https://code.visualstudio.com/docs/getstarted/userinterface#_command-palette"&gt;Visual Studio Code User Interface&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  1b) Search on Activity Bar (Ctrl + Shift + F)
&lt;/h3&gt;

&lt;p&gt;The Search on the Activity Bar is pretty powerful, as well, it allows you to search and replace words across the codebase. So if you're looking for every occurrence of some symbol or string for example &lt;em&gt;"@mui/material"&lt;/em&gt; in the codebase, you could just search for it.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--chC6H8dN--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn.hashnode.com/res/hashnode/image/upload/v1676549770929/93027328-d0ef-4088-a662-0ca73b1f3484.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--chC6H8dN--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn.hashnode.com/res/hashnode/image/upload/v1676549770929/93027328-d0ef-4088-a662-0ca73b1f3484.png" alt="" width="370" height="515"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This search feature is even more powerful especially when you want to find something really specific, like every occurrence of the symbol or variable name for example &lt;code&gt;getNames&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;From the image below, you can see the word &lt;strong&gt;GETNAME&lt;/strong&gt; is searched and it's capitalised, yet the result isn't case-sensitive.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--QLZXwFbO--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn.hashnode.com/res/hashnode/image/upload/v1676550331653/953d546e-85d5-41be-ba1c-db0471123a73.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--QLZXwFbO--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn.hashnode.com/res/hashnode/image/upload/v1676550331653/953d546e-85d5-41be-ba1c-db0471123a73.png" alt="" width="323" height="267"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To make it case-sensitive or in any other case, search accurately to what is actually being searched for, that's where the three options provided come into play, which are &lt;strong&gt;Match Case (Alt + C), Match Whole Word (Alt + W), Use Regular Expression (Alt + R)&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;From the example above, we care about the case, so we can select &lt;strong&gt;Match Case (Alt + C)&lt;/strong&gt; to be precise.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--l8tIt8bf--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn.hashnode.com/res/hashnode/image/upload/v1676550655518/48dd1572-83ba-4a5d-9405-33ab5ad24940.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--l8tIt8bf--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn.hashnode.com/res/hashnode/image/upload/v1676550655518/48dd1572-83ba-4a5d-9405-33ab5ad24940.png" alt="" width="315" height="220"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;If by chance, you don't what's the Activity Bar, please visit here: &lt;a href="https://code.visualstudio.com/api/ux-guidelines/activity-bar"&gt;Activity Bar | Visual Studio Code Extension API&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  1c) Search by Reference (Shift + F12)
&lt;/h3&gt;

&lt;p&gt;The search by reference or as named in VS Code, &lt;strong&gt;Go to Reference&lt;/strong&gt; comes in handy when you want to quickly just see all occurrences of symbols or words across your codebase or the current file opened.&lt;/p&gt;

&lt;p&gt;For example, let's say you've made use of the &lt;code&gt;useState&lt;/code&gt; hook from React, in multiple places in a file and you, want to jump over to every reference of the hook in your file. While the hook, &lt;code&gt;useState&lt;/code&gt; is selected, you could either right-click on the word and select &lt;strong&gt;Go to Reference&lt;/strong&gt; or use the shortcut &lt;strong&gt;Shift + F12&lt;/strong&gt;. Doing so you get something similar to the image below:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--R3Khp-QQ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn.hashnode.com/res/hashnode/image/upload/v1676553993447/7a912ad3-d421-4b20-8795-4064c8d6800d.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--R3Khp-QQ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn.hashnode.com/res/hashnode/image/upload/v1676553993447/7a912ad3-d421-4b20-8795-4064c8d6800d.png" alt="" width="800" height="282"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The file currently opened is named &lt;code&gt;IncomeModal.jsx&lt;/code&gt; so that is why it shows on the left-hand side of the pop-up, but take note of the other file there, the &lt;code&gt;index.d.ts&lt;/code&gt; file which is in the &lt;code&gt;node_modules&lt;/code&gt; directory. The &lt;code&gt;index.d.ts&lt;/code&gt; file shows because the &lt;code&gt;useState&lt;/code&gt; hook is coming from the definition in the &lt;code&gt;index.d.ts&lt;/code&gt; file.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Quick note, in my use case, I don't care about the &lt;code&gt;index.d.ts&lt;/code&gt; file and I don't know how it really works😅 but I think there's a reference to the &lt;code&gt;index.d.ts&lt;/code&gt; file. All I care about is jumping around where I have the &lt;code&gt;useState&lt;/code&gt; hook in my current file.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Now, there's another cool feature with the Search by Reference worth mentioning that brings the power of reference. Let's go over another use case.&lt;/p&gt;

&lt;p&gt;For example, let's say you've made a custom hook in React or you're using some library that has its custom hook and you want to search for every reference to the custom hook. Then again, using the shortcut &lt;strong&gt;Shift + F12&lt;/strong&gt; you can see every reference of the hook and in most cases, if used in multiple files you'll see that too.&lt;/p&gt;

&lt;p&gt;From the image, below, I made a search by reference for the &lt;code&gt;useTranslation&lt;/code&gt; hook, and it's being referenced in &lt;strong&gt;213&lt;/strong&gt; files.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--58vAnc_n--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn.hashnode.com/res/hashnode/image/upload/v1676555038582/14235cc0-5f7e-4899-8ae3-7ace6504ac99.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--58vAnc_n--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn.hashnode.com/res/hashnode/image/upload/v1676555038582/14235cc0-5f7e-4899-8ae3-7ace6504ac99.png" alt="" width="800" height="281"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The Search by Reference feature is kinda similar to the Search on the Activity bar, but then they are very different, so you can choose which to use.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. &lt;a href="https://code.visualstudio.com/docs/editor/editingevolved#_rename-symbol"&gt;Rename Symbols (F2)&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;Rename Symbols is just mind-blowing 🤯 (I might be overemphasising but it's a cool feature). This feature allows you to rename a symbol (again which could be a file name, function name, variable name, etc) across multiple files. So you can rename a variable name and be certain that all references to that variable name will be changed as well.&lt;/p&gt;

&lt;p&gt;For example, on a file, let's rename the state name of the &lt;code&gt;useState&lt;/code&gt; hook to something else. In the image below, I'm renaming the state &lt;code&gt;revenueDate&lt;/code&gt; to &lt;code&gt;revenueDatee&lt;/code&gt;, now everywhere where &lt;code&gt;revenueDate&lt;/code&gt; was used will be changed to &lt;code&gt;revenueDatee&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--fge2tqwj--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn.hashnode.com/res/hashnode/image/upload/v1676557539889/4dec1f6d-8940-4b23-92f8-3d62f222d178.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--fge2tqwj--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn.hashnode.com/res/hashnode/image/upload/v1676557539889/4dec1f6d-8940-4b23-92f8-3d62f222d178.png" alt="" width="520" height="75"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Quick note, to see all the occurrences of the state changing, type &lt;strong&gt;Shift + Enter&lt;/strong&gt; , which opens the Refactor Preview and shows what would be removed and replaced. If you're happy with it, click Apply else Discard.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ld3Kh3Sa--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn.hashnode.com/res/hashnode/image/upload/v1676557908659/98d24fa8-6636-43e9-bd9d-a383ea7dce62.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ld3Kh3Sa--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn.hashnode.com/res/hashnode/image/upload/v1676557908659/98d24fa8-6636-43e9-bd9d-a383ea7dce62.png" alt="" width="691" height="360"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  3. &lt;a href="https://code.visualstudio.com/docs/sourcecontrol/overview"&gt;Source Control with Git (Ctrl + Shift + G)&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;The Souce Control in VS Code allows the ease of just clicking on some buttons and all your GIT operations will be done for you without writing a single command. The Souce Control view can be accessed on the Activity bar, or with the shortcut &lt;strong&gt;Ctrl + Shift + G&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--0n17beqp--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn.hashnode.com/res/hashnode/image/upload/v1676674590849/b3f726a2-17e7-4c18-992d-6439de486953.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--0n17beqp--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://cdn.hashnode.com/res/hashnode/image/upload/v1676674590849/b3f726a2-17e7-4c18-992d-6439de486953.png" alt="" width="317" height="258"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I wrote an article about source control in VS Code: &lt;a href="https://favouritejome.hashnode.dev/vs-code-version-control-understanding-the-basics-of-git-operations-1"&gt;&lt;strong&gt;VS Code Version Control: Understanding the basics of Git operations # 1&lt;/strong&gt;&lt;/a&gt; &lt;strong&gt;,&lt;/strong&gt; you can read it to know how it works.&lt;/p&gt;

&lt;p&gt;Also, please the VS Code docs are extremely helpful, here's all the &lt;a href="https://code.visualstudio.com/docs/sourcecontrol/overview"&gt;Source Control with Git in Visual Studio Code&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. &lt;a href="https://code.visualstudio.com/docs/editor/codebasics#_multiple-selections-multicursor"&gt;Multiple selections&lt;/a&gt; &lt;a href="https://code.visualstudio.com/docs/editor/codebasics#_multiple-selections-multicursor"&gt;(multi-cursor)&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;Multiple selection is a feature that allows you to place your cursor in multiple locations on a file, and then give room for editing where the cursor has been placed. The most common way of using this feature is when you have similar text all around a file, and you'll like to change the text to something else.&lt;/p&gt;

&lt;p&gt;Looking at the image below, you'll see the text &lt;strong&gt;200&lt;/strong&gt; is changed to &lt;strong&gt;120&lt;/strong&gt; at the same time.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--9GlDAIlw--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_800/https://code.visualstudio.com/assets/docs/editor/codebasics/multicursor.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--9GlDAIlw--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_800/https://code.visualstudio.com/assets/docs/editor/codebasics/multicursor.gif" alt="Multi-cursor" width="447" height="182"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;The above image is from&lt;/em&gt; &lt;a href="https://code.visualstudio.com/docs/editor/codebasics#_multiple-selections-multicursor"&gt;VS Code docs&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;There are different commands in VS Code that'll aid you to make sure of the Multiple selection feature, but the most common command, at least the one I use often is &lt;strong&gt;Ctrl + D&lt;/strong&gt; , which selects the next occurrence of some text or symbol selected, and adds multiple cursors.&lt;/p&gt;

&lt;p&gt;There are other commands that could multi-select in a different scenario, mostly when the texts aren't similar, but please go through the &lt;a href="https://code.visualstudio.com/docs/editor/codebasics#_multiple-selections-multicursor"&gt;docs&lt;/a&gt; to find out more.&lt;/p&gt;

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

&lt;p&gt;There are several other features in VS Code not covered in this article and it will be an endless article if we were to go over all of them. So, I'll advise you to go through &lt;a href="https://code.visualstudio.com/docs"&gt;VS Code documentation&lt;/a&gt; more frequently or at least subscribe to their &lt;a href="https://www.youtube.com/@code"&gt;YouTube Channel&lt;/a&gt;, their shorts are very helpful.&lt;/p&gt;

&lt;p&gt;Hopefully, you've learnt a new feature in VS Code, and if you already make use of all these features, you're a PRO 😅. By the way, if you know of any feature that helps you a lot while coding, please drop it in the comments.&lt;/p&gt;

&lt;p&gt;Thanks for reading and see you in the next article!&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Let's build a Calculator App (React Native)</title>
      <dc:creator>Favourite Jome</dc:creator>
      <pubDate>Thu, 19 Jan 2023 00:42:22 +0000</pubDate>
      <link>https://dev.to/favouritejome/lets-build-a-calculator-app-react-native-2l94</link>
      <guid>https://dev.to/favouritejome/lets-build-a-calculator-app-react-native-2l94</guid>
      <description>&lt;p&gt;Welcome back to the &lt;a href="https://favouritejome.hashnode.dev/series/lets-build-something-cool" rel="noopener noreferrer"&gt;Let's build Something Cool&lt;/a&gt; series, where we build cool things, at least from my perspective 😊, but really it's a series where we go in-depth about the cool things I build, but then we get to build it together.&lt;/p&gt;

&lt;p&gt;In this article, we'll build a Calculator application similar to Samsung's calculator app, and use &lt;a href="https://expo.dev/" rel="noopener noreferrer"&gt;Expo&lt;/a&gt;, a framework that allows us to get started with React Native applications quickly.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;There are a bunch of requirements we'll need before building in the Calculator application, but if you'll like to skip the requirements section cause you're familiar with React Native and Expo, click here to do so.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Prerequisite
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Basic knowledge of React&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Basic knowledge of React Native&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Requirements
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Install Node
&lt;/h3&gt;

&lt;p&gt;Node is pretty much essential, so visit &lt;a href="https://nodejs.org/en/" rel="noopener noreferrer"&gt;Nodejs.org&lt;/a&gt; and download the Long Term Support (LTS) version of Nodejs.&lt;/p&gt;

&lt;p&gt;Once you're done downloading and installing Node.js, run the command below to know if it's up and running on your machine.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;node -v

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

&lt;/div&gt;



&lt;h3&gt;
  
  
  &lt;strong&gt;Install Expo&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;There are two tools we'll need to set up Expo, first is the &lt;a href="https://docs.expo.dev/get-started/installation/#expo-cli" rel="noopener noreferrer"&gt;Expo CLI&lt;/a&gt; which serves the project, and second is the client app called &lt;a href="https://docs.expo.dev/get-started/installation/#expo-go-app-for-android-and-ios" rel="noopener noreferrer"&gt;Expo GO&lt;/a&gt; which allows us to view the project on either an Andriod or IOS device.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Install Expo CLI&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm install -g expo-cli

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

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Install Expo Go&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://play.google.com/store/apps/details?id=host.exp.exponent" rel="noopener noreferrer"&gt;Android Play Store&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://apps.apple.com/app/expo-go/id982107779" rel="noopener noreferrer"&gt;iOS App Store&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;Further guides for the &lt;a href="https://docs.expo.dev/get-started/installation/" rel="noopener noreferrer"&gt;Expo installation can be found here.&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

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

&lt;p&gt;Firstly we'll need to install the necessary dependencies to get building, and the first would be Expo.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npx create-expo-app calculator-app &amp;amp;&amp;amp; cd calculator-app

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

&lt;/div&gt;



&lt;p&gt;Once the installation process is completed and we've changed our directory to &lt;code&gt;calculator-app&lt;/code&gt;, let's start our app, making sure it works.&lt;/p&gt;

&lt;h3&gt;
  
  
  Run the Project
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm start

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

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;yarn start&lt;/code&gt; would also work if you have yarn installed.&lt;/p&gt;

&lt;p&gt;On the terminal, you'll see a QR code, which we'll need to scan with the &lt;a href="https://play.google.com/store/apps/details?id=host.exp.exponent" rel="noopener noreferrer"&gt;Expo Go app&lt;/a&gt;, which I guess you've downloaded from Play Store already.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;But if you've not got the Expo app yet, &lt;a href="https://play.google.com/store/apps/details?id=host.exp.exponent" rel="noopener noreferrer"&gt;download it here for Android&lt;/a&gt; and here for &lt;a href="https://apps.apple.com/app/expo-go/id982107779" rel="noopener noreferrer"&gt;iOS&lt;/a&gt; to follow along with the article.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;To work with the Expo Go app and our project on our computers, we would need to be connected to the same network; this is very important.&lt;/p&gt;

&lt;p&gt;The terminal interface should look like this when the &lt;code&gt;start&lt;/code&gt; command is run:&lt;/p&gt;

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

&lt;p&gt;Now, we need to open the Expo Go app on our mobile devices, scan the QR code, and we should see this interface on our phones.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpunqqsb4xumgrhw6wpe4.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpunqqsb4xumgrhw6wpe4.jpeg" width="231" height="500"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Folder Structure
&lt;/h3&gt;

&lt;p&gt;Let's go over what the folder structure entails:&lt;/p&gt;

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

&lt;blockquote&gt;
&lt;p&gt;Note: As of the Expo version &lt;code&gt;47.0.12&lt;/code&gt;, this is how the folder structure is&lt;/p&gt;
&lt;/blockquote&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;/.expo - this folder got created when we started the application and contains devices.json and README.md files. Please go through the README file to know what this folder is about, but really we can ignore it.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;/assets - this is where we store any assets we may want to use in our application, like images, videos, fonts and icons&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;/node_modules - these are all the packages we have installed that allow Expo and React Native to run. Further packages installed with &lt;code&gt;npm install&lt;/code&gt; get added here.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;.gitignore - this is a file to tell .git which files and directories we want to omit from source control (Git). node_modules and .expo directories are omitted by default.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;App.js - the main entry point to our application. This is where you'll start adding code!&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;app.json - another config file that contains expo metadata&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;babel.config.js - babel config, used to add the expo preset&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;package.json - this is where you list dependencies and add scripts&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;package-lock.json - this file shows the map of all the dependencies installed&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Breakdown of the Calculator Layout
&lt;/h3&gt;

&lt;p&gt;The calculator app UI can be broken down into four main components we'll need to build; first, an input box where the calculations would be done, referred to as the &lt;strong&gt;Calculation Input&lt;/strong&gt; from the image below.&lt;/p&gt;

&lt;p&gt;Then we have the &lt;strong&gt;Preview Calculation&lt;/strong&gt; component, which shows a preview of the answer when a valid operation occurs; next, we have &lt;strong&gt;Rows&lt;/strong&gt; of &lt;strong&gt;Buttons&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frv8qy0p4y18oznft358z.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frv8qy0p4y18oznft358z.jpeg" alt="Samsung Calculator app" width="437" height="900"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;I'm sorry for the poor image quality, I'll look for better ways to edit images next time 😅&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  Coding Time
&lt;/h3&gt;

&lt;p&gt;Let's open the &lt;code&gt;App.js&lt;/code&gt; file, we should have the snippet of code below or similar in the file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import { StatusBar } from 'expo-status-bar';
import { StyleSheet, Text, View } from 'react-native';

export default function App() {
  return (
    &amp;lt;View style={styles.container}&amp;gt;
      &amp;lt;Text&amp;gt;Open up App.js to start working on your app!&amp;lt;/Text&amp;gt;
      &amp;lt;StatusBar style="auto" /&amp;gt;
    &amp;lt;/View&amp;gt;
  );
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
    backgroundColor: '#fff',
    alignItems: 'center',
    justifyContent: 'center',
  },
});

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

&lt;/div&gt;



&lt;p&gt;We'll need to create the Calculation Input first, so remove the &lt;code&gt;&amp;lt;Text&amp;gt;&lt;/code&gt; component and replace it with an &lt;code&gt;&amp;lt;TextInput /&amp;gt;&lt;/code&gt; component.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import { StatusBar } from 'expo-status-bar';
import { StyleSheet, Text, View } from 'react-native';

export default function App() {
  return (
    &amp;lt;View style={styles.container}&amp;gt;
      &amp;lt;TextInput value="Here's were we type our calculation!" /&amp;gt;
      &amp;lt;StatusBar style="auto" /&amp;gt;
    &amp;lt;/View&amp;gt;
  );
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
    backgroundColor: '#fff',
    alignItems: 'center',
    justifyContent: 'center',
  },
});

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

&lt;/div&gt;



&lt;p&gt;Here's what we should have on the Expo Go app on our devices.&lt;/p&gt;

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

&lt;p&gt;Notice the input is at the centre of the screen; let's fix that and add some colours.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import { StatusBar } from "expo-status-bar";
import { StyleSheet, Text, TextInput, View } from "react-native";

export default function App() {
  return (
    &amp;lt;View style={styles.container}&amp;gt;
      &amp;lt;TextInput
        style={styles.input}
        value="Here's were we type our calculation!"
      /&amp;gt;
      &amp;lt;StatusBar style='auto' /&amp;gt;
    &amp;lt;/View&amp;gt;
  );
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
    backgroundColor: "#010101",
    paddingVertical: 30,
    paddingHorizontal: 20,
  },
  input: {
    marginTop: 40,
    borderWidth: 1,
    padding: 10,
    color: "#fff",
    fontSize: 36,
  },
});

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

&lt;/div&gt;



&lt;p&gt;Now the UI should look like this, which is much better.&lt;/p&gt;

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

&lt;p&gt;Let's add state to the &lt;code&gt;&amp;lt;TextInput /&amp;gt;&lt;/code&gt; to keep track of the calculating number and operators entered.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;...
export default function App() {
  const [calValue, setCalValue] = useState("");
  return (
    &amp;lt;View style={styles.container}&amp;gt;
      &amp;lt;TextInput
        style={styles.input}
        value={calValue}
        onChangeText={setCalValue}
        cursorColor='#8ad8d1'
        autoFocus={true}
        textAlign='right'
        showSoftInputOnFocus={false}
      /&amp;gt;
      &amp;lt;StatusBar style='auto' /&amp;gt;
    &amp;lt;/View&amp;gt;
  );
}
...

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

&lt;/div&gt;



&lt;p&gt;The Calculation Input is all set, but notice the &lt;code&gt;showSoftInputOnFocus={false}&lt;/code&gt; prop on the &lt;code&gt;&amp;lt;TextInput /&amp;gt;&lt;/code&gt; component. The prop is added to make sure the phone keyboard doesn't show when the input is on focus cause we don't need the phone's keyboard; we'll create ours.&lt;/p&gt;

&lt;p&gt;Let's move to the Preview Calculation Input, which follows the same pattern we did for the calculation input.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import { StatusBar } from "expo-status-bar";
import { useState } from "react";
import { StyleSheet, Text, TextInput, View } from "react-native";

export default function App() {
  const [calValue, setCalValue] = useState("");
  const [previewValue, setPreviewValue] = useState("");

  return (
    &amp;lt;View style={styles.container}&amp;gt;
      &amp;lt;TextInput
        style={styles.input}
        value={calValue}
        onChangeText={setCalValue}
        cursorColor='#8ad8d1'
        autoFocus={true}
        textAlign='right'
        showSoftInputOnFocus={false}
      /&amp;gt;
      &amp;lt;TextInput
        value={previewValue}
        onChangeText={setPreviewValue}
        cursorColor='#8ad8d1'
        textAlign='right'
        caretHidden={true}
        style={[styles.input, styles.prevInput]}
        showSoftInputOnFocus={false}
      /&amp;gt;
      &amp;lt;StatusBar style='auto' /&amp;gt;
    &amp;lt;/View&amp;gt;
  );
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
    backgroundColor: "#010101",
    paddingVertical: 30,
    paddingHorizontal: 20,
  },
  input: {
    marginTop: 40,
    borderWidth: 1,
    padding: 10,
    color: "#fff",
    fontSize: 36,
  },
  prevInput: {
    fontSize: 24,
    marginTop: 40,
    marginBottom: 30,
    color: "#616161",
  },
});

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

&lt;/div&gt;



&lt;p&gt;Next, let's move the backspace button; for this, we'll need to install a package &lt;code&gt;@expo/vector-icons&lt;/code&gt; which comes with the icon we need. Run the command below:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm install @expo/vector-icons

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

&lt;/div&gt;



&lt;p&gt;Once it's installed, we'll need to add the backspace icon to the code and its functionality.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;...
import { Pressable, StyleSheet, Text, TextInput, View } from "react-native";

export default function App() {
  const [calValue, setCalValue] = useState("");
  const [previewValue, setPreviewValue] = useState("");

  const handleBackSpace = () =&amp;gt; {
    const remainValue = calValue.slice(0, calValue.length - 1);
    setCalValue(() =&amp;gt; remainValue);
  };

  return (
    &amp;lt;View style={styles.container}&amp;gt;
      &amp;lt;TextInput
        style={styles.input} ...
      /&amp;gt;
      &amp;lt;TextInput
        value={previewValue} ...
      /&amp;gt;

      &amp;lt;View style={styles.backButton}&amp;gt;
        &amp;lt;Pressable
          onPress={() =&amp;gt; handleBackSpace()}
          disabled={calValue ? false : true}
        &amp;gt;
          &amp;lt;Ionicons
            name='md-backspace-outline'
            size={24}
            color={calValue ? "green" : "#035903"}
          /&amp;gt;
        &amp;lt;/Pressable&amp;gt;
      &amp;lt;/View&amp;gt;

      &amp;lt;View
        style={{
          height: 1,
          backgroundColor: "#575757",
          marginVertical: 20,
        }}
      /&amp;gt;
      &amp;lt;StatusBar style='auto' /&amp;gt;
    &amp;lt;/View&amp;gt;
  );
}

const styles = StyleSheet.create({
  container: {...},
  input: {...},
  prevInput: {...},
  backButton: {
    flexDirection: "row",
    justifyContent: "flex-end",
  },
});

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

&lt;/div&gt;



&lt;p&gt;Notice from the snippet above the &lt;code&gt;Pressable&lt;/code&gt; component is used to indicate the icon would be clicked and has two props, &lt;code&gt;onPress&lt;/code&gt; which listens to the pressing of the icon, which then calls the &lt;code&gt;handleBackSpace&lt;/code&gt; function, and the second prop is &lt;code&gt;disabled&lt;/code&gt; , which makes the icons not pressable when there's no value in the Calculation input.&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;handleBackSpace()&lt;/code&gt; function removes the last value in the &lt;code&gt;calValue&lt;/code&gt; state and then update the &lt;code&gt;calValue&lt;/code&gt; state.&lt;/p&gt;

&lt;p&gt;The self-closing &lt;code&gt;View&lt;/code&gt; component is to indicate a line in the UI. Now the UI should look like this:&lt;/p&gt;

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

&lt;p&gt;From the UI, we know we need a row of buttons, so let's create a component named &lt;code&gt;Row&lt;/code&gt; but still, in this &lt;code&gt;App.js&lt;/code&gt; file cause, it isn't a complicated component.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;...
export default function App() {
...
}

function Row({ children }) {
  return &amp;lt;View style={styles.row}&amp;gt;{children}&amp;lt;/View&amp;gt;;
}

const styles = StyleSheet.create({
  ...
  row: {
    flex: 1,
    flexDirection: "row",
    justifyContent: "space-between",
  },
});

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

&lt;/div&gt;



&lt;p&gt;That's all for the &lt;code&gt;Row&lt;/code&gt; component; it basically composes several button components, which we'll be working on next.&lt;/p&gt;

&lt;p&gt;Let's create a new component named &lt;code&gt;Button.js&lt;/code&gt; in a components directory from the root directory, that is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;|-components
| -- Button.js
App.js


// Button.js

import { TouchableHighlight, Text, StyleSheet } from "react-native";
import React from "react";

export default function Button({ label, type, handlePress, icon }) {
  const getTextColor =
    type === "operator" ? "green" : type === "clear" ? "red" : "#fff";

  const getButtonColor =
    type === "equal"
      ? { backgroundColor: "green" }
      : { backgroundColor: "#171717" };

  return (
    &amp;lt;TouchableHighlight
      underlayColor={type === "equal" ? "#04ac04" : "#444444"}
      style={[styles.button, getButtonColor]}
      onPress={() =&amp;gt; handlePress(label)}
    &amp;gt;
      {icon ? (
        icon
      ) : (
        &amp;lt;Text style={{ fontSize: 26, color: getTextColor, fontWeight: "bold" }}&amp;gt;
          {label}
        &amp;lt;/Text&amp;gt;
      )}
    &amp;lt;/TouchableHighlight&amp;gt;
  );
}

const styles = StyleSheet.create({
  button: {
    borderRadius: 50,
    backgroundColor: "#171717",
    width: 80,
    height: 80,
    alignItems: "center",
    justifyContent: "center",
  },
});

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

&lt;/div&gt;



&lt;p&gt;From the code above, we can see there's a lot going on. The Button component accepts four pros &lt;code&gt;{ label, type, handlePress, icon }&lt;/code&gt; where&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;Label&lt;/code&gt; is the text or number that the button should display&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;type&lt;/code&gt; prop is to identify what the button does; is it going to be for an &lt;strong&gt;operator&lt;/strong&gt; or &lt;strong&gt;clear&lt;/strong&gt; (which removes the numbers and operator for the Calculation Input) or &lt;strong&gt;number&lt;/strong&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;handlePress&lt;/code&gt; prop is a function that takes in the &lt;code&gt;label&lt;/code&gt; as an argument and does the necessary operation with it, which we'll get into later on.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;icon&lt;/code&gt; prop is an icon component that will be displayed in the button instead of the &lt;code&gt;label&lt;/code&gt; if available.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Now, let's add the button components to the &lt;code&gt;App.js&lt;/code&gt; file and their various functionalities.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import { StatusBar } from "expo-status-bar";
import { useState } from "react";
import { Pressable, StyleSheet, Text, TextInput, View } from "react-native";
import { Ionicons, FontAwesome5, FontAwesome } from "@expo/vector-icons";
import { MaterialCommunityIcons } from "@expo/vector-icons";
import Button from "./components/Button";

export default function App() {
  const [calValue, setCalValue] = useState("");
  const [previewValue, setPreviewValue] = useState("");
  const [isAnswer, setIsAnswer] = useState(false);

  const ansColor = {
    color: isAnswer ? "green" : "white",
  };

  const handleBackSpace = () =&amp;gt; {
    const remainValue = calValue.slice(0, calValue.length - 1);
    setCalValue(() =&amp;gt; remainValue);
  };

  const handlePress = (text) =&amp;gt; {
    setIsAnswer(false);
    const corrText = text === "X" ? "*" : text === "+/-" ? "-" : text;
    setCalValue((prev) =&amp;gt; prev + `${corrText}`);
  };

  const handleClear = () =&amp;gt; {
    setCalValue("");
  };

  const handleEqual = () =&amp;gt; {
    if (!previewValue) return;
    setCalValue(previewValue);
    setPreviewValue("");
    setIsAnswer(true);
  };

  return (
    &amp;lt;View style={styles.container}&amp;gt;
      &amp;lt;TextInput
        style={[styles.input, ansColor]}
        value={calValue}
        onChangeText={setCalValue}
        cursorColor='#8ad8d1'
        autoFocus={true}
        textAlign='right'
        showSoftInputOnFocus={false}
      /&amp;gt;
      &amp;lt;TextInput
        value={previewValue}
        onChangeText={setPreviewValue}
        cursorColor='#8ad8d1'
        textAlign='right'
        caretHidden={true}
        showSoftInputOnFocus={false}
        style={[styles.input, styles.prevInput]}
      /&amp;gt;

      &amp;lt;View style={styles.backButton}&amp;gt;
        &amp;lt;Pressable
          onPress={() =&amp;gt; handleBackSpace()}
          disabled={calValue ? false : true}
        &amp;gt;
          &amp;lt;Ionicons
            name='md-backspace-outline'
            size={24}
            color={calValue ? "green" : "#035903"}
          /&amp;gt;
        &amp;lt;/Pressable&amp;gt;
      &amp;lt;/View&amp;gt;

      &amp;lt;View
        style={{
          height: 2,
          backgroundColor: "#575757",
          marginVertical: 20,
        }}
      /&amp;gt;

      &amp;lt;View style={styles.buttonContainer}&amp;gt;
        &amp;lt;Row&amp;gt;
          &amp;lt;Button handlePress={handleClear} label={"C"} type='clear' /&amp;gt;
          &amp;lt;Button
            handlePress={handlePress}
            label={"()"}
            type='operator'
            icon={
              &amp;lt;MaterialCommunityIcons
                name='code-parentheses'
                size={30}
                color='green'
                style={{ fontWeight: "bold" }}
              /&amp;gt;
            }
          /&amp;gt;
          &amp;lt;Button handlePress={handlePress} label={"%"} type='operator' /&amp;gt;
          &amp;lt;Button
            handlePress={handlePress}
            label={"/"}
            type='operator'
            icon={&amp;lt;FontAwesome5 name='divide' size={24} color='green' /&amp;gt;}
          /&amp;gt;
        &amp;lt;/Row&amp;gt;
        &amp;lt;Row&amp;gt;
          &amp;lt;Button handlePress={handlePress} label={"7"} /&amp;gt;
          &amp;lt;Button handlePress={handlePress} label={"8"} /&amp;gt;
          &amp;lt;Button handlePress={handlePress} label={"9"} /&amp;gt;
          &amp;lt;Button
            handlePress={handlePress}
            label={"X"}
            type='operator'
            icon={&amp;lt;FontAwesome5 name='times' size={24} color='green' /&amp;gt;}
          /&amp;gt;
        &amp;lt;/Row&amp;gt;
        &amp;lt;Row&amp;gt;
          &amp;lt;Button handlePress={handlePress} label={"4"} /&amp;gt;
          &amp;lt;Button handlePress={handlePress} label={"5"} /&amp;gt;
          &amp;lt;Button handlePress={handlePress} label={"6"} /&amp;gt;
          &amp;lt;Button
            handlePress={handlePress}
            label={"-"}
            type='operator'
            icon={&amp;lt;FontAwesome name='minus' size={24} color='green' /&amp;gt;}
          /&amp;gt;
        &amp;lt;/Row&amp;gt;
        &amp;lt;Row&amp;gt;
          &amp;lt;Button handlePress={handlePress} label={"1"} /&amp;gt;
          &amp;lt;Button handlePress={handlePress} label={"2"} /&amp;gt;
          &amp;lt;Button handlePress={handlePress} label={"3"} /&amp;gt;
          &amp;lt;Button
            handlePress={handlePress}
            label={"+"}
            type='operator'
            icon={&amp;lt;FontAwesome5 name='plus' size={24} color='green' /&amp;gt;}
          /&amp;gt;
        &amp;lt;/Row&amp;gt;
        &amp;lt;Row&amp;gt;
          &amp;lt;Button handlePress={handlePress} label={"+/-"} /&amp;gt;
          &amp;lt;Button handlePress={handlePress} label={"0"} /&amp;gt;
          &amp;lt;Button handlePress={handlePress} label={"."} /&amp;gt;
          &amp;lt;Button
            handlePress={handleEqual}
            label={"="}
            type='equal'
            icon={&amp;lt;FontAwesome5 name='equals' size={24} color='white' /&amp;gt;}
          /&amp;gt;
        &amp;lt;/Row&amp;gt;
      &amp;lt;/View&amp;gt;

      &amp;lt;StatusBar style='auto' /&amp;gt;
    &amp;lt;/View&amp;gt;
  );
}

function Row({ children }) {
  return &amp;lt;View style={styles.row}&amp;gt;{children}&amp;lt;/View&amp;gt;;
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
    backgroundColor: "#010101",
    paddingVertical: 30,
    paddingHorizontal: 20,
  },
  input: {
    marginTop: 40,
    borderWidth: 1,
    padding: 10,
    color: "#fff",
    fontSize: 36,
  },
  prevInput: {
    fontSize: 24,
    marginTop: 40,
    marginBottom: 30,
    color: "#616161",
  },
  backButton: {
    flexDirection: "row",
    justifyContent: "flex-end",
  },
  row: {
    flex: 1,
    flexDirection: "row",
    justifyContent: "space-between",
  },
  buttonContainer: {
    flex: 4,
  },
});

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

&lt;/div&gt;



&lt;p&gt;From the snippet above, we can tell a lot is going on, so I've created an Expo snack for this point of the application so that we can see and play around with the application at this point, just in case you haven't been coding along 😊.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;To get the best experience please switch to the Andriod / iOS tab below (depending on your device), and scan the QR code to test on your mobile device with the Expo Go app.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The &lt;code&gt;Row&lt;/code&gt; component composes of four &lt;code&gt;Button&lt;/code&gt; components and each Button has a different or similar prop value. For example, the button for the equal operation, the prop &lt;code&gt;handlePress&lt;/code&gt; uses the &lt;code&gt;handleEqual()&lt;/code&gt; function, which sets the preview Calculation to the &lt;strong&gt;Calculation Input.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;handlePress()&lt;/code&gt; function takes a text, and if the text is &lt;code&gt;X&lt;/code&gt; it returns &lt;code&gt;*&lt;/code&gt; and if &lt;code&gt;+\-&lt;/code&gt; it returns &lt;code&gt;-&lt;/code&gt; to the &lt;code&gt;corrText&lt;/code&gt; variable, which then added to the previous value of the &lt;code&gt;calValue&lt;/code&gt; state, also, the &lt;code&gt;setIsAnswer(false)&lt;/code&gt; function is made false.&lt;/p&gt;

&lt;p&gt;Notice also a new state is added &lt;code&gt;const [isAnswer, setIsAnswer] = useState(false)&lt;/code&gt; , and it's to keep track of when the arithmetic calculation is correct and determine what colour the Calculation Input should be, either green or white, in the &lt;code&gt;ansColor&lt;/code&gt; variable, which is added to the Calculation Input styles.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Just to be clear , Calculation Input is referred to the very first &lt;code&gt;&amp;lt;TextInput /&amp;gt;&lt;/code&gt; component, while Preview Input is the second &lt;code&gt;&amp;lt;TextInput /&amp;gt;&lt;/code&gt;.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Let's move to the preview input and make it work:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;...
import { useEffect, useState } from "react";
...

function valueHasOp(text) {
  if (text.length === 0) return false;
  if (
    text[text.length - 1] === "+" ||
    text[text.length - 1] === "-" ||
    text[text.length - 1] === "*" ||
    text[text.length - 1] === "/" ||
    text[text.length - 1] === "%" ||
    text[text.length - 1] === "(" ||
    text[text.length - 1] === ")"
  )
    return false;

  for (let i = 0; i &amp;lt;= text.length; i++) {
    if (
      text[i] === "+" ||
      text[i] === "-" ||
      text[i] === "*" ||
      text[i] === "/" ||
      text[i] === "%"
    ) {
      return true;
    }
  }
  return false;
}

export default function App() {
  const [calValue, setCalValue] = useState("");
  const [previewValue, setPreviewValue] = useState("");
  const [isAnswer, setIsAnswer] = useState(false);

  useEffect(() =&amp;gt; {
    if (valueHasOp(calValue)) {
      let prevAns = eval(calValue);
      setPreviewValue(`${prevAns}`);
    } else {
      setPreviewValue(``);
    }
  }, [calValue]);

 ...

 return (
    ...
 )
}

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

&lt;/div&gt;



&lt;p&gt;From the snippet above, there's a &lt;code&gt;useEffect&lt;/code&gt; hook, which checks for changes in the &lt;code&gt;calValue&lt;/code&gt; state, and in its callback, there's a check with the &lt;code&gt;valueHasOp()&lt;/code&gt; function, which checks if the string &lt;code&gt;calValue&lt;/code&gt; has an operator, for example, if &lt;code&gt;calValue&lt;/code&gt; is &lt;code&gt;2*2&lt;/code&gt; the function returns &lt;code&gt;true&lt;/code&gt;, if &lt;code&gt;calValue&lt;/code&gt; is &lt;code&gt;2*&lt;/code&gt; it returns &lt;code&gt;false&lt;/code&gt; cause that isn't a valid operation, also if &lt;code&gt;calValue&lt;/code&gt; is an empty string, it returns &lt;code&gt;false&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;If the &lt;code&gt;valueHasOp(calValue)&lt;/code&gt; function returns &lt;code&gt;true&lt;/code&gt; then this expression is executed &lt;code&gt;Function(&lt;/code&gt;return ${calValue}&lt;code&gt;)()&lt;/code&gt; which evaluate JavaScript expressions as strings. If you've seen the &lt;code&gt;eval()&lt;/code&gt; method before, it is similar to the &lt;code&gt;Funtion()&lt;/code&gt; method.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;If you'll like to learn more about the &lt;code&gt;Function&lt;/code&gt; method, do read this guide: &lt;a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function" rel="noopener noreferrer"&gt;Function - JavaScript | MDN (&lt;/a&gt;&lt;a href="http://mozilla.org" rel="noopener noreferrer"&gt;mozilla.org&lt;/a&gt;&lt;a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function" rel="noopener noreferrer"&gt;)&lt;/a&gt; and also this article to know the difference between &lt;code&gt;eval()&lt;/code&gt; and &lt;code&gt;Function()&lt;/code&gt; : &lt;a href="https://www.educative.io/answers/eval-vs-function-in-javascript" rel="noopener noreferrer"&gt;eval() vs. Function() in JavaScript (&lt;/a&gt;&lt;a href="http://educative.io" rel="noopener noreferrer"&gt;educative.io&lt;/a&gt;&lt;a href="https://www.educative.io/answers/eval-vs-function-in-javascript" rel="noopener noreferrer"&gt;)&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The returned value from the &lt;code&gt;Function(&lt;/code&gt;return ${calValue}&lt;code&gt;)()&lt;/code&gt; method is set in the &lt;code&gt;setPreviewValue(&lt;/code&gt;${prevAns)&lt;code&gt;)&lt;/code&gt; but if the &lt;code&gt;valueHasOp(calValue)&lt;/code&gt; function returns &lt;code&gt;false&lt;/code&gt; then &lt;code&gt;setPreviewValue(&lt;/code&gt;&lt;code&gt;)&lt;/code&gt; method is made an empty string for nothing should be previewed.&lt;/p&gt;

&lt;p&gt;At this point, the calculator application's main functionality works, but then there is a bug with selecting a portion of the Calculation Input to add a new number. To demonstrate the bug, see the video below:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwwkyoamxnw8v1not36u4.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwwkyoamxnw8v1not36u4.gif" width="275" height="600"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;For us to fix this bug, we'll need to know where the selection cursor is at every time on the Calculation Input (first TextInput); therefore, we need to listen to every change on the selection. Luckily, the React Native &lt;code&gt;&amp;lt;TextInput /&amp;gt;&lt;/code&gt; component allows us to keep track of this with some props.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;...

export default function App() {
    const [calValue, setCalValue] = useState("");
    const [previewValue, setPreviewValue] = useState("");
    const [isAnswer, setIsAnswer] = useState(false);
    const [cursorSel, setCursorSel] = useState({ end: 0, start: 0 });
    const [isCursorSel, setIsCursorSel] = useState(false);

    ...

    return (
        &amp;lt;View style={styles.container}&amp;gt;
          &amp;lt;TextInput
            style={[styles.input, ansColor]}
            value={calValue}
            onChangeText={setCalValue}
            selection={cursorSel}
            cursorColor='#8ad8d1'
            autoFocus={true}
            textAlign='right'
            onSelectionChange={(e) =&amp;gt; {
              setIsCursorSel(true);
              setCursorSel(e.nativeEvent.selection);
            }}
            showSoftInputOnFocus={false}
          /&amp;gt;
           &amp;lt;TextInput
             value={previewValue}...
           /&amp;gt;

            ...
        &amp;lt;/View&amp;gt;
    )
}

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

&lt;/div&gt;



&lt;p&gt;The above snippet shows only the changes; we'll need two new states. The first state &lt;code&gt;const [cursorSel, setCursorSel] = useState({ end: 0, start: 0 })&lt;/code&gt; keeps track of the selection cursor end and start property, while the second state &lt;code&gt;const [isCursorSel, setIsCursorSel] = useState(false)&lt;/code&gt; track if the selection cursor has been changed.&lt;/p&gt;

&lt;p&gt;On the Calculation Input, two new props were added, &lt;code&gt;selection&lt;/code&gt; which take in the &lt;code&gt;cursorSel&lt;/code&gt; state and &lt;code&gt;onSelectionChange&lt;/code&gt; an event handler. The &lt;code&gt;e.nativeEvent.selection&lt;/code&gt; expression gets the current location of the selection cursor, which is an object like this &lt;code&gt;{start: 0, end: 0}&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;onSelectionChange={(e) =&amp;gt; {
   setIsCursorSel(true);
   setCursorSel(e.nativeEvent.selection);
}}

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

&lt;/div&gt;



&lt;p&gt;Even though we now keep track of when the selection cursor is moved with the &lt;code&gt;onSelectionChange&lt;/code&gt; event handler, we haven't solved the bug. To solve the bug, every time a number is added to the Calculation Input, we need to know where the selection cursor is located and add the number to that spot. Therefore we'll need to change the functionality of the &lt;code&gt;handlePress&lt;/code&gt; function.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const handlePress = (text) =&amp;gt; {
    setIsAnswer(false);
    const corrText = text === "X" ? "*" : text === "+/-" ? "-" : text;

    setCursorSel({ end: cursorSel.end + 1, start: cursorSel.start + 1 });
    setCalValue((prev) =&amp;gt; {
      if (prev.length !== cursorSel.end &amp;amp;&amp;amp; isCursorSel) {
        let leftOver = prev.slice(0, cursorSel.end);
        let rightOver = prev.slice(cursorSel.end, prev.length);

        return `${leftOver}` + `${corrText}` + `${rightOver}`;
      }
      return prev + `${corrText}`;
    });
  };

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

&lt;/div&gt;



&lt;p&gt;Looking at the above snippet, it might look scary, but really what going on is that we first set the current selection cursor position with the &lt;code&gt;setCursorSel&lt;/code&gt; function and then in the &lt;code&gt;setCalValue&lt;/code&gt; function, there is a check if the previous value length &lt;code&gt;prev&lt;/code&gt; is not equal to the &lt;code&gt;cursorSel.end&lt;/code&gt; and &lt;code&gt;isCursorSel&lt;/code&gt; is &lt;code&gt;true&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Let's say the &lt;code&gt;prev&lt;/code&gt; value is &lt;code&gt;5*4&lt;/code&gt; and the &lt;code&gt;cursorSel.end&lt;/code&gt; is at &lt;code&gt;0&lt;/code&gt; , which means the selection cursor is next to &lt;code&gt;5&lt;/code&gt; .&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;leftOver&lt;/code&gt; variable would be &lt;code&gt;"5*4".slice(0, 0)&lt;/code&gt; which returns an empty string &lt;code&gt;""&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;rightOver&lt;/code&gt; variable would be &lt;code&gt;"5*4".slice(0,3)&lt;/code&gt; which returns &lt;code&gt;5*4&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Now, if the &lt;code&gt;text&lt;/code&gt; parameter is &lt;code&gt;"4"&lt;/code&gt;, then &lt;code&gt;corrText&lt;/code&gt; would be &lt;code&gt;"4"&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Put all together would be &lt;code&gt;"" + "4" + "5*4"&lt;/code&gt; which evaluate to &lt;code&gt;"45*4"&lt;/code&gt; .&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;This is a hacky solutions I know, but it works 😅&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Okay, so that is it; we've successfully solved the bug; if you'll like to play around with it on your device, use the Expo snack below along with the Expo Go app; it's not suitable for the web.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;GitHub repo:&lt;/strong&gt; &lt;a href="https://github.com/jomefavourite/calculator-native/tree/blog" rel="noopener noreferrer"&gt;jomefavourite/calculator-native at blog branch (&lt;/a&gt;&lt;a href="http://github.com" rel="noopener noreferrer"&gt;github.com&lt;/a&gt;&lt;a href="https://github.com/jomefavourite/calculator-native/tree/blog" rel="noopener noreferrer"&gt;)&lt;/a&gt;&lt;/p&gt;

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

&lt;p&gt;If you've followed along with the article to this point, thank you very much, and if you can't tell, I'm still new to React Native 😊, and this is a project I built by myself without a guide just to get my hands dirty, and I can say React Native is really cool.&lt;/p&gt;

&lt;p&gt;If you have suggestions on how the app could be improved, please leave a comment; also, I know there are other bugs. If you can fix them, do message on Twitter &lt;a href="https://twitter.com/FavouriteJome1" rel="noopener noreferrer"&gt;Favourite Jome (@FavouriteJome1)&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Thanks for reading once again, and see you in the next &lt;a href="https://favouritejome.hashnode.dev/series/lets-build-something-cool" rel="noopener noreferrer"&gt;Let's build Something Cool&lt;/a&gt; series 🤩&lt;/p&gt;

</description>
      <category>career</category>
      <category>learning</category>
      <category>vibecoding</category>
    </item>
    <item>
      <title>First look at the GitHub CLI</title>
      <dc:creator>Favourite Jome</dc:creator>
      <pubDate>Mon, 05 Dec 2022 09:54:05 +0000</pubDate>
      <link>https://dev.to/favouritejome/first-look-at-the-github-cli-3hm4</link>
      <guid>https://dev.to/favouritejome/first-look-at-the-github-cli-3hm4</guid>
      <description>&lt;p&gt;We all know about Github, I presume but do we know about the Github CLI (Command Line Interface)?&lt;/p&gt;

&lt;p&gt;The GitHub CLI is a tool I've been using recently, and I doubt many of us developers are aware of it, so we'll be looking at some of its use cases which would help boost your productivity when it comes to using Github.&lt;/p&gt;

&lt;p&gt;The GitHub CLI is a tool that takes Github to the command line, allowing us to perform GitHub operations such as making a pull request (PR), creating repositories (repo) etc., that would have been done on the GitHub website directly.&lt;/p&gt;

&lt;h2&gt;
  
  
  Prerequisite
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Basic knowledge of Git and GitHub&lt;/li&gt;
&lt;li&gt;Basic knowledge of the terminal or the Command Line Interface (CLI)&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  How to get GitHub CLI up on your machine
&lt;/h2&gt;

&lt;p&gt;There are various means of installing the GitHub CLI on our devices depending on the Operating System (OS) you make use of.&lt;/p&gt;

&lt;h3&gt;
  
  
  Windows
&lt;/h3&gt;

&lt;p&gt;You can use these package managers or command line installers such as WinGet, and scoop, which of course, must be installed first on your machine. But if you're on Windows 10 upwards, you should have WinGet by default.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;winget install --id GitHub.cli

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

&lt;/div&gt;



&lt;h3&gt;
  
  
  MacOS
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;brew install gh

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

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;For further instructions on how to install the GitHub CLI, please visit their &lt;a href="https://github.com/cli/cli#installation" rel="noopener noreferrer"&gt;documentation&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Configuring GitHub CLI
&lt;/h2&gt;

&lt;p&gt;Now that we got the CLI on our various machines, we need to be authenticated with our GitHub accounts to utilise the CLI.&lt;/p&gt;

&lt;p&gt;Firstly, run the command on the terminal&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;gh auth login

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

&lt;/div&gt;



&lt;p&gt;When you run the command above, you'll get more prompt; the images below work you through the steps&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F98nigwf5fj8zamawy3vo.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F98nigwf5fj8zamawy3vo.jpg" alt="1.jpg" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

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

&lt;h2&gt;
  
  
  Syntax of the GitHub CLI
&lt;/h2&gt;

&lt;p&gt;The GitHub CLI commands follow a certain basic syntax or usage, which is:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkrjbn21k0m8o5bxr9ccl.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkrjbn21k0m8o5bxr9ccl.jpg" alt="basic syntax of the GitHub CLI commands" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;gh&lt;/strong&gt; : is the initial command, saying I want to use GitHub CLI&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;command&lt;/strong&gt; : specifies the action you'll like to take, like &lt;strong&gt;login&lt;/strong&gt; , &lt;strong&gt;pr&lt;/strong&gt; (pull request), &lt;strong&gt;browse&lt;/strong&gt; e.t.c&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;subcommand&lt;/strong&gt; : specifies further commands that complete the command essentially. E.g.&lt;code&gt;gh auth login&lt;/code&gt;, which we've used.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;[flags]&lt;/strong&gt;: specifies additional options or arguments to the command.&lt;/p&gt;

&lt;h2&gt;
  
  
  GitHub CLI Basic Commands
&lt;/h2&gt;

&lt;p&gt;There are a lot of commands that serve different GitHub operations, so we aren't going to cover all; we'll look at two commands, which I offend make use of.&lt;/p&gt;

&lt;h3&gt;
  
  
  gh repo
&lt;/h3&gt;

&lt;p&gt;The &lt;code&gt;gh repo&lt;/code&gt; command is used for handling repositories, and it comes with lots of subcommands, such as:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;gh repo create&lt;/li&gt;
&lt;li&gt;gh repo clone &lt;/li&gt;
&lt;li&gt;gh repo delete&lt;/li&gt;
&lt;li&gt;gh repo edit&lt;/li&gt;
&lt;li&gt;gh repo fork&lt;/li&gt;
&lt;li&gt;e.t.c&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;To view the complete lists of the &lt;code&gt;gh repo&lt;/code&gt; commands, do &lt;a href="https://cli.github.com/manual/gh_repo" rel="noopener noreferrer"&gt;visit the docs here&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Let's go over just one of the subcommands under the &lt;code&gt;gh repo&lt;/code&gt; command:&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;code&gt;gh repo create [&amp;lt;name&amp;gt;] [flags]&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;The command above is to create a repository, making it private and public, with flags and lots of other cool stuff concerning a repository beyond this article's scope.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;[name]&lt;/strong&gt;: specifies the name of the repository while&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;[flags]&lt;/strong&gt;: specifies particular arguments for the repository being created, for example, making the repo public or private&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Running the commands&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Before we run the commands, you should know that there are two modes of using this command: the interactive mode and the non-interactive mode.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The interactive mode&lt;/strong&gt; means you'd go through a list of questions like whether you want to clone the repo after it's been created, whether it should be a private or public repo, and other questions. &lt;strong&gt;Note&lt;/strong&gt; the interactive mode doesn't take arguments, so only the command &lt;code&gt;gh repo create&lt;/code&gt; is used.&lt;/p&gt;

&lt;p&gt;Let's look at a step-by-step guide using the interactive mode command:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fed9l6ibjnzzkb61l5v1n.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fed9l6ibjnzzkb61l5v1n.jpg" alt="gh repo create" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwk4cgj1pc74xfg1v5amb.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwk4cgj1pc74xfg1v5amb.jpg" alt="gh repo create" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8l64e9top1lmhl7r2bda.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8l64e9top1lmhl7r2bda.jpg" alt="gh repo create" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The non-interactive mode&lt;/strong&gt; is a declarative way of specifying how the repo should be created, where the name and various flags would be specified.&lt;/p&gt;

&lt;p&gt;Now, let's create a new repository just like we've done before, but this time in a non-interactive mode whereby there is no step-by-step procedure and no questions.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;gh repo create new_repo --add-readme --private -d "Hello this is a new repo" -c

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

&lt;/div&gt;



&lt;p&gt;Notice I have 4 flags along with the repository name&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;--add-readme&lt;/strong&gt; : specifies you want a Readme file added to the repo, obviously 😅&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;--private&lt;/strong&gt; : specifies, hey repo, be a private repo 🔏&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;-d [string]&lt;/strong&gt;: specifies description for the repo&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;-c&lt;/strong&gt; : specifies you'll like to clone the repo once it's created&lt;/p&gt;

&lt;p&gt;Here's the output of the command:&lt;/p&gt;

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

&lt;blockquote&gt;
&lt;p&gt;If you'll like to know more about how the other subcommand are to be used, please read up &lt;a href="https://cli.github.com/manual/gh_repo" rel="noopener noreferrer"&gt;on their docs here&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  gh pr
&lt;/h3&gt;

&lt;p&gt;The &lt;code&gt;gh pr&lt;/code&gt; command is used to work with GitHub pull requests, and it comes with lots of subcommands, such as:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;gh pr create&lt;/li&gt;
&lt;li&gt;gh pr close&lt;/li&gt;
&lt;li&gt;gh pr diff&lt;/li&gt;
&lt;li&gt;gh pr comment&lt;/li&gt;
&lt;li&gt;gh pr reopen&lt;/li&gt;
&lt;li&gt;e.t.c&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;To view the complete lists of the &lt;code&gt;gh pr&lt;/code&gt; commands, do &lt;a href="https://cli.github.com/manual/gh_pr" rel="noopener noreferrer"&gt;visit the docs here&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Let's go over just one of the subcommands under the &lt;code&gt;gh pr&lt;/code&gt; command:&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;code&gt;gh pr create [flags]&lt;/code&gt;
&lt;/h3&gt;

&lt;p&gt;The command above would be used to create a pull request, and there are two modes of running this command, just like the &lt;code&gt;gh repo create&lt;/code&gt; command; we have the &lt;strong&gt;interactive mode&lt;/strong&gt; and the &lt;strong&gt;non-interactive mode&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Running the command&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Let's create a pull request on the &lt;code&gt;new_repo&lt;/code&gt; repository we created earlier. Though in other for us to make the pull request to the repo, we must have created a new branch first because the sole purpose of a pull request is to say hey, I've made some changes would you like to merge my changes to some other branch (target branch).&lt;/p&gt;

&lt;p&gt;So once you've identified that you have multiple branches, another thing to look out for is ensuring the working directory on the terminal is the directory you want to make the pull request to. That is, if the command &lt;code&gt;pwd&lt;/code&gt; (print working directory) is run, it should output something like this &lt;code&gt;/c/Users/..../new_repo&lt;/code&gt;. Basically, the last path should be a git repository, which in this case is &lt;code&gt;new_repo&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Now, let's practicalize all this:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Interactive mode&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Recap, so we need to create a new branch first, then make some changes, push those changes and make the pull request to the main branch from the new branch&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbbhkzyapmh4fjqb8f3pa.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbbhkzyapmh4fjqb8f3pa.jpg" alt="8.jpg" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fr9ox911699lqmebt5x52.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fr9ox911699lqmebt5x52.jpg" alt="9.jpg" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fh5tnz720rbczwzgzdac6.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fh5tnz720rbczwzgzdac6.jpg" alt="10.jpg" width="800" height="450"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Non-interactive mode&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Now for this example, we write the entire command with flags such as &lt;code&gt;--title&lt;/code&gt; or &lt;code&gt;--body&lt;/code&gt;, which is used in the image below:&lt;/p&gt;

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

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt; : if you're going to run the command above, you should have made some changes to your codebase and pushed it before creating the pull request. Also, note there are more &lt;strong&gt;flags&lt;/strong&gt; when using the &lt;code&gt;gh pr create&lt;/code&gt; command, to view all, &lt;a href="https://cli.github.com/manual/gh_pr_create" rel="noopener noreferrer"&gt;visit the docs here&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

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

&lt;p&gt;Now I believe you've got the hang of the GitHub CLI and will be willing to explore the various commands provided if you've got to this point in the article. One helpful flag to always make use of is the &lt;code&gt;--help&lt;/code&gt; flag. I believe you could use it along with all the commands, which would guide you on utilising the commands instead of running to the &lt;a href="https://cli.github.com/manual" rel="noopener noreferrer"&gt;documentation&lt;/a&gt; all the time.&lt;/p&gt;

&lt;p&gt;Thanks for reading!&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>webdev</category>
      <category>react</category>
    </item>
    <item>
      <title>VS Code Version Control: Understanding the basics of Git operations # 1</title>
      <dc:creator>Favourite Jome</dc:creator>
      <pubDate>Tue, 25 Jan 2022 21:17:43 +0000</pubDate>
      <link>https://dev.to/favouritejome/vs-code-version-control-understanding-the-basics-of-git-operations-1-162m</link>
      <guid>https://dev.to/favouritejome/vs-code-version-control-understanding-the-basics-of-git-operations-1-162m</guid>
      <description>&lt;p&gt;Visual Studio Code (VS Code) is one of the most used Integrated Development Environment (IDE) with lots of features, which most users don't know about (including myself, I can't say I've used all the features that VS Code provides 😃).&lt;/p&gt;

&lt;p&gt;So in this article, we'll look into a feature we developers would probably use frequently in VS Code which is the Version Control feature called Source Control in VS Code. Understanding some of the various operations it provides, how they translate to the Git commands and how the operations are useful for managing source control in VS Code.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; Please feel free to jump around the Table of Content cause you might not need all the information if you already know about them, but you could read all and probably learn something new&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Prerequisite
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Basic knowledge of Git&lt;/li&gt;
&lt;li&gt;Basic knowledge of VS Code interface&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What's the Source Control or the Version Control
&lt;/h2&gt;

&lt;p&gt;The Source Control or Version Control is a system used to manage all activities carried out on a computer program which is also referred to as a human-readable program known as the &lt;strong&gt;source code&lt;/strong&gt;.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;If you'll like to read more about what Source Control or Version Control is, please do &lt;a href="https://en.wikipedia.org/wiki/Version_control"&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Source Control Panel on VS code
&lt;/h2&gt;

&lt;p&gt;VS Code makes use of Git right out of the box as its primary Version Control system. Meaning that you'll need Git installed on your PC before making use of Git through the Source Control sidebar on VS Code.&lt;/p&gt;

&lt;p&gt;To get Git on your machines, follow the links below:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;For Windows OS&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://git-scm.com/download/win"&gt;Download Git for Windows&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;For Linux OS&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://git-scm.com/download/linux"&gt;Download Git for Linux&lt;/a&gt; or run the command on the terminal&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;apt &lt;span class="nb"&gt;install &lt;/span&gt;git
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;For Mac OS&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="http://git-scm.com/download/mac"&gt;Download Git for Mac&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now that we've got Git installed on our various machines, we need to config Git to our machine. Don't worry, this step is a one-time process.&lt;/p&gt;

&lt;h3&gt;
  
  
  Setting up Git for VS code
&lt;/h3&gt;

&lt;p&gt;Firstly, we need to set up our identity through the terminal which can be opened/closed on VS code by using &lt;code&gt;(Ctrl + J)&lt;/code&gt;. Our username and email address are what is needed to set up our identity for Git.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git config &lt;span class="nt"&gt;--global&lt;/span&gt; user.name &lt;span class="s2"&gt;"John Doe"&lt;/span&gt;
git config &lt;span class="nt"&gt;--global&lt;/span&gt; user.email johndoe@example.com
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; Please do change &lt;code&gt;" John Doe"&lt;/code&gt; to your username as it is on Github and also the email address &lt;code&gt;johndoe@example.com&lt;/code&gt; to your email address&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The next step is to configure the code editor which is being used to access Git, since we're making use of VS code we input the command below into the terminal.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git config &lt;span class="nt"&gt;--global&lt;/span&gt; core.editor &lt;span class="s2"&gt;"code --wait"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;If for any reason you're making use of a different editor, do visit &lt;a href="https://git-scm.com/book/en/v2/Appendix-C%3A-Git-Commands-Setup-and-Config#ch_core_editor"&gt;here listing out the commands for other editors&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Lastly, we need to set up the default branch name. Recently, the default Git branch name was changed to &lt;code&gt;main&lt;/code&gt; from &lt;code&gt;master&lt;/code&gt;, so to configure the branch name, we make use of the command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git config &lt;span class="nt"&gt;--global&lt;/span&gt; init.defaultBranch main
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That's it! Git is fully configured on our machines, we can now go back to explore the Source Control Panel.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; &lt;a href="https://git-scm.com/book/en/v2/Getting-Started-First-Time-Git-Setup"&gt;Read more about Getting Started First Time Git Setup&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Working with the Source Control Panel
&lt;/h2&gt;

&lt;p&gt;Now that we know what Source Control is, let's dive into VS Code and explore the various options that it provides.&lt;/p&gt;

&lt;p&gt;The source control can be accessed by using the keys &lt;code&gt;(Ctrl+Shift+G)&lt;/code&gt; or by clicking the icon shown below.&lt;/p&gt;

&lt;p&gt;While working on a directory/folder in VS code and having the source control sidebar opened, two options will be shown which are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Initialize Repository&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Publish to Github&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;center&gt;

![source-control-option.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1638048077887/TrRUzhAaX.png)

&lt;/center&gt;

&lt;p&gt;&lt;strong&gt;Initialize Repository&lt;/strong&gt; when clicked create a &lt;code&gt;.git&lt;/code&gt; folder, which is hidden by default in the working directory (or current folder being used) except you turn on the option of showing all hidden files on your PC file explorer, that's when it's visible.&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;.git&lt;/code&gt; folder contains all the necessary information for a project to be recognized as a version control project, information about commits, branches, remote repository addresses etc are all managed in the &lt;code&gt;.git&lt;/code&gt; folder.&lt;/p&gt;

&lt;p&gt;The &lt;strong&gt;Publish to Github&lt;/strong&gt; button when clicked, pops out a input for us to enter our repository name. By default, the name of the folder housing your project files would be selected as the name of the repository but it's changeable.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; you can't publish to Github if you've not connected VS code to Github.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  Connect Github with VS code
&lt;/h3&gt;

&lt;p&gt;There are various means to connect VS Code to GitHub, well we'll go through just one means, which is clicking on the &lt;strong&gt;Accounts&lt;/strong&gt; icon, at the bottom of the sidebar.&lt;/p&gt;

&lt;center&gt;

![account.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1638048145040/MJeqmiPQY.png)

&lt;/center&gt;

&lt;p&gt;Then we click on the &lt;strong&gt;Sign in to Sync Settings&lt;/strong&gt; option which present us with a pop-up, signifying if we'll like to sign up with Microsoft or Github.&lt;/p&gt;

&lt;center&gt;

![pop-up-signup.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1638048168920/-uiIr5QFV.png)

&lt;/center&gt;

&lt;p&gt;Let's signup with Github, upon clicking on the option we will be redirected to the browser window, where we are to click on the &lt;strong&gt;continue green button&lt;/strong&gt;, which then signs VS code with Github. To confirm it worked correctly, go to the "Accounts Icon" on the sidebar once more, this time you should find your GitHub username displayed.&lt;/p&gt;

&lt;center&gt;

![signed-up.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1638048226411/Y8f4g-p4n.png)

&lt;/center&gt;

&lt;p&gt;Great! We've been able to completely get VS code up and running with Git and Github. Now let's look into the various features that VS code offers through the Source Control panel.&lt;/p&gt;

&lt;h2&gt;
  
  
  Recording Changes to Git
&lt;/h2&gt;

&lt;p&gt;When a project is initialized with Git either by clicking on the &lt;strong&gt;Initialize Repository&lt;/strong&gt; or running the command &lt;code&gt;git init&lt;/code&gt;, all the files or folders in the current directory move to an &lt;strong&gt;Untracked State (U)&lt;/strong&gt; shown underneath the &lt;strong&gt;Changes Dropdown&lt;/strong&gt; at the Source Control Panel.&lt;/p&gt;

&lt;center&gt;

![changes.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1638048286878/i_a2-rc7y.png)

&lt;/center&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; the &lt;code&gt;U&lt;/code&gt; at the right side of each file from the image above means &lt;strong&gt;Untracked&lt;/strong&gt;, and this shows on files that Git doesn't recognize.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Remember:&lt;/strong&gt; the &lt;code&gt;.git&lt;/code&gt; folder is created once git is initialized in a folder, which keeps track of all the files&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Let's go over some features, which are accessed by icons on the files.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1 Discard Changes:&lt;/strong&gt; discarding changes on a file or files which simply means removing files from the &lt;strong&gt;changes dropdown&lt;/strong&gt;, deleting all changes made to the files that haven't been committed. In this case, we've not committed our files and there still in the &lt;strong&gt;Untracked State&lt;/strong&gt; so if the files were to be discarded all the files will be deleted, so be really sure you want to discard a file or the entire files to be committed.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; To discard changes, you make use of the hook-like icon shown below:&lt;/p&gt;
&lt;/blockquote&gt;

&lt;center&gt;

![discard-changes.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1638048309191/Zug-I5qvY.png)

&lt;/center&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; Each file underneath the &lt;strong&gt;Changes Dropdown&lt;/strong&gt; also have the Discard icon&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;2 Stage Changes:&lt;/strong&gt; Stage changes means that the file or the files are to be tracked by git. At this point, the file(s) are in the &lt;strong&gt;Tracking State&lt;/strong&gt;, which means git recognizes that these files would be committed.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; The files in the Staged Changes dropdown only shows those changes/files to be committed or rather that are being tracked by git&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;You must have used the command shown below if you've ever used git before.  All you're doing with the command is to tell git, hey, I'll like you to keep track of these files or a file, which means you're staging the file/files.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git add &amp;lt;name of file&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To add file(s) to the Stage Changes on VS code, you click on the &lt;strong&gt;+&lt;/strong&gt; icon on each file or on the Changes dropdown.&lt;/p&gt;

&lt;center&gt;

![stage-changes-icon.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1638048351623/lXlzeiy5C.png)

&lt;/center&gt;

&lt;p&gt;From the image above, I'm going to stage both account.png and changes.png files. By doing this, a new dropdown would be created named the &lt;strong&gt;Staged Changes&lt;/strong&gt;&lt;/p&gt;

&lt;center&gt;

![staged-changes-2.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1638048374029/mHRnDtUsV.png)

&lt;/center&gt;

&lt;blockquote&gt;
&lt;p&gt;Notice the &lt;strong&gt;A&lt;/strong&gt; letter added to the files at the Staged Changes dropdown, it means &lt;strong&gt;Added&lt;/strong&gt;, which denotes that git is keeping track of the files&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Committing Files
&lt;/h2&gt;

&lt;p&gt;While following Git command instructions, here's how we'll commit a file/files to Git:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git commit &lt;span class="nt"&gt;-m&lt;/span&gt; &lt;span class="s2"&gt;"First Commit"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now using VS code, in order to commit out staged files which are &lt;code&gt;account.png&lt;/code&gt; and &lt;code&gt;changes.png&lt;/code&gt;, we go to the message input at the top of the Source Control Panel.&lt;/p&gt;

&lt;center&gt;

![commit-input.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1638051772942/bPilkbVIj.png)

&lt;/center&gt;

&lt;p&gt;Then we type in a message like "First Commit", then click in the &lt;strong&gt;checkmark&lt;/strong&gt; icon to commit the files.&lt;/p&gt;

&lt;center&gt;

![commit.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1638048394565/4y2SPqmzD.png)

&lt;/center&gt;

&lt;p&gt;Once the Staged changes files have been committed, the files wouldn't be seen anymore on the Source Control panel, because Git now recognizes those files as its own.&lt;/p&gt;

&lt;h2&gt;
  
  
  Publishing to Github
&lt;/h2&gt;

&lt;p&gt;To publish the committed files to Github, we'll need to move to VS code Status Bar, right at bottom of the IDE.&lt;/p&gt;

&lt;center&gt;

![status-bar.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1638048424415/zYNVsPl_D.png)

&lt;/center&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Notice:&lt;/strong&gt; from the image above, it says "blog (Git) - Publish to Github". This is because my working directory/folder is named &lt;strong&gt;blog&lt;/strong&gt; that's why you can see the blog there. Also, whatever the working directory name is, that will be taken as the default repository name but still changeable.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The next step would be to click on the icon next to the branch name which is &lt;strong&gt;main&lt;/strong&gt;. When the icon is clicked there would be a pop up prompting you to sign up using Github.&lt;/p&gt;

&lt;center&gt;

![prompt.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1638048450631/uFViSSMUx.png)

&lt;/center&gt;

&lt;p&gt;Click on &lt;strong&gt;Allow&lt;/strong&gt;, which then redirect you to the browser, click on the continue button and that's it, next off would be to input the repository name.&lt;/p&gt;

&lt;center&gt;

![repository-name.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1638048468533/ZgYkp_TbP.png)

&lt;/center&gt;

&lt;p&gt;From the image above, the repository name is "vscode-test", then you can decide if you'll like the repository to be private or public, once you either pick private or public it should show an indication at the right bottom view of VS code that the repository is publishing.&lt;/p&gt;

&lt;center&gt;

![success.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1638048490476/_6zntb9SX.png)

&lt;/center&gt;

&lt;p&gt;Once it shows "successfully published...", you can open Github to view the newly created repository.&lt;/p&gt;

&lt;center&gt;

![vs-code.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1638048507087/FpTE_Jf7Q.png)

&lt;/center&gt;

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

&lt;p&gt;We've covered how to set up Git in VS Code, how to initialize a repository and then publish the repository. In the next part of the article, we'll look into more advanced operations like Stashing, Switching between branches, Synchronization and many more.&lt;/p&gt;

&lt;p&gt;Thanks for reading! I hope you find the article useful and don't forget to like and share the article.&lt;/p&gt;

&lt;p&gt;See you in the next article! 👋&lt;/p&gt;

&lt;h2&gt;
  
  
  Resources
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://code.visualstudio.com/docs/editor/versioncontrol#_initialize-a-repository"&gt;Using Version Control in VS Code&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://git-scm.com/book/en/v2/Getting-Started-First-Time-Git-Setup"&gt;Getting Started - First-Time Git Setup&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://git-scm.com/book/en/v2/Git-Basics-Recording-Changes-to-the-Repository"&gt;Git Basics - Recording Changes to the Repository&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>vscode</category>
      <category>git</category>
      <category>github</category>
      <category>webdev</category>
    </item>
    <item>
      <title>First Internship Journey as a Front-End Developer and What I've Learnt</title>
      <dc:creator>Favourite Jome</dc:creator>
      <pubDate>Sun, 02 Jan 2022 20:42:59 +0000</pubDate>
      <link>https://dev.to/favouritejome/first-internship-journey-as-a-front-end-developer-and-what-ive-learnt-4fpk</link>
      <guid>https://dev.to/favouritejome/first-internship-journey-as-a-front-end-developer-and-what-ive-learnt-4fpk</guid>
      <description>&lt;p&gt;In this article, I'll share my journey to how I became a Frontend Developer Intern at a company named &lt;a href="https://www.vasiti.com/" rel="noopener noreferrer"&gt;Vasiti.com&lt;/a&gt; for 5 months, how I got in, my process of getting the role and what I've leant through the internship.&lt;/p&gt;

&lt;p&gt;After a certain amount of years in college, most faculties make it compulsory for students to embark on the Industrial Training Programme, where students undergo supervised practical training (real-world training) in a selected industry to learn and get acquainted with some industrial skills. I had gotten to the year where I had to undergo this training which lead to questions like where would I like to work? &lt;/p&gt;

&lt;p&gt;Since I was already into the Web ecosystem, I wanted to work for a company that was utilizing Web technologies, so as for me not to do something I wasn't interested in. &lt;/p&gt;

&lt;h2&gt;
  
  
  How I got the internship
&lt;/h2&gt;

&lt;p&gt;In the desperate search for a place to have my Industrial Training (IT), I went online and searched for internship roles that were web-related and Front-end Development roles. I found a lot of remote roles, physical roles through platforms like &lt;a href="https://ng.indeed.com/" rel="noopener noreferrer"&gt;Indeed&lt;/a&gt;, Google Jobs, &lt;a href="https://www.myjobmag.com/" rel="noopener noreferrer"&gt;MyJobMag&lt;/a&gt; etc then I applied to all I found meaningful, though I didn't apply to remote roles since I didn't want to work remotely.&lt;/p&gt;

&lt;h3&gt;
  
  
  Application process
&lt;/h3&gt;

&lt;p&gt;I applied by sending in my resume and a brief write up, for example saying "I'll love to be an intern at your company". Upon doing this, I made some research about the companies that interest me, like what are they doing, their goals and their mission. Here's a preview of the message I sent to the company I worked with.&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%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1638923868674%2FLs8HepDY0.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%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1638923868674%2FLs8HepDY0.png" alt="Internship.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Funny enough Vasiti.com wasn't looking for an intern when I applied, they needed a Frontend Developer. But I took a leap of faith and still sent my resume by saying I'll love to be an intern at their organization knowing fully well that the role wasn't an internship role.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;If you'll like to view the job description, responsibilities about the job when I applied, click the &lt;a href="https://www.myjobmag.com/job/front-end-developer-vasiti-dotcom-3" rel="noopener noreferrer"&gt;link here&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So if you're looking for an internship role and you have a company in mind, even if they aren't looking for an intern just apply and pitch yourself, who knows, you might just get your desired outcome.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Though I didn't have a cover letter to support my resume, I made sure to include my best projects on the resume also I had the resume reviewed, all thanks to @&lt;a href="https://dev.to@victoria"&gt;Victoria Lo&lt;/a&gt; and her wonderful article &lt;a href="https://lo-victoria.com/the-ultimate-resume-guide-for-developers" rel="noopener noreferrer"&gt;The Ultimate Resume Guide for Developers&lt;/a&gt; which set me to a right path.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;If you're like to view the resume, &lt;a href="https://drive.google.com/file/d/1gvW04rcbKsHC8gxNC-IS7ifyC2RgUVJY/view?usp=sharing" rel="noopener noreferrer"&gt;click here&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Just like that, I got replies from two organizations I applied to among several organizations. Here's the feedback I got:&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%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1638926418377%2FmGV-GhWSA.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%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1638926418377%2FmGV-GhWSA.png" alt="Vasiti.com Front End Developer Assessment.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%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1638926408052%2FSEl3iyMAi.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%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1638926408052%2FSEl3iyMAi.png" alt="BINCOM ACADEMY (Mobile App Trainee Developer -Internship).png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I ended up going for the company &lt;strong&gt;Vasiti.com&lt;/strong&gt; since I first got a reply from them and I liked they were geared towards helping students grow as an entrepreneur as of that time, then I took their assessment which spanned 24 hrs, honestly, that day was a rush 🥴. The assessment was to build a testimonial page from the design provided and also to allow users to add testimonials.&lt;/p&gt;

&lt;p&gt;That day I didn't rest until I got the web page ready and looking much like the design and also implemented adding more testimonials. I made use of React and Styled Components to accomplish the project, here's the &lt;a href="https://vasiti-testimonial-app.vercel.app/" rel="noopener noreferrer"&gt;live demo&lt;/a&gt; and &lt;a href="https://github.com/jomefavourite/vasiti-testimonial-app" rel="noopener noreferrer"&gt;codebase&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Platforms that impacted my skills building web pages from a design template are &lt;a href="https://www.frontendmentor.io/" rel="noopener noreferrer"&gt;frontendmentor.io&lt;/a&gt; and &lt;a href="https://devchallenges.io/" rel="noopener noreferrer"&gt;devchallenges.io&lt;/a&gt;. I higher recommend these two platforms, just get a challenge and build.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  Interview process
&lt;/h3&gt;

&lt;p&gt;On July 1st, a mail was sent to me, congratulating me on the successful assessment submission, including the interview date which was the next day 😊.&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%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1640379528859%2FUgs5lnLN-.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%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1640379528859%2FUgs5lnLN-.png" alt="Interview Invitation for Front End Developer Intern Role at Vasiti.com.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So I consulted YouTube on how an interview would be structured, what questions would be asked and how to answer them. Even though I did watch some videos and practised what I'd say, the interview didn't go as planned 🤣. You see, in those videos I watched, the questions asked weren't technical they were questions like "Tell me about yourself?", "What experience do you have?", "How do you handle stress and pressure?"&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Here's one of the videos I watched: &lt;a href="https://www.youtube.com/watch?v=KCm6JVtoRdo" rel="noopener noreferrer"&gt;Interview Questions and Answers! (How to PASS a JOB INTERVIEW!)&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;I eventually didn't practice any technical questions for the role as a Frontend Developer, which showed effect when I got to the interview seat. Also, I didn't make more research about the company, what could be improved on their website, well I guessed I believed the questions in the youtube videos I watched were what I'll be asked.&lt;/p&gt;

&lt;p&gt;The next day, getting to the hot seat, faced with the CEO, CTO and HR of the company was really intimidating for me, even though they hadn't asked questions 😂. Eventually, after introductions, the questions started, firstly by the HR manager. She asked questions like how I got to know about the company, a brief introduction about myself and other questions alike.&lt;/p&gt;

&lt;p&gt;Next off, technical questions by the CTO were thrown at me, mainly about React. Questions like what's the difference between a Functional Component and Class-based components, what's OOP, can hooks be used in a Class Component. But I think the very first question was how I would rate my skills with React from 1 to 10 and silly me at that time said 5.&lt;/p&gt;

&lt;p&gt;Well, I guess I felt confident rating myself 5 in React as of that time and I didn't want to rate myself too low as for me to get employed, but really that lead to more follow-up questions that I couldn't give correct answers to because I was unprepared. &lt;/p&gt;

&lt;p&gt;I felt bad for not practising enough, that when it came to the CEO questions I was down and while answering his questions I tried thinking deeply for an appropriate answer. I remember being asked by the CEO from the website what can I improve. Seriously, when I heard the question I couldn't think of any reasonable answer because I didn't take note of what could be improved.&lt;/p&gt;

&lt;p&gt;I ended up talking about SEO (Search Engine Optimization) and saying whatever came to my mind 😂. Other questions like if I'll like to get paid as an intern at the company was asked and I eagerly said YES! 😁. Then I was asked how much I'll like to be paid, hmm, this was a tough question.&lt;/p&gt;

&lt;p&gt;Initially, upon getting to the interview I had concluded I would like to be paid at least N30k per month, but weighing how the interview had gone I changed my mind and said N20k to the CEO. After responding to the question, I could see on the CEO's face a sign of relievement that I didn't go too far with the money.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;I know! probably if I had went with a price higher or stuck to N30k as I planned I might have still gotten the role, but right now it doesn't matter&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  Landing the Job
&lt;/h3&gt;

&lt;p&gt;After a week from the interview, almost losing hope of getting feedback, I got a mail on July 11th, welcoming me to the company. I wouldn't lie, I was really happy getting the mail that day and grateful I was accepted.&lt;/p&gt;

&lt;p&gt;Then, I had to relocate from my family home to a new home closer to my workplace. The family I stayed with accepted and accommodated me very well and for that, I'm sincerely grateful to them.&lt;/p&gt;

&lt;p&gt;While starting the job my salary was concluded to be N25k per month and I learnt a lot during the space of 5 months, so here are some of what I've learnt.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I've Learnt
&lt;/h2&gt;

&lt;p&gt;I'm going to share both technical and non-technical things I have learnt doing the 5 month internship&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Asking Questions when stuck is one of the best ways to learn
&lt;/h3&gt;

&lt;p&gt;There were so many tasks I was given, that I literally had no idea how to tackle and solve them. Even after my supervisor has taken his time, explaining how and what I needed to do, I might still not just get it right on the first trial.&lt;/p&gt;

&lt;p&gt;There was this night, I got really frustrated and left the office angry just because I couldn't complete my task, this was around the second to fourth week working at the company. &lt;/p&gt;

&lt;p&gt;The next day, when I got to work with a fresh mind, I asked questions to the other Frontend Developer who is a Guru BTW, and he helped me out fixing my issue. &lt;/p&gt;

&lt;p&gt;The main reason I got to the point of being frustrated was that I was stubborn and didn't want to follow my colleague's method, well being strong-headed didn't work out well 😂.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Own up to Your Mistakes
&lt;/h3&gt;

&lt;p&gt;I've made some mistakes and pushed them to production 🤦‍♂️. Mistakes such as not changing an API endpoint, so when users search for a product they get the wrong product, not checking properly if the webpage is fully responsive on all devices, using a test authorization key and pushed to production.&lt;/p&gt;

&lt;p&gt;Lots of mistakes, I've made but when it came to answering those mistakes, I learnt to admit that I was the cause of those issues and quickly I was able to fix them as well with some help from my colleagues.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Acquired knowledge on business terms
&lt;/h3&gt;

&lt;p&gt;Every morning by 9 am, Start of Business (SOB), we attend a stand-up meeting, where everyone has to talk about what they did the previous day and what they plan to do that current day. Questions during this period were also allowed.&lt;/p&gt;

&lt;p&gt;I got exposed to what each department of the company does, be it the sales department, customer care, marketing department etc. Through questions and just listening I learnt a lot.&lt;/p&gt;

&lt;p&gt;I got to know about setting OKR's (Objective Key Results), KPI (Key Performance Indicator) and many more organisational terms.&lt;/p&gt;

&lt;h3&gt;
  
  
  4. New Technologies
&lt;/h3&gt;

&lt;p&gt;I got to learn about new technologies I hadn't used before on the job, such as Next.js, Material UI, react-hook-form, SWR and lots more. Working with these tools daily got me acquitted with many concepts.&lt;/p&gt;

&lt;h3&gt;
  
  
  5. Reading an already written codebase saves you time
&lt;/h3&gt;

&lt;p&gt;Reading my colleagues code, what they've done in the past saved me a ton of time. Whenever I was tasked to do something similar to what have been done in the past, all I had to do was go read and understand what my colleagues had done.&lt;/p&gt;

&lt;p&gt;From there, I could manipulate their code and achieve what I want, a win-win situation right? But honestly most times I don't understand what some code does, once I know that the solution to my problem, all I do is copy and paste, a typical trait of a developer 😏 &lt;/p&gt;

&lt;h3&gt;
  
  
  6. Stress and Fatigue comes with the Job
&lt;/h3&gt;

&lt;p&gt;Sitting down all day, leaving the office late mostly around 6 pm - 7 pm, facing challenging tasks, all bring about stress and tiredness. Most days I felt like not doing anything cause the previous day I was stressed out.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;So this is something you might experience&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  7. How to be a team player
&lt;/h3&gt;

&lt;p&gt;Learnt how to listen to others opinions, instead of just jumping right into coding, how to comport what I say, how does it affect my colleagues, accepting when it is totally my fault when something is wrong.&lt;/p&gt;

&lt;p&gt;I got to collaborate with the backend developer, getting API endpoint from him, what parameter/data should be sent back to the backend, how's the API structured and stuff like that.&lt;/p&gt;

&lt;p&gt;Collaborated with the designer, the other Frontend developer and the Full-stack developer in other to achieve our tasks.&lt;/p&gt;

&lt;h3&gt;
  
  
  8. Working to get paid isn't easy
&lt;/h3&gt;

&lt;p&gt;Yeah, this is something I learnt while working since this was my very first job and a means to make money from my web skills. &lt;/p&gt;

&lt;p&gt;Waking up early, preparing for work by 6 am and being on the road just to get to work before 9 am and still getting home late mostly around 8 pm-ish or much more later every working day isn't easy. I applaud my parents for working and providing for me and my siblings, money is really hard to get.&lt;/p&gt;




&lt;p&gt;I could go on and on about what I've learnt during does 5 months but I'll stop here, I hope you've learnt something from my experience if you've gotten to this point of the article. &lt;/p&gt;

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

&lt;p&gt;In the end, I think I've acquired a good amount of knowledge from the company. I might have been lucky to get accepted but I went for what I wanted.&lt;/p&gt;

&lt;p&gt;So I'll say, go for what you want, make sure it's a place you can learn something new every day, tackle challenging problems and eventually solve them.&lt;/p&gt;

&lt;p&gt;I had a wonderful team to work with, people I could learn from, a wonderful supervisor that wanted me to grow and learn, a CEO that leads by example, overall it was a wonderful experience working at the company. Grateful for the push and complicated task I was assigned 😏. Thank you &lt;a href="https://vasiti.com" rel="noopener noreferrer"&gt;Vasiti.com&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I'm also truly grateful to everyone that helped me in the process of looking for an IT placement, my parents, friends and family, grateful to people on Twitter that sent me applications to apply. Thank you all.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Thanks for reading ✌&lt;/strong&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>The World of Programming Paradigms</title>
      <dc:creator>Favourite Jome</dc:creator>
      <pubDate>Fri, 28 May 2021 18:46:13 +0000</pubDate>
      <link>https://dev.to/favouritejome/the-world-of-programming-paradigms-3hbi</link>
      <guid>https://dev.to/favouritejome/the-world-of-programming-paradigms-3hbi</guid>
      <description>&lt;p&gt;There are so many ways of writing programs, either by the programming language of choice or by the different features of a language. Understanding this fact will help you write more efficient programs if you ask me 😏.&lt;/p&gt;

&lt;p&gt;So, in this article, I'll be sharing what are programming paradigms and mentioning a few of the paradigms we have out there in the world of programming and also reasons to use a particle paradigm.&lt;/p&gt;




&lt;p&gt;"The world of programming paradigms" - From the statement, the words can be broken down into three, which are &lt;em&gt;"World"&lt;/em&gt;, &lt;em&gt;"Programming"&lt;/em&gt; and &lt;em&gt;"Paradigms"&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;Let's know what these words mean:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;World&lt;/strong&gt;: can be thought of as a pictural view of the region/domain. &lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Programming&lt;/strong&gt;: From the word programming, there's another word - program, so what's a program.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A &lt;strong&gt;program&lt;/strong&gt; is a set of instructions used to solve/perform a specific task/problem. &lt;/p&gt;

&lt;p&gt;With the word program being defined, now what's programming?&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Programming&lt;/strong&gt; is simply the act of writing programs.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Paradigms&lt;/strong&gt;: are a set of concepts, thought patterns used in a domain/field.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Programming Paradigms
&lt;/h2&gt;

&lt;p&gt;So, &lt;strong&gt;Programming Paradigm&lt;/strong&gt; can be thought of like a way/style of writing programs. Also, it can be viewed as ways programs are classified based on their features.&lt;/p&gt;

&lt;p&gt;There are so many programming paradigms out there, developed to solve problems and implemented in all programming languages like Java, C, JavaScript, etc. Due to the numerous paradigms, we are looking at just the two most common paradigms in this article.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Note: Programming Paradigms doesn't refer to a particular programming language but rather the way of writing programs in that programming language.&lt;/p&gt;

&lt;p&gt;Click here to view most of the &lt;a href="https://en.wikipedia.org/wiki/Programming_paradigm" rel="noopener noreferrer"&gt;Programming paradigm&lt;/a&gt; that exist.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Before proceeding further, you should know that mostly all recently used programming languages are multi-paradigm, meaning they can be written using not just one but as many paradigms supported in the language.&lt;/p&gt;

&lt;p&gt;There are two common programming paradigms, which are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Imperative programming paradigm&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Declarative programming paradigm&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Both programming paradigms can further be divided as shown in the image below:&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%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1621524352354%2Fhzvq76G5Y.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%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1621524352354%2Fhzvq76G5Y.png" alt="programming paradigms"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Note: There're more subdivisions to the Imperative programming paradigm and the Declarative programming paradigm, but we'll be concerned about the subdivisions shown in the image for this article.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  Imperative Programming Paradigm
&lt;/h3&gt;

&lt;p&gt;Firstly, what's the meaning of the word, Imperative?&lt;/p&gt;

&lt;p&gt;Imperative could mean something vitally important, crucial or an act of giving an authoritative command.&lt;/p&gt;

&lt;p&gt;So, therefore, In an Imperative Programming Paradigm, the order of steps is crucial, because the next step is mostly dependent on the previous step.&lt;/p&gt;

&lt;p&gt;Here's an example in JavaScript to demonstrate my point:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;sum&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;

&lt;span class="nx"&gt;sum&lt;/span&gt;&lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="c1"&gt;// sum = sum + 1&lt;/span&gt;
&lt;span class="nx"&gt;sum&lt;/span&gt;&lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt; &lt;span class="c1"&gt;// sum = sum + 2&lt;/span&gt;
&lt;span class="nx"&gt;sum&lt;/span&gt;&lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt; &lt;span class="c1"&gt;// sum = sum + 3&lt;/span&gt;

&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;sum&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="c1"&gt;// 6&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;From the snippet above, we notice that the variable &lt;code&gt;sum&lt;/code&gt; is initialised with the value &lt;code&gt;0&lt;/code&gt;. &lt;/p&gt;

&lt;p&gt;Then the next couple of line is dependent on the current value of the variable &lt;code&gt;sum&lt;/code&gt; which sums up to &lt;code&gt;6&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;From Imperative Programming Paradigm, other styles of writing programs were also derived and for this article, we'll be looking at two sub-modules which are &lt;strong&gt;Procedural programming&lt;/strong&gt; and &lt;strong&gt;Object-Oriented programming&lt;/strong&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Procedural Programming
&lt;/h3&gt;

&lt;p&gt;Procedural programming is derived from the &lt;strong&gt;Imperative Programming Paradigm&lt;/strong&gt;, which allows splitting of instructions into procedures also is concerned about the series of instructions to concur whereby each step relies on the previous step.&lt;/p&gt;

&lt;p&gt;Procedural programming is much more like an iterative approach to solving a task/problem using loops (&lt;code&gt;for&lt;/code&gt;, &lt;code&gt;while&lt;/code&gt;) and &lt;code&gt;if&lt;/code&gt; statements for control flow.&lt;/p&gt;

&lt;p&gt;Here's an example to find the sum of numbers from 0 to 10, written in JavaScript:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;sum&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;

&lt;span class="k"&gt;for &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nx"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;=&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nx"&gt;i&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;sum&lt;/span&gt;&lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="nx"&gt;i&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="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;sum&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="c1"&gt;// 55&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;From the snippet of code above, a &lt;code&gt;for&lt;/code&gt; loop that iterates from 0 to 10 adding the previous &lt;code&gt;sum&lt;/code&gt; variable with &lt;code&gt;i&lt;/code&gt; and then the final output of the variable &lt;code&gt;sum&lt;/code&gt; will be &lt;code&gt;55&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Some major procedural programming language includes Fortran, ALGOL, BASIC and Pascal but more examples are found here &lt;a href="https://en.wikipedia.org/wiki/List_of_programming_languages_by_type#Procedural_languages" rel="noopener noreferrer"&gt;List of programming languages by type - Procedural languages&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;a href="https://en.wikipedia.org/wiki/Procedural_programming" rel="noopener noreferrer"&gt;Click here to know more about Procedural Programming&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h4&gt;
  
  
  Why learn Procedural Programming?
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;It's simple.&lt;/li&gt;
&lt;li&gt;An easier way to keep track of program flow.&lt;/li&gt;
&lt;li&gt;It has the ability to be strongly modular or structured.&lt;/li&gt;
&lt;li&gt;Needs less memory: It's efficient and effective.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Object-Oriented Programming (OOP)
&lt;/h3&gt;

&lt;p&gt;In Object-Oriented Programming, the concept of classes and objects are used. The paradigms specialise in modularity, breaking real-world entities into objects that can be reused.&lt;/p&gt;

&lt;p&gt;Also, Object-Oriented Programming is based on the concept of objects where an object contains data/fields (attributes) and methods (behaviours).&lt;/p&gt;

&lt;p&gt;Some key characteristics of the OOP are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Class&lt;/strong&gt;: A class is a blueprint or template of an object.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Object&lt;/strong&gt;: An object is an instantiation of a class.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Abstraction&lt;/strong&gt;: This is the process of hiding away complexity and showing only what is need.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Inheritance&lt;/strong&gt;: enables hierarchical relationships between classes.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Encapsulation&lt;/strong&gt;: is the concept that binds together the data
and methods that manipulate the data, and that keeps both safe from outside
interference and misuse.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Polymorphism&lt;/strong&gt;: this is the process by which variables, methods or objects can take multiple forms.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Person&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nf"&gt;constructor&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;age&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;name&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;age&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;age&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;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Student&lt;/span&gt; &lt;span class="kd"&gt;extends&lt;/span&gt; &lt;span class="nc"&gt;Person&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nf"&gt;constructor&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;age&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;matricNo&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;level&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;super&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;age&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;matricNo&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;matricNo&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;level&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;level&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;

  &lt;span class="nf"&gt;getStudenDetails&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="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;name&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt; is of age &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;age&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;, 
his Matric Number is &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;matricNo&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt; and his in &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;level&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;L`&lt;/span&gt;
  &lt;span class="p"&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;student1&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Student&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Favourite&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;18&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;RUN/CMP/18/7796&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;300&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="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;student1&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getStudenDetails&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt;

&lt;span class="c1"&gt;// outputs&lt;/span&gt;
&lt;span class="c1"&gt;// 'Favourite is of age 18, his Matric Number is RUN/CMP/18/7796 and his in 300L'&lt;/span&gt;

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

&lt;/div&gt;



&lt;p&gt;From the snippet of code above, a class &lt;code&gt;Person&lt;/code&gt; was first declared with its data/attributes as &lt;code&gt;name&lt;/code&gt; and &lt;code&gt;age&lt;/code&gt;. Also, the &lt;code&gt;Person&lt;/code&gt; class is known as the Superclass because another class extends its properties.&lt;/p&gt;

&lt;p&gt;Next off, another class was declared as &lt;code&gt;Student&lt;/code&gt;, this class extends all the properties of the &lt;code&gt;Person&lt;/code&gt; class because all students are also a person and this brings about inheritance.&lt;/p&gt;

&lt;h4&gt;
  
  
  Why use/learn Database programming
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;Reuse of code through Inheritance.&lt;/li&gt;
&lt;li&gt;Flexibility through Polymorphism.&lt;/li&gt;
&lt;li&gt;High security with the use of data hiding (Encapsulation) and Abstraction mechanisms.&lt;/li&gt;
&lt;li&gt;An object-oriented programmer can stitch new software objects to make completely new programs.&lt;/li&gt;
&lt;li&gt;For faster development of programs.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Declarative Programming Paradigm
&lt;/h2&gt;

&lt;p&gt;Declarative programming is a style of building programs that express the logic of a computation without talking about its control flow.&lt;/p&gt;

&lt;p&gt;From the word, &lt;strong&gt;Declarative&lt;/strong&gt;; it means an announcement / a statement, so in this paradigm, the instructions that are to be carried out are declared meaning it doesn't need to be explicitly defined with how the instruction is to be meant done but just what is meant to be done.&lt;/p&gt;

&lt;p&gt;Imagine being asked to draw a rectangle on a book, an imperative approach would state the various procedures like drawing two parallel lines on both axes while a declarative approach would just state the end goal and doesn't care about the process takes.&lt;/p&gt;

&lt;p&gt;So the main differences are that imperative tells you &lt;strong&gt;how to do something&lt;/strong&gt; and declarative tells you &lt;strong&gt;what to do&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Declarative Programming also has some programming languages beneath it, we'll be looking at &lt;strong&gt;Functional Programming&lt;/strong&gt; and &lt;strong&gt;Database Programming&lt;/strong&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Functional Programming
&lt;/h3&gt;

&lt;p&gt;The functional programming paradigm is rooted in using mathematical operation, it's a way of writing programs elegantly like you'll think of when thinking about a problem.&lt;/p&gt;

&lt;p&gt;Also, Functional programming is the process of solving problems by composing pure functions, avoiding shared state, mutable data, and side effects. Functional programming is declarative rather than imperative, and application state flows through pure functions&lt;/p&gt;

&lt;p&gt;Terms like: Recursion, Memoization, Pure Function, Composition are used along with  Functional Programming. &lt;/p&gt;

&lt;p&gt;Let's say, a Fibonacci problem is to be solved, using a Functional approach makes the problem easier to solve and think about.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Each Fibonacci number is defined as the sum of the previous two Fibonacci numbers, so fibonacci(n) = fibonacci(n-1) + fibonacci(n-2). By convention, the first two numbers are fixed: fibonacci(0) = 0 and fibonacci(1) = 1.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Here's the Functional approach of solving a Fibonacci problem using JavaScript.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;recursiveFibonacci&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;n&lt;/span&gt;&lt;span class="p"&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="nx"&gt;n&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;==&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;
  &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt; &lt;span class="nx"&gt;n&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;return&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;

  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nf"&gt;recursiveFibonacci&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;n&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="o"&gt;+&lt;/span&gt; &lt;span class="nf"&gt;recursiveFibonacci&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;n&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nf"&gt;recursiveFibonacci&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;6&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="c1"&gt;// 8&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;Note, there some caveat to Functional Programmings, like the Memory Stackoverflow, but there are also solutions to this caveat like &lt;a href="https://youtu.be/-PX0BV9hGZY" rel="noopener noreferrer"&gt;Tail Call Optimation&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Read this wonder article to know more about Functional Programming: [Master the JavaScript Interview: What is Functional Programming?](&lt;a href="https://medium.com/javascript-scene/master-the-javascript-interview-what-is-functional-programming-7f218c68b3a0#:%7E:text=Functional%20programming%20(often%20abbreviated%20FP,state%20flows%20through%20pure%20functions.)" rel="noopener noreferrer"&gt;https://medium.com/javascript-scene/master-the-javascript-interview-what-is-functional-programming-7f218c68b3a0#:~:text=Functional%20programming%20(often%20abbreviated%20FP,state%20flows%20through%20pure%20functions.)&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Why use/learning Functional programming?
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;Functions can be coded quickly and easily.&lt;/li&gt;
&lt;li&gt;Unit testing is easier.&lt;/li&gt;
&lt;li&gt;Debugging is easier.&lt;/li&gt;
&lt;li&gt;Overall application is less complex since functions are pretty straightforward.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Database Programming
&lt;/h3&gt;

&lt;p&gt;A database is an organized collection of structured information, or data,&lt;br&gt;
typically stored electronically in a computer system. A database is usually&lt;br&gt;
controlled by a database management system (DBMS).&lt;/p&gt;

&lt;p&gt;To process the data and querying them, databases use tables. Data can then be&lt;br&gt;
easily accessed, managed, modified, updated, controlled and organized.&lt;/p&gt;

&lt;p&gt;Most databases use Structured Query Language (SQL) for writing and querying&lt;br&gt;
data.&lt;/p&gt;

&lt;p&gt;There're three major parts to Database Programming: &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Relational Database&lt;/li&gt;
&lt;li&gt;NoSQL Database&lt;/li&gt;
&lt;li&gt;Cloud Database&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;Read this article to know more about Databases: &lt;a href="https://www.edureka.co/blog/what-is-a-database/" rel="noopener noreferrer"&gt;What is a Database? - edureka&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Below, are simple declaration and schema declaration on what should be in a data show be in a database.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="k"&gt;DATABASE&lt;/span&gt; &lt;span class="n"&gt;Students&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="k"&gt;TABLE&lt;/span&gt; &lt;span class="n"&gt;ComputerScienceStudent&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
      &lt;span class="n"&gt;MatricID&lt;/span&gt; &lt;span class="nb"&gt;int&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="n"&gt;LastName&lt;/span&gt; &lt;span class="nb"&gt;varchar&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;25&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
      &lt;span class="n"&gt;FirstName&lt;/span&gt; &lt;span class="nb"&gt;varchar&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;25&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;/div&gt;



&lt;h4&gt;
  
  
  Why learn/use Database Programming
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;When you need to handle massive amount of data.&lt;/li&gt;
&lt;li&gt;With the help of built-in functionalities in a database, we can easily validate data coming into the database.&lt;/li&gt;
&lt;li&gt;Easy to update data: Data Manipulation Languages (DML) such as SQL are used to
update data in a database easily.&lt;/li&gt;
&lt;li&gt;Data integrity: With the help of built-in validity checks, we can ensure the consistency of data.&lt;/li&gt;
&lt;/ul&gt;

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

&lt;p&gt;I'm pretty sure in some ways, directly or indirectly you've written programs using the combinations of all the Programming paradigms mentioned above, probably without your knowledge. Well, know you know some of the most used programming paradigms and reasons to use them.&lt;/p&gt;

&lt;p&gt;I hope you found the article useful, thanks for reading!&lt;/p&gt;

&lt;h2&gt;
  
  
  References
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.freecodecamp.org/news/what-exactly-is-a-programming-paradigm/" rel="noopener noreferrer"&gt;What exactly is a programming paradigm? - Freecodecamp&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://en.wikipedia.org/wiki/List_of_programming_languages_by_type" rel="noopener noreferrer"&gt;List of programming languages by type - Wikipedia&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://hackr.io/blog/programming-paradigms" rel="noopener noreferrer"&gt;Programming Paradigms: A must know for all Programmers - hackr.io&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://java-programming.mooc.fi/part-7/1-programming-paradigms" rel="noopener noreferrer"&gt;Programming paradigms - java-programming.mooc.fi&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.edureka.co/blog/what-is-a-database/" rel="noopener noreferrer"&gt;What is a Database? Definition, Types and Components&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
    </item>
    <item>
      <title>Hacktoberfest Completed 2020</title>
      <dc:creator>Favourite Jome</dc:creator>
      <pubDate>Mon, 19 Oct 2020 12:54:20 +0000</pubDate>
      <link>https://dev.to/favouritejome/hacktoberfest-completed-2020-32bh</link>
      <guid>https://dev.to/favouritejome/hacktoberfest-completed-2020-32bh</guid>
      <description>&lt;h2&gt;
  
  
  What I Learned From Hacktoberfest
&lt;/h2&gt;

&lt;p&gt;This is my first hacktoberfest event ever and it was awesome. Due to my excitement, I made 3 Pull Request on the 1st of October (not spams BTW). &lt;/p&gt;

&lt;p&gt;I know right, that's funny, well all 3 Pull Request weren't merged because I was making changes unknowingly to me, to package.json file that weren't supposed to be changed (increase in version numbers).&lt;/p&gt;

&lt;p&gt;But, what I've learnt is the process it entails to contribute to a project. I learnt how to created my own issues due to a problem I'll like to fix or to be fixed by others. Then sync projects to my local repository. The steps of making a good Pull Request.&lt;/p&gt;

&lt;p&gt;Through all these processes involved with contributing, I've got familiar and comfortable with git and GitHub.&lt;/p&gt;

&lt;p&gt;So if you're thinking, if you should contribute or not, you should TOTALLY contribute.&lt;/p&gt;

</description>
      <category>hacktoberfest</category>
    </item>
  </channel>
</rss>
