<?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: skaytech</title>
    <description>The latest articles on DEV Community by skaytech (@skaytech).</description>
    <link>https://dev.to/skaytech</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%2F397430%2F921cb79a-3136-4f10-9b0c-2236c2bb0951.png</url>
      <title>DEV Community: skaytech</title>
      <link>https://dev.to/skaytech</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/skaytech"/>
    <language>en</language>
    <item>
      <title>What is Technical Debt?</title>
      <dc:creator>skaytech</dc:creator>
      <pubDate>Sat, 28 Nov 2020 00:06:28 +0000</pubDate>
      <link>https://dev.to/skaytech/what-is-technical-debt-1mmi</link>
      <guid>https://dev.to/skaytech/what-is-technical-debt-1mmi</guid>
      <description>&lt;h2&gt;
  
  
  What is Technical Debt?
&lt;/h2&gt;

&lt;p&gt;I would like to simply define Technical debt as the actions taken by the engineering team to expedite delivery for a piece of functionality that often needs to be refactored at a later point in time. However, there's no one single definition that exists technically.&lt;/p&gt;

&lt;p&gt;The term 'Technical debt' was originally coined by software developer, 'Ward Cunningham'. He had coined this term to explain to Non-Technical stakeholders why budgeting needs to be allocated for refactoring.&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%2Fv1606521297991%2FDDb2mzWe5.jpeg" 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%2Fv1606521297991%2FDDb2mzWe5.jpeg" alt="cytonn-photography-n95VMLxqM2I-unsplash.jpg"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Cunningham's explanation to the stakeholders was along the following lines:&lt;/p&gt;

&lt;p&gt;"With borrowed money, you can do something sooner than you might otherwise, but then until you pay back that money you’ll be paying interest. I thought borrowing money was a good idea, I thought that rushing software out the door to get some experience with it was a good idea, but that of course, you would eventually go back and as you learned things about that software you would repay that loan by refactoring the program to reflect your experience as you acquired it."&lt;/p&gt;

&lt;h2&gt;
  
  
  Why Technical Debt is necessary?
&lt;/h2&gt;

&lt;p&gt;Typically an early-stage startup needs to validate their product idea first and ensure they can sign up customers rather than build out all the nuts n bolts of the feature. In order to do that, agility is of paramount importance. The engineering team deliberately incurs tech debt to reduce the time to market.&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%2Fv1606521308884%2FuWbqm--8b.jpeg" 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%2Fv1606521308884%2FuWbqm--8b.jpeg" alt="micheile-henderson-SoT4-mZhyhE-unsplash.jpg"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;However, often companies have known to abuse this term and prescribe, “Hack it, for now, fix it later” mantra to ship the project fast and acquire more users than their competition. But, often they don't realize that having technical debt has its consequences. Before we dive into that, let us find out the various types of technical debt that exists and how to address them.&lt;/p&gt;

&lt;h2&gt;
  
  
  Types of Technical Debt
&lt;/h2&gt;

&lt;p&gt;While you can categorize technical debt into more granular level such as code debt, design debt, infrastructure debt, testing debt, etc. I would broadly want to classify them into the following categories:&lt;/p&gt;

&lt;h3&gt;
  
  
  Planned Technical Debt
&lt;/h3&gt;

&lt;p&gt;As explained above, it is a decision made by the engineering team to take a short-cut for shipping the feature faster.&lt;/p&gt;

&lt;h4&gt;
  
  
  How to address them?
&lt;/h4&gt;

&lt;p&gt;The tech leads/managers must ensure to track the tech debt in the backlog and address them as the product grows. The Product &amp;amp; Sales team must be made aware of the consequences of not addressing them in a timely manner and everyone should be held accountable to ensure that the tech debt is addressed in a timely manner.&lt;/p&gt;

&lt;h3&gt;
  
  
  Unintentional Technical Debt
&lt;/h3&gt;

&lt;p&gt;This occurs generally due to the lack of understanding of the product or poor communication that exists in the translation of business goals or simply poor engineering practices.&lt;/p&gt;

&lt;h4&gt;
  
  
  How to address them?
&lt;/h4&gt;

&lt;p&gt;Retrospectives are necessary no matter how fast a project needs to build. It is imperative to reflect back to find out what went well &amp;amp; what needs to change. Tech leads/managers must involve themselves in understanding the true business objectives and the product team must keep validating the software being built and provide feedback incrementally.&lt;/p&gt;

&lt;h3&gt;
  
  
  Unavoidable Technical Debt
&lt;/h3&gt;

&lt;p&gt;When there's a huge change in project scope or a complete pivot of technology choice during mid-project, it leads to unavoidable technical debt. &lt;/p&gt;

&lt;h4&gt;
  
  
  How to address them?
&lt;/h4&gt;

&lt;p&gt;Typically, this is the hardest of them all and usually, the debt is paid back in phases. For e.g. mid-project, the engineering team decides to move from React to Vue. The way to do this would be to create new features for the project in Vue and migrate the existing features from React to Vue in phases.&lt;/p&gt;

&lt;h2&gt;
  
  
  Is Technical Debt bad?
&lt;/h2&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%2Fv1606521458922%2FV1MhB3s-1.jpeg" 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%2Fv1606521458922%2FV1MhB3s-1.jpeg" alt="ayo-ogunseinde-sibVwORYqs0-unsplash.jpg"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It's yes and no based on which point in software development you view it. For example, at an early stage, having a technical debt is considered a good thing to ship your product faster to the hands of the end-users. However, as the product matures, it is important to pay back the debt to ensure the product is stable and can actually scale as more and more users start adopting the product.&lt;/p&gt;

&lt;p&gt;One important thing to acknowledge is that Technical debt unlike Financial debt is much harder to detect and people generally tend to ignore it unless it really becomes a problem. It is important to have the consequences of technical debt explained to all stakeholders and ensure that the responsibility and accountability are shared between the engineering and product teams.&lt;/p&gt;

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

&lt;p&gt;To summarize, technical debt can be described as the consequences of software development actions that intentionally or unintentionally prioritize client value and/or project constraints such as delivery deadlines, over more technical implementation, and design considerations.&lt;/p&gt;

&lt;p&gt;Technical debt should not be confused with the mess. A mess is a just mess that is being created based on laziness and unprofessionalism and has no chance of payback in the future.&lt;/p&gt;

&lt;p&gt;I hope you enjoyed the article. Please don't forget to subscribe to my newsletter and connect with me on Twitter &lt;a href="https://twitter.com/skay_tech" rel="noopener noreferrer"&gt;@skaytech&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  You may also enjoy the following articles:
&lt;/h3&gt;

&lt;h3&gt;
  
  
  You will also enjoy the following articles:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://dev.to/skaytech/why-you-should-choose-to-learn-react-2g70"&gt;Why you should learn 'React'?&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/skaytech/the-react-ecosystem-1l05"&gt;The React Ecosystem&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/skaytech/async-functions-chapter-3-async-await-89"&gt;Async/Await explained in JavaScript&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/skaytech/async-functions-chapter-2-promises-1c6i"&gt;What are JavaScript Promises&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/skaytech/async-functions-chapter-1-callback-3fkm"&gt;JavaScript Callbacks Explained&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/skaytech/javascript-objects-31lb"&gt;Everything you need to know about JavaScript Objects&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/skaytech/all-about-javascript-functions-1l5f"&gt;Everything you need to know about JavaScript Funtions&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/skaytech/es6-higher-order-functions-495e"&gt;ES6 - Higher Order Functions&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/skaytech/es6-spread-operator-3ced"&gt;ES6 - Spread Operator&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/skaytech/es6-understanding-destructuring-49np"&gt;ES6 - Understanding Destructuring&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/skaytech/es6-arrow-functions-2m0l"&gt;ES6 - Arrow Functions&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/dailydotdev/what-is-currying-in-javascript-3n9l"&gt;What is Currying in JavaScript?&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/skaytech/understanding-hoisting-b48"&gt;Understanding Hoisting&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/skaytech/a-gentle-introduction-to-the-big-o-notation-time-space-complexity-3hdd"&gt;Introduction to Big O Notation, Time &amp;amp; Space Complexity&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>100daysofcode</category>
      <category>codenewbie</category>
      <category>startup</category>
      <category>techdebt</category>
    </item>
    <item>
      <title>How to provide estimates as a Junior Developer?</title>
      <dc:creator>skaytech</dc:creator>
      <pubDate>Fri, 13 Nov 2020 06:14:08 +0000</pubDate>
      <link>https://dev.to/skaytech/how-to-provide-estimates-as-a-junior-developer-a2n</link>
      <guid>https://dev.to/skaytech/how-to-provide-estimates-as-a-junior-developer-a2n</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;I recently interacted with a friend who had just started out as a developer and she told me that she found it really hard to provide estimates against the user stories assigned to her.&lt;/p&gt;

&lt;p&gt;We had an interesting conversation following that and I thought this might actually be applicable not just to her, but, a much wider audience who might be going through the same thing.&lt;/p&gt;

&lt;p&gt;In this article, I will provide my thoughts on how you can go about providing estimates when you start out as a new (junior) developer. &lt;/p&gt;

&lt;p&gt;Please do note that the article is in NO way "the only" way to provide estimates and it may largely vary based on the project. This is merely some things to consider that can help you provide estimates and manage insecurities that arise while providing them as a new developer.&lt;/p&gt;

&lt;h2&gt;
  
  
  Estimation
&lt;/h2&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%2Fv1605246551306%2FOdlqsAuPN.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%2Fv1605246551306%2FOdlqsAuPN.png" alt="2-Estimate.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;One of the first things to understand whether you are a junior or a senior developer is that the word 'Estimation' means it's a 'ballpark', i.e., it is not supposed to be exact. Providing the amount of time to complete a task largely varies based on a number of factors such as your current skill level, your overall experience in the field to understand requirements, whether you are building something ground up vs adding functionality to an existing product, etc.&lt;/p&gt;

&lt;p&gt;For example, let's assume you have joined a project which has a fairly large codebase. When you are asked to estimate for a feature, your first instinct would be to provide estimates for the time it takes to complete building out the feature. However, what is often 'untold' is the fact, you'll also need to include time in your estimates to perform 'impact analysis', i.e., performing analysis to ensure that the code you add does not impact any other existing functionality. Ensuring that you consider providing estimates for things that are untold requires some amount of experience and hence it is always recommended to have a senior review your estimates before providing them to the lead or manager.&lt;/p&gt;

&lt;h2&gt;
  
  
  Key Terminologies
&lt;/h2&gt;

&lt;p&gt;I'm providing a list of key things that are commonly used with the Agile development workflow.&lt;/p&gt;

&lt;h3&gt;
  
  
  User Story
&lt;/h3&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%2Fv1605246705912%2F3Mb9XJiCO.jpeg" 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%2Fv1605246705912%2F3Mb9XJiCO.jpeg" alt="linkedin-sales-navigator-4rvBjoQWERk-unsplash.jpg"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In an Agile process, a feature would be written in terms of a user story, i.e., what the feature means to the end-user. Generally, user stories will be worded like 'As a user, I should be able to do this, to meet a particular outcome'. A good user story should have the acceptance criteria clearly specified that should help you and others identify what are the things that need to be verified to mark the user story completed.&lt;/p&gt;

&lt;p&gt;Every user story is sized based on the complexity level and 'T-Shirt' sizing is a common methodology followed in the industry. Every user story is marked with a sizing such as XS, S, M, L, XL based on the level of complexity. The sizing will most likely be provided by the senior members of the team, since, they understand the product and are generally more experienced with the software. As a junior developer, you will be required to break down the user story into smaller tasks and estimate them.&lt;/p&gt;

&lt;h3&gt;
  
  
  Scope
&lt;/h3&gt;

&lt;p&gt;Scope can simply be explained as the agreed set of things that need to be developed as a part of the user story. Usually, during the development process, things might arise which have not been explicitly stated in the user story and it is important to call them out and notify your senior in the team. &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%2Fv1605246801437%2FMz6TInPvQ.jpeg" 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%2Fv1605246801437%2FMz6TInPvQ.jpeg" alt="austin-distel-rxpThOwuVgE-unsplash.jpg"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Most likely that might get added to the current story or if the impact is much larger, a new story might get created to address that. However, the important thing to note is that, if you have to develop that as a part of the same user story, your initial estimates will get impacted. &lt;/p&gt;

&lt;p&gt;This is something very hard to spot for a new developer and a good lead should explain this and guide you on how to handle scope creep.&lt;/p&gt;

&lt;h3&gt;
  
  
  Velocity
&lt;/h3&gt;

&lt;p&gt;The term 'Velocity' is used to measure how fast a developer can complete the user story assigned to them. The same user story might take 4 hours for a senior developer to complete, but can take up to, 2 days for a junior developer to complete.&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%2Fv1605246851284%2FEJgKjtuQH.jpeg" 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%2Fv1605246851284%2FEJgKjtuQH.jpeg" alt="mark-tuzman-kwXwZxKVgao-unsplash.jpg"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You must understand that it is completely 'normal' and you must feel free to communicate with your seniors about how you feel and ask them for any specific directions/guidelines they recommend for providing estimates.&lt;/p&gt;

&lt;p&gt;Imposter Syndrome is a big thing to tackle at this point and your ego might also take a hit sometimes. Acknowledge that and keep telling yourself that this is a learning phase and it's just a matter of time before you will have command over the product and technology.&lt;/p&gt;

&lt;h3&gt;
  
  
  Capacity
&lt;/h3&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%2Fv1605247105228%2FlbSGV5EBU.jpeg" 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%2Fv1605247105228%2FlbSGV5EBU.jpeg" alt="peter-feghali-HJpISHFSkJo-unsplash.jpg"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This one is fairly simple. Capacity planning is done before the beginning of the sprint to find out if the developers are on any planned vacation. You may ask, how does this change the estimates? While in most cases it does not. However, if you are going a break of a week or more, you must ensure that you reach out to the team and find out if something has changed that might impact your coding before your break. Also, it takes usually takes a day to build context and get back to that 'work mindset' after a super relaxing holiday 🙂&lt;/p&gt;

&lt;h2&gt;
  
  
  General Guidelines for Estimation
&lt;/h2&gt;

&lt;p&gt;I would recommend the following steps for providing estimates when you are starting out as a new developer:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Break down the task into the most fundamental thing. For example, building the Home page of the application can be broken up into building individual components on the homepage.&lt;/li&gt;
&lt;li&gt;Spend some time to understand if there are any more questions to clarify the requirement or things to be called out at this stage that will impact the estimation. &lt;/li&gt;
&lt;li&gt;Think through the corner cases (not just the happy path ones) and find out if they'll impact your estimates in any way.&lt;/li&gt;
&lt;li&gt;Add estimates in hours against each task.&lt;/li&gt;
&lt;li&gt;Your estimates must include time to write unit tests.&lt;/li&gt;
&lt;li&gt;Review your estimates with a senior developer and take notes of the feedback provided by the senior developer.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Even after this, it might be possible, you might take additional time to complete the task and that is perfectly normal. But, it is important to record how much more additional time you've spent as compared to the original estimates. This is 'super important' because, it's a big learning for yourself and your team on where your current skill/understanding level is, and in due time this number will improve as you gain more expertise in the project.&lt;/p&gt;

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

&lt;p&gt;While it can be daunting and stressful as a junior developer while providing estimates in the beginning, remember in due time you'll gain expertise and knowledge about the project and your estimation will start to get much better.&lt;/p&gt;

&lt;p&gt;A good project manager or a lead would constantly gather statistics regarding your estimates and provide you with constant feedback on how to improve them. As your productivity improves, they'll be aware of that and keep sending more work your way.&lt;/p&gt;

&lt;p&gt;I sincerely hope this article helped you with some knowledge of providing software estimates as a developer who is just starting out in the industry.&lt;/p&gt;

&lt;p&gt;Don't forget to subscribe to my newsletter and connect with me on Twitter &lt;a href="https://twitter.com/skay_tech" rel="noopener noreferrer"&gt;@skaytech&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  You may also like the following articles:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://dev.to/skaytech/hiring-software-engineers-for-start-ups-an-engineering-manager-s-perspective-5b50"&gt;Hiring Software Engineers for Startups - An Engineering Manager's view&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/skaytech/why-do-you-want-to-work-for-us-interview-question-demystified-1gh2"&gt;Why do you want to work for us?&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/skaytech/how-to-evaluate-your-product-idea-for-market-fitment-n5e"&gt;How to evaluate your idea for Product Market Fitment&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/skaytech/what-is-value-proposition-1da4"&gt;What is Value Proposition?&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/skaytech/5-must-read-tips-to-write-a-killer-blog-article-510c"&gt;5 Must-Read Tips for a Killer Blog Article&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/skaytech/history-of-ecma-es5-es6-beyond-lpe"&gt;History of ECMAScript and Beyond&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/skaytech/a-practical-guide-to-help-you-stay-more-organised-productive-3p0g"&gt;A Practical Guide to help you stay more organized and productive&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/skaytech/what-is-this-in-javascript-3d3i"&gt;What is 'this' in JavaScript?&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>codenewbie</category>
      <category>webdev</category>
      <category>agile</category>
      <category>100daysofcode</category>
    </item>
    <item>
      <title>Why work at a Startup and What to expect?</title>
      <dc:creator>skaytech</dc:creator>
      <pubDate>Fri, 06 Nov 2020 08:47:20 +0000</pubDate>
      <link>https://dev.to/skaytech/why-work-at-a-startup-and-what-to-expect-4ip8</link>
      <guid>https://dev.to/skaytech/why-work-at-a-startup-and-what-to-expect-4ip8</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;This is an article based on my experience working with startups for 4+ years. I have previously worked with enterprises and product companies, but with startups, the kind of unique experience of having both creative freedom and increased responsibility was probably the most fulfilling in my career.&lt;/p&gt;

&lt;p&gt;While startup culture is often glamorized with a whole lot of cool-looking offices, young vibrant engineers, there are a lot of challenges that are important to be prepared for.&lt;/p&gt;

&lt;p&gt;In this article, I will share my experiences on why you should consider working at a startup and what to expect while working with startups.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why work with Startups?
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Creative Freedom
&lt;/h3&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%2Fv1604570619554%2FbJzWEiZLF.jpeg" 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%2Fv1604570619554%2FbJzWEiZLF.jpeg" alt="joshua-coleman-uB16HY_ah4o-unsplash.jpg"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I think the best way to explain this in a single phrase would be 'If you can do it, you can lead it'. Startups are generally known for having small teams and while this may mean that your workload increases, it also offers creative freedom. You can shape your job description by simply raising your hand or offering a solution.&lt;/p&gt;

&lt;p&gt;For example, while you might have been hired to do a developer job, you can still jump into your areas of interest such as design or documentation, and lead the way if there's an opportunity. &lt;/p&gt;

&lt;h3&gt;
  
  
  Career Development
&lt;/h3&gt;

&lt;p&gt;With startups, there aren't layers of management to weed through, so if you started off taking up a particular role and you realized that your skills probably suit a different role in the team, you have the freedom to explore such a thing and slowly turn that into your career.&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%2Fv1604570723898%2FTfgOR760P.jpeg" 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%2Fv1604570723898%2FTfgOR760P.jpeg" alt="hunters-race-MYbhN8KaaEc-unsplash.jpg"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;There's a significant gap even today on what a university teaches and what skills are needed on a real job and the option to explore your career within a job is very liberating.&lt;/p&gt;

&lt;h3&gt;
  
  
  Develop Resiliency
&lt;/h3&gt;

&lt;p&gt;This one is my personal favorite. As humans, we have been in-built with a mechanism to resist failure. However, failure is essential to any growth. In startups, you are burning your hands constantly. Everyone fails, and it's considered fine. Oftentimes there are no wrong answers and some solution that’s more correct than another one may well emerge as the winning formula. However, failure will not only make you a seasoned professional with hands-on learning but a resilient individual.&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%2Fv1604570804771%2Fq1-lX-nCW.jpeg" 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%2Fv1604570804771%2Fq1-lX-nCW.jpeg" alt="gmb-fitness-NYCVycvTbek-unsplash.jpg"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you join a healthy startup, you’ll see the commitment and conviction of founders, and the team will hold onto each other – celebrating success together and taking failure in collective stride. As a result, you’ll become a problem solver, think outside the box, and build your ability to find creative solutions to problems, solutions that have the potential to move the needle significantly.&lt;/p&gt;

&lt;h3&gt;
  
  
  A Unified feeling and connecting over the mission
&lt;/h3&gt;

&lt;p&gt;A startup team works shoulder-to-shoulder. You’ll spend a lot of hours collaborating with the same few people. Startup culture is very very important and the people behind the startup need to connect with the idea. The team will have to be a network of like-minded people who have the same agenda. This is super important becomes the emotional connection towards a unified cause increases your resolve and you'll push each other to grow and in return create long-lasting friendships out of the understanding.&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%2Fv1604571627411%2FW6-a_eB45.jpeg" 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%2Fv1604571627411%2FW6-a_eB45.jpeg" alt="spacex-YSvUYqf9Mjk-unsplash.jpg"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;While the above are certainly some of the reasons why you should try to work for a startup, I'll also want to mention a few points on what to expect while working with startups.&lt;/p&gt;

&lt;h2&gt;
  
  
  What to expect while working with Startups?
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Be comfortable with uncertainty
&lt;/h3&gt;

&lt;p&gt;You'll need to embrace uncertainty as much as the fish would take to the water or at least 80% of it. It is not easy for everyone to embrace uncertainly. Not at least at first, but, ensuring you communicate to the team certainly relives pressure from self and also ensures that everyone understands that you are charting unknown waters.&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%2Fv1604570970663%2Fxg_pYQQ76.jpeg" 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%2Fv1604570970663%2Fxg_pYQQ76.jpeg" alt="luke-stackpoole-M5q1m4n9ES8-unsplash.jpg"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You'll be encountered with questions that no one has the answers to, even the founders, but this is what makes a startup so special – you’re finding out together. Once you are through once such an experience, you would have learned a life skill of navigating through uncertainty.&lt;/p&gt;

&lt;h3&gt;
  
  
  Be Independent and a team player
&lt;/h3&gt;

&lt;p&gt;While a healthy startup culture will rally the team together, understand how to structure your work. Let yourself be pushed outside of your comfort zone. At a startup, there is little traditional ‘management’. You’ll need to be a self-starter and know how to manage your time.&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%2Fv1604571185579%2Fxra0Rqt_d.jpeg" 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%2Fv1604571185579%2Fxra0Rqt_d.jpeg" alt="giorgio-trovato-iP4Ju2-4paQ-unsplash.jpg"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;There will be days when it feels like a lot; stay motivated. You’re growing. Structuring how you spent your time and proactively checking in with your manager to ensure your Key Performance Indicators (KPIs) remain aligned will help you stay on course and feel connected. Know when to ask for help and communicate with your team. Use your team as support and as a pillar of strength. I promise whatever you’re feeling you’re not alone, and reaching out will only help everyone involved.&lt;/p&gt;

&lt;h3&gt;
  
  
  Find your Sparkle
&lt;/h3&gt;

&lt;p&gt;Self-doubt can be an outcome of all-round rapid development. Focus on the larger goal and your part in it. Ask where you shine. Sometimes we can’t see our own sparkle. Again, with little traditional ‘management’ the standard review process most likely won’t exist the way it does at large, established companies.&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%2Fv1604571235892%2FK_mfweMvn.jpeg" 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%2Fv1604571235892%2FK_mfweMvn.jpeg" alt="dawid-zawila-E9b5kcgCR9Y-unsplash.jpg"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Ask for the time you need, but be sure to ask for clear feedback. Reflect on your KPIs to make sure that your goals are well aligned with the company. Everyone is low on resources and time is the most important, so be specific where you need support and take ownership of your projects.&lt;/p&gt;

&lt;h3&gt;
  
  
  Enjoy the ride
&lt;/h3&gt;

&lt;p&gt;There may be frequent spurts of feedback and periods with none at all. Write it down and keep it for later. Time moves FAST in a startup. Make sure that you remember to write down all the lessons you learn because they will be vast. Keep a journal to remember what you did well, what you learned, and to keep the memories.&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%2Fv1604571281469%2FjdTcMoWIs.jpeg" 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%2Fv1604571281469%2FjdTcMoWIs.jpeg" alt="josh-hild-JYQkVLOPy8U-unsplash.jpg"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;One of the startup customers I had worked with, Carlos, who's currently an Engineer Manager at Google, is still my close friend and I remember the fights, arguments, laughter, and euphoric moments that we celebrated together while taking an idea from concept to launch. It is still one of my most fond memories of my career.&lt;/p&gt;

&lt;h3&gt;
  
  
  Conclusion
&lt;/h3&gt;

&lt;p&gt;To summarize while working in a startup has its challenges, it also is equally rewarding in terms of experience. Not everyone likes it or is up for a challenge as steep as working for a startup. But, I would urge you to consider working with a startup at least once in your career. &lt;/p&gt;

&lt;p&gt;I hope you enjoyed the article. Don't forget to connect with me on Twitter &lt;a href="https://twitter.com/skay_tech" rel="noopener noreferrer"&gt;@skaytech&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  You may also like the following articles:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://dev.to/skaytech/hiring-software-engineers-for-start-ups-an-engineering-manager-s-perspective-5b50"&gt;Hiring Software Engineers for Startups - An Engineering Manager's view&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/skaytech/why-do-you-want-to-work-for-us-interview-question-demystified-1gh2"&gt;Why do you want to work for us?&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/skaytech/how-to-evaluate-your-product-idea-for-market-fitment-n5e"&gt;How to evaluate your idea for Product Market Fitment&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/skaytech/what-is-value-proposition-1da4"&gt;What is Value Proposition?&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/skaytech/5-must-read-tips-to-write-a-killer-blog-article-510c"&gt;5 Must-Read Tips for a Killer Blog Article&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/skaytech/history-of-ecma-es5-es6-beyond-lpe"&gt;History of ECMAScript and Beyond&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/skaytech/a-practical-guide-to-help-you-stay-more-organised-productive-3p0g"&gt;A Practical Guide to help you stay more organized and productive&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/skaytech/what-is-this-in-javascript-3d3i"&gt;What is 'this' in JavaScript?&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>startup</category>
      <category>codenewbie</category>
      <category>100daysofcode</category>
      <category>webdev</category>
    </item>
    <item>
      <title>A Detailed overview of NPM, Registry, CLI &amp; it's related Components</title>
      <dc:creator>skaytech</dc:creator>
      <pubDate>Mon, 02 Nov 2020 05:51:36 +0000</pubDate>
      <link>https://dev.to/skaytech/a-detailed-overview-of-npm-registry-cli-it-s-related-components-f8o</link>
      <guid>https://dev.to/skaytech/a-detailed-overview-of-npm-registry-cli-it-s-related-components-f8o</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;In this article, we will look at an overview of what NPM is. When we usually run 'npm install', we know that certain packages are being created inside the 'node_modules' folder. Let us look at what they mean and what role they play in order to support running your web application. &lt;/p&gt;

&lt;p&gt;We will look at the following topics in detail:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;What is npm, Registry, and CLI?&lt;/li&gt;
&lt;li&gt;How to initialize your project with NPM?&lt;/li&gt;
&lt;li&gt;A detailed overview of 'package.json' and it's important properties.&lt;/li&gt;
&lt;li&gt;How to install and publish your packages?&lt;/li&gt;
&lt;li&gt;Version management of packages.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This article is based on my learnings from Tyler Mcginnis's course on React which you find &lt;a href="https://ui.dev/"&gt;over here.&lt;/a&gt;&lt;/p&gt;

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

&lt;p&gt;For a long time, I assumed 'NPM' meant 'Node Package Manager'. But, strangely and funnily it's not. &lt;a href="https://www.npmjs.com/"&gt;'npm, Inc.'&lt;/a&gt; is a for-profit, venture-backed company founded in 2014 and was acquired by Github in March of 2020.&lt;/p&gt;

&lt;p&gt;npm.inc is behind the creation and management of the following components:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Node Package Manager&lt;/li&gt;
&lt;li&gt;Registry&lt;/li&gt;
&lt;li&gt;npm CLI&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;But before, we jump into the details of the above components, let us take a step back and find out what problem NPM solves.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why do we need a Package Manager?
&lt;/h2&gt;

&lt;p&gt;Whenever we write any web application, it is generally composed of individual modules that are often bundled together.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--11XJdc5M--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1604287989886/1a0X5sy2m.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--11XJdc5M--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1604287989886/1a0X5sy2m.png" alt="npm.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If we have to use a certain package with our application, the traditional way of doing it is using the 'script' tag as shown below:&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="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;body&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;

  &lt;span class="p"&gt;...&lt;/span&gt;

&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;script&lt;/span&gt; &lt;span class="nx"&gt;src&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/script&amp;gt; &lt;/span&gt;&lt;span class="err"&gt; 
&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;script&lt;/span&gt; &lt;span class="nx"&gt;src&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;libs/jquery2.1.4.min.js&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/script&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/body&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;While the above works, there are the following disadvantages using the above approach:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;If the CDN network is down, then your application cannot access the resource.&lt;/li&gt;
&lt;li&gt;In the JQuery import example above, while you have downloaded the library to your application. Managing version related changes are left up to us in terms of manually fetching the latest version and replacing them in our code, which is far from ideal.&lt;/li&gt;
&lt;li&gt;Finally, the biggest them of all is the order of script tags placed inside the body tag which is required in order for them to be referenced appropriately inside your application.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;'npm' precisely solves the above problems and more in terms of managing the way your packages are referenced, versioning, and more.&lt;/p&gt;

&lt;h2&gt;
  
  
  Node Package Manager
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--G7QQClLU--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1604287956651/Jfvb2GjLZ.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--G7QQClLU--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1604287956651/Jfvb2GjLZ.jpeg" alt="npm.jpg"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The node package manager manages the below-mentioned points and does it well:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Provides a way to package your program for others to consume.&lt;/li&gt;
&lt;li&gt;Provides a way to download the packages from a centralized repository.&lt;/li&gt;
&lt;li&gt;Makes it easier for you to manage &amp;amp; switch versions.&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Registry
&lt;/h4&gt;

&lt;p&gt;The registry is a centralized repository that contains a list of all npm packages that have been published by others.&lt;/p&gt;

&lt;h4&gt;
  
  
  npm CLI
&lt;/h4&gt;

&lt;p&gt;npm CLI provides you a way for you to install &amp;amp; publish the packages using the command-line interface. &lt;/p&gt;

&lt;h3&gt;
  
  
  How to &lt;strong&gt;install npm?&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;'npm' comes with Node. Hence, if you have installed NodeJS, then you should already have npm as it comes with it. You can install Node from &lt;a href="https://nodejs.org/en/download/"&gt;here&lt;/a&gt; or if you are using Windows, I have a detailed article on how to install Node using a node version manager or 'nvm' &lt;a href="https://blog.skay.dev/how-to-install-node-version-manager-nvm-for-windows-10"&gt;over here.&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If Node and npm are installed correctly, you should be able to run the following commands in your terminal to check which versions you have installed.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;node &lt;span class="nt"&gt;-v&lt;/span&gt; &lt;span class="c"&gt;# My installed version: v11.10.0&lt;/span&gt;
npm &lt;span class="nt"&gt;-v&lt;/span&gt; &lt;span class="c"&gt;# My installed version: 6.9.0&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now that you should have Node and npm installed successfully, we will look at how to initialize your project with NPM and the important components associated with the node package manager.&lt;/p&gt;

&lt;h2&gt;
  
  
  How to initialize your Project with npm?
&lt;/h2&gt;

&lt;p&gt;The first step to use npm is navigating to your project folder (e.g. myProject) and run the command 'npm init' command from the command 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="nv"&gt;$ &lt;/span&gt;root&amp;gt; &lt;span class="nb"&gt;cd &lt;/span&gt;myproject

&lt;span class="nv"&gt;$ &lt;/span&gt;root/myproject&amp;gt; npm init
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The above command will perform the initialization process and you’ll notice that you have a brand new &lt;code&gt;package.json&lt;/code&gt; file and an empty &lt;code&gt;node_modules&lt;/code&gt; directory.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;node_modules&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Whenever you install a package, the source code for that package will be put inside of the &lt;code&gt;node_modules&lt;/code&gt; directory. Then, whenever you import a module into your project that isn’t a file path, i.e. &lt;code&gt;import React from 'react'&lt;/code&gt;, your app will look to &lt;code&gt;node_modules&lt;/code&gt; for the source.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;package.json&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;The '&lt;code&gt;package.json&lt;/code&gt;' file contains all of the meta-information for your project. It contains information like the project’s name, author, description, and most importantly, the list of packages (as well as what versions) that your project depends on and how to run your project.&lt;/p&gt;

&lt;p&gt;Here's a sample of the 'package.json' file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
   &lt;/span&gt;&lt;span class="nl"&gt;"name"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="s2"&gt;"Example Project"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
   &lt;/span&gt;&lt;span class="nl"&gt;"version"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="s2"&gt;"1.0.0"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
   &lt;/span&gt;&lt;span class="nl"&gt;"description"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"An Example Project demonstrating Node Package Manager"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
   &lt;/span&gt;&lt;span class="nl"&gt;"author"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="s2"&gt;"Skay"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
   &lt;/span&gt;&lt;span class="nl"&gt;"license"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="s2"&gt;"ISC"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
   &lt;/span&gt;&lt;span class="nl"&gt;"homepage"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="s2"&gt;"https://github.com/skaytech"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
   &lt;/span&gt;&lt;span class="nl"&gt;"keywords"&lt;/span&gt;&lt;span class="p"&gt;:[&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="s2"&gt;"react"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="s2"&gt;"react-router"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="s2"&gt;"babel"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="s2"&gt;"webpack"&lt;/span&gt;&lt;span class="w"&gt;
   &lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="w"&gt;
   &lt;/span&gt;&lt;span class="nl"&gt;"repository"&lt;/span&gt;&lt;span class="p"&gt;:{&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"type"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="s2"&gt;"git"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"url"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="s2"&gt;"https://github.com/skaytech/webpack-example.git"&lt;/span&gt;&lt;span class="w"&gt;
   &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
   &lt;/span&gt;&lt;span class="nl"&gt;"main"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="s2"&gt;"index.js"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
   &lt;/span&gt;&lt;span class="nl"&gt;"dependencies"&lt;/span&gt;&lt;span class="p"&gt;:{&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"prop-types"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="s2"&gt;"^15.7.2"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"query-string"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="s2"&gt;"^6.2.0"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"react"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="s2"&gt;"^16.8.3"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"react-dom"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="s2"&gt;"^16.8.3"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"react-icons"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="s2"&gt;"^3.4.0"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"react-router-dom"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="s2"&gt;"^4.3.1"&lt;/span&gt;&lt;span class="w"&gt;
   &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
   &lt;/span&gt;&lt;span class="nl"&gt;"devDependencies"&lt;/span&gt;&lt;span class="p"&gt;:{&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"@babel/core"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="s2"&gt;"^7.3.4"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"@babel/plugin-proposal-class-properties"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="s2"&gt;"^7.3.4"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"@babel/preset-env"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="s2"&gt;"^7.3.4"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"@babel/preset-react"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="s2"&gt;"^7.0.0"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"babel-loader"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="s2"&gt;"^8.0.5"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"babel-plugin-syntax-dynamic-import"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="s2"&gt;"^6.18.0"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"copy-webpack-plugin"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="s2"&gt;"^5.0.0"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"css-loader"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="s2"&gt;"^2.1.0"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"html-webpack-plugin"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="s2"&gt;"^3.2.0"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"style-loader"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="s2"&gt;"^0.23.1"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"webpack"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="s2"&gt;"^4.29.5"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"webpack-cli"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="s2"&gt;"^3.2.3"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"webpack-dev-server"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="s2"&gt;"^3.2.1"&lt;/span&gt;&lt;span class="w"&gt;
   &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
   &lt;/span&gt;&lt;span class="nl"&gt;"scripts"&lt;/span&gt;&lt;span class="p"&gt;:{&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"start"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="s2"&gt;"webpack-dev-server --open"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"build"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="s2"&gt;"NODE_ENV='production' webpack"&lt;/span&gt;&lt;span class="w"&gt;
   &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Let us look at a few of those properties in detail:&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;dependencies&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;The list of packages listed under the 'dependencies' property is the ones your application needs in order to run. When you install a new package, the source for the package will be placed inside the 'node_modules' directory. The name &amp;amp; version of that package will automatically be added to the 'dependencies' property in your 'package.json' file.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;devDependencies&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;'devDependencies' is exactly like the 'dependencies' in the sense the source will be placed inside the 'node_modules' directory. However, these 'dependencies' will only be made available to your application while running them in your development environment.&lt;/p&gt;

&lt;p&gt;In other words, these 'dependencies' will not be required to run in the production environment.&lt;/p&gt;

&lt;h3&gt;
  
  
  scripts
&lt;/h3&gt;

&lt;p&gt;The 'scripts' property defines the set of commands you can provide to the node package manager to run any kind of automation tasks. In the above example, we have two scripts, namely the 'start' and 'build'.&lt;/p&gt;

&lt;p&gt;The general syntax to run any script is:&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="nv"&gt;$ &lt;/span&gt;root &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; npm run &lt;span class="o"&gt;[&lt;/span&gt;SCRIPT NAME]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In the above example, if you run the to start the 'webpack-dev-server', you can run the script 'start' using the following command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;root/myproject&amp;gt; npm run start
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  NPM Registry and How to install packages from the registry?
&lt;/h2&gt;

&lt;p&gt;Now, that we've looked at the basics of 'npm' and the 'package.json'. We will look at how you can install certain packages from the 'npm registry'.&lt;/p&gt;

&lt;p&gt;As I had introduced earlier, the registry is a centralized repository where all the packages are published and are available for downloads.&lt;/p&gt;

&lt;p&gt;For Example, if you want to install 'react', you can run the following command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;root/myproject&amp;gt; npm &lt;span class="nb"&gt;install &lt;/span&gt;react
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The general syntax to install any package is:&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="nv"&gt;$ &lt;/span&gt;root&amp;gt; npm &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="o"&gt;[&lt;/span&gt;PACKAGE NAME]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Running 'npm install', will do the following things:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;It will put the 'react' package inside of your 'node_modules' directory.&lt;/li&gt;
&lt;li&gt;It will add 'react' as a property on your 'dependencies' object inside your package.json file.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Install your dependency as a Dev Dependency
&lt;/h3&gt;

&lt;p&gt;In order to tell 'npm' that your dependency needs to be added only as a 'dev dependency', i.e., the package needs to be made only for development purposes, you should run the following command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;root&amp;gt; npm &lt;span class="nb"&gt;install &lt;/span&gt;webpack &lt;span class="nt"&gt;--save-dev&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The key differentiator is the '—save-dev' flag while running the 'npm install' command for installing the package as a dev dependency.&lt;/p&gt;

&lt;h2&gt;
  
  
  How to publish your package to NPM?
&lt;/h2&gt;

&lt;p&gt;NPM has over a million packages as of the date and it wouldn't be possible if it wasn't easy to publish one. You need to have the following to publish a package on npm:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;An account on npm&lt;/li&gt;
&lt;li&gt;A package.json file with 'name', 'version', and 'main' (which points to the entry point of your package) properties.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Once you have the above, in your command line run the following commands:&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="nv"&gt;$ &lt;/span&gt;root/myPackage &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; npm login

&lt;span class="nv"&gt;$ &lt;/span&gt;root/myPackage &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; npm publish
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That's all there's to it! There are more advanced features that you can check out their &lt;a href="https://docs.npmjs.com/packages-and-modules/contributing-packages-to-the-registry"&gt;official guide&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Versioning&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;If you remember, at the start of our post, we had discussed managing the different versions of our packages. Thankfully npm CLI provides a very nice way to manage it as well.&lt;/p&gt;

&lt;p&gt;Typically each package on the npm registry follows semantic versioning. There are three parts to semantic versioning, major versions, minor versions, and patch versions.&lt;/p&gt;

&lt;p&gt;For example, if your package version is v1.2.3, the following is the break-up:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Major Version - 1 -  If you had a breaking change, you'll increment the major version.&lt;/li&gt;
&lt;li&gt;Minor Version - 2 - If you had a non-breaking feature, you'll increment the minor version.&lt;/li&gt;
&lt;li&gt;Patch Version - 3 - Everything else, you'll increment the patch version.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Why is this important? We want to avoid having our app break because we installed the wrong version of a package. npm gives us some tools to prevent this.&lt;/p&gt;

&lt;h3&gt;
  
  
  The '&lt;strong&gt;^' operator in your Version number&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Let us look at the 'dependencies' inside your 'package.json' file again:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="nl"&gt;"dependencies"&lt;/span&gt;&lt;span class="p"&gt;:{&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"prop-types"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="s2"&gt;"^15.7.2"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"query-string"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="s2"&gt;"^6.2.0"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"react"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="s2"&gt;"^16.8.3"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"react-dom"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="s2"&gt;"^16.8.3"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"react-icons"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="s2"&gt;"^3.4.0"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"react-router-dom"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="s2"&gt;"^4.3.1"&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You’ll notice that before each version number, there’s a little &lt;code&gt;^&lt;/code&gt; or a 'carrot' symbol.&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;^&lt;/code&gt; instructs npm to install the newest version of the package &lt;strong&gt;with the same major version&lt;/strong&gt;. &lt;/p&gt;

&lt;p&gt;Let's take, for example, the 'react' package released v16.9.0. After the new version of the package is released and you run 'npm install' inside your project, then that version of the package will be available to your project.&lt;/p&gt;

&lt;p&gt;If 'react' released a v17.0.0, which means it's breaking change and you run 'npm install', the breaking change won't be installed and made available to your project.&lt;/p&gt;

&lt;h3&gt;
  
  
  The '&lt;strong&gt;~' operator in your version number&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;If your requirement is to only update your package only for updates for &lt;strong&gt;the same major and minor versions&lt;/strong&gt;, then you'll use the '~' operator.&lt;/p&gt;

&lt;p&gt;In the above example, if you change the 'prop-types' package to have the '~' operator:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="nl"&gt;"dependencies"&lt;/span&gt;&lt;span class="p"&gt;:{&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"prop-types"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="s2"&gt;"~15.7.2"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;      
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you run 'npm install', a new package will only be installed if 'v15.7.3' is released. If 'v16.0.0' or 'v15.8.0' came out, neither would be installed.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Exact version&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Finally, the simplest and direct use-case of having the exact version of what’s listed in your &lt;code&gt;package.json&lt;/code&gt; file, you'll just need to remove all 'symbols' before your version number and only list only the version number as shown below:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="nl"&gt;"dependencies"&lt;/span&gt;&lt;span class="p"&gt;:{&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"prop-types"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="s2"&gt;"15.7.2"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;      
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now if you run 'npm install' anytime, only the version 'v15.7.2' will ever be installed.&lt;/p&gt;

&lt;h2&gt;
  
  
  conclusion
&lt;/h2&gt;

&lt;p&gt;A quick summary of what we discussed in this article:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;What is npm, Registry, and CLI?&lt;/li&gt;
&lt;li&gt;How to initialize your project with NPM?&lt;/li&gt;
&lt;li&gt;A detailed overview of 'package.json' and it's important properties.&lt;/li&gt;
&lt;li&gt;How to install and publish your packages?&lt;/li&gt;
&lt;li&gt;Version management of packages.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I hope you enjoyed the article. Don't forget to subscribe to my newsletter and connect with me on Twitter &lt;a href="https://twitter.com/skay_tech"&gt;@skaytech&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  You will also enjoy the following articles:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://dev.to/skaytech/why-you-should-choose-to-learn-react-2g70"&gt;Why you should learn 'React'?&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/skaytech/the-react-ecosystem-1l05"&gt;The React Ecosystem&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/skaytech/async-functions-chapter-3-async-await-89"&gt;Async/Await explained in JavaScript&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/skaytech/async-functions-chapter-2-promises-1c6i"&gt;What are JavaScript Promises&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/skaytech/async-functions-chapter-1-callback-3fkm"&gt;JavaScript Callbacks Explained&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/skaytech/javascript-objects-31lb"&gt;Everything you need to know about JavaScript Objects&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/skaytech/all-about-javascript-functions-1l5f"&gt;Everything you need to know about JavaScript Funtions&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/skaytech/es6-higher-order-functions-495e"&gt;ES6 - Higher Order Functions&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/skaytech/es6-spread-operator-3ced"&gt;ES6 - Spread Operator&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/skaytech/es6-understanding-destructuring-49np"&gt;ES6 - Understanding Destructuring&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/skaytech/es6-arrow-functions-2m0l"&gt;ES6 - Arrow Functions&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/dailydotdev/what-is-currying-in-javascript-3n9l"&gt;What is Currying in JavaScript?&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/skaytech/understanding-hoisting-b48"&gt;Understanding Hoisting&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/skaytech/a-gentle-introduction-to-the-big-o-notation-time-space-complexity-3hdd"&gt;Introduction to Big O Notation, Time &amp;amp; Space Complexity&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>npm</category>
      <category>node</category>
      <category>javascript</category>
      <category>codenewbie</category>
    </item>
    <item>
      <title>The React Ecosystem</title>
      <dc:creator>skaytech</dc:creator>
      <pubDate>Fri, 30 Oct 2020 13:10:16 +0000</pubDate>
      <link>https://dev.to/skaytech/the-react-ecosystem-1l05</link>
      <guid>https://dev.to/skaytech/the-react-ecosystem-1l05</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;When I started learning React, there was a huge debate on whether React is a library or a framework. While I assumed React to be a framework, since, it was always compared with the likes of Vue or Angular, it is actually a JavaScript library.&lt;/p&gt;

&lt;p&gt;However, there are other components such as the Webpack, Babel, Router, etc. that make it more wholesome into a complete framework that it is. Often, this is hidden under the hood, since we typically use 'create-react-app' to generate a React boilerplate code to start our application with.&lt;/p&gt;

&lt;p&gt;In this article, we will look at a brief overview of the following key components that comprise the 'React Ecosystem'. &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Babel&lt;/li&gt;
&lt;li&gt;Webpack&lt;/li&gt;
&lt;li&gt;Routing&lt;/li&gt;
&lt;li&gt;Styling&lt;/li&gt;
&lt;li&gt;State (Redux/Context)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This is my second article, in the 'React Series' based on my learnings from &lt;a href="https://ui.dev/" rel="noopener noreferrer"&gt;Tyler Mcginnis course @ ui.dev&lt;/a&gt;. &lt;/p&gt;

&lt;p&gt;You can read the first article on &lt;a href="https://dev.to/skaytech/why-you-should-choose-to-learn-react-2g70"&gt;Why you should learn 'React'?&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  React
&lt;/h2&gt;

&lt;p&gt;As I had mentioned in the introduction, React is just a library and you can just include the 'react' and 'react-dom' script tag inside the index.html and it's perfectly valid. &lt;/p&gt;

&lt;p&gt;You can run the below code and it's a perfect valid React application. You can find the code in action &lt;a href="https://codepen.io/skaytech/pen/bGevWVo" rel="noopener noreferrer"&gt;over here.&lt;/a&gt;&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="o"&gt;&amp;lt;!&lt;/span&gt;&lt;span class="nx"&gt;DOCTYPE&lt;/span&gt; &lt;span class="nx"&gt;html&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;html&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;head&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;title&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nx"&gt;React&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/title&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;  &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/head&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;  &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;body&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;div&lt;/span&gt; &lt;span class="nx"&gt;id&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;app&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/div&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;script&lt;/span&gt;
      &lt;span class="nx"&gt;crossorigin&lt;/span&gt;
      &lt;span class="nx"&gt;src&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;https://unpkg.com/react@16.14/umd/react.development.js&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
    &lt;span class="o"&gt;&amp;gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/script&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;script&lt;/span&gt;
      &lt;span class="nx"&gt;crossorigin&lt;/span&gt;
      &lt;span class="nx"&gt;src&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;https://unpkg.com/react-dom@16.14/umd/react-dom.development.js&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
    &lt;span class="o"&gt;&amp;gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/script&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;script&lt;/span&gt; &lt;span class="nx"&gt;src&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;https://unpkg.com/babel-standalone@6/babel.min.js&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/script&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;script&lt;/span&gt; &lt;span class="nx"&gt;type&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;text/babel&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;Hello&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="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;h1&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nx"&gt;Hello&lt;/span&gt;&lt;span class="p"&gt;,&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="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/h1&amp;gt;&lt;/span&gt;&lt;span class="err"&gt;;
&lt;/span&gt;      &lt;span class="p"&gt;}&lt;/span&gt;

      &lt;span class="nx"&gt;ReactDOM&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;render&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;Hello&lt;/span&gt; &lt;span class="nx"&gt;name&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Skay&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="o"&gt;/&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getElementById&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;app&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/script&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;  &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/body&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/html&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;So, then the question becomes why don't we use the above setup? Instead, when we run 'create-react-app', the setup is quiet different and other components such as 'Webpack', 'Babel', etc. are in play. &lt;/p&gt;

&lt;p&gt;Let us look at each of those components at a high-level and what they do behind the scenes to support a production-grade React app.&lt;/p&gt;

&lt;h2&gt;
  
  
  Babel
&lt;/h2&gt;

&lt;p&gt;If you visit, &lt;a href="https://babeljs.io/" rel="noopener noreferrer"&gt;Babel's website&lt;/a&gt;, it'll be mentioned that Babel is a JavaScript compiler. What that means is Babel is responsible to transform JavaScript code from one format to another based on specified configuration.&lt;/p&gt;

&lt;p&gt;Now, let us look at the below code example.&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="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;React&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;react&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;User&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="p"&gt;{&lt;/span&gt;

  &lt;span class="k"&gt;return &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;div&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;h1&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nx"&gt;Hello&lt;/span&gt;&lt;span class="p"&gt;,&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="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/h1&amp;gt;     &lt;/span&gt;&lt;span class="err"&gt; 
&lt;/span&gt;    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/div&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;  &lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A couple of things to note here:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;User is a React component that returns a UI (view) Hello, "name" based on the name passed to the component.&lt;/li&gt;
&lt;li&gt;The 'HTML' syntax within the JavaScript context is called JSX. It is React's way to allow you to describe UI inside of your components.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Now, if your browser needs to display the above information, it needs to know to get hold of the HTML view and the regular old JavaScript. This looks like a perfect job for 'Babel' which accepts the  JSX input and transforms it into a valid JavaScript that can be understood by the browser.&lt;/p&gt;

&lt;p&gt;But what's cool about Babel is that it's not limited to JSX → JS transformations, but, it can do almost any kind of transformations and it is most commonly used to transform ES6+ code to the backward-compatible version of JavaScript that old browsers can understand.&lt;/p&gt;

&lt;h2&gt;
  
  
  Webpack
&lt;/h2&gt;

&lt;p&gt;Webpack is a module bundler. It examines your codebase for all imports and exports and intelligently bundles all your modules into a single file that your browser can understand.&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%2Fv1604056811300%2F_dnqOUjjJ.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%2Fv1604056811300%2F_dnqOUjjJ.png" alt="webpackbundle.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So in our above example, the following lines of code, the 'import' and 'export' statements are what Webpack will scan and bundle it into a single bundle.js file which will be referenced inside of index.html.&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="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;React&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;react&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;User&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I have an article that describes Webpack in much greater detail, which you can read &lt;a href="https://blog.skay.dev/a-basic-introduction-to-webpack" rel="noopener noreferrer"&gt;over here.&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Routing
&lt;/h2&gt;

&lt;p&gt;The idea was to keep React as a simple UI library and not include the Router as a part of the core library. It was done with the intent to provide the users the flexibility to decide what kind of router they would want to integrate with React.&lt;/p&gt;

&lt;p&gt;The most popular router for React is of course the &lt;a href="https://www.npmjs.com/package/react-router" rel="noopener noreferrer"&gt;'React Router'&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can describe React Router’s job is to render specific React components based on the current URL path of the user.&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="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;Router&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;div&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;ul&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;li&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;Link&lt;/span&gt; &lt;span class="nx"&gt;to&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;/&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nx"&gt;Home&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/Link&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span class="nx"&gt;li&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;li&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;Link&lt;/span&gt; &lt;span class="nx"&gt;to&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;/about&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nx"&gt;About&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/Link&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span class="nx"&gt;li&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;li&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;Link&lt;/span&gt; &lt;span class="nx"&gt;to&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;/contact&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nx"&gt;Contact&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/Link&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span class="nx"&gt;li&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/ul&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;
    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;Route&lt;/span&gt; &lt;span class="nx"&gt;exact&lt;/span&gt; &lt;span class="nx"&gt;path&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;/&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="nx"&gt;component&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;Home&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="sr"&gt;/&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;Route&lt;/span&gt; &lt;span class="nx"&gt;path&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;/about&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="nx"&gt;component&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;About&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="sr"&gt;/&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;Route&lt;/span&gt; &lt;span class="nx"&gt;path&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;/contact&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="nx"&gt;component&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;Contact&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="sr"&gt;/&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;  &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/div&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/Router&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;When a user navigates to the home page (/), React Router will render the Home component. When they navigate to /about, React Router will render About. Likewise, when they navigate to /contact, React Router will render the Contact component.&lt;/p&gt;

&lt;p&gt;React Router is again a vast topic and will warrant a separate blog post of its own. For now, you can simply understand it as the component that is responsible to render React components based on the URL path the user visits.&lt;/p&gt;

&lt;h2&gt;
  
  
  Styling
&lt;/h2&gt;

&lt;p&gt;There are two ways to Style a React application. The traditional way and the React way. Let us look at both ways of defining styling to your react application. &lt;/p&gt;

&lt;h3&gt;
  
  
  Traditional Styling
&lt;/h3&gt;

&lt;p&gt;The traditional approach includes adding all your styling inside index.css and you can have classes, cascading defined there typically how you would do for a non-react application. In fact, you can also have SASS or any CSS pre-processors included.&lt;/p&gt;

&lt;h3&gt;
  
  
  React Styling
&lt;/h3&gt;

&lt;p&gt;The React approach of styling embraces the component model. Let's add styling to our above example and see how the code looks.&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;const&lt;/span&gt; &lt;span class="nx"&gt;styles&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="na"&gt;header&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="na"&gt;fontWeight&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;400&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;fontSize&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;55&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;#a41c1c&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;User&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="p"&gt;{&lt;/span&gt;

  &lt;span class="k"&gt;return &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;div&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;h1&lt;/span&gt; &lt;span class="nx"&gt;style&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;styles&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;header&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nx"&gt;Hello&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="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/h1&amp;gt;     &lt;/span&gt;&lt;span class="err"&gt; 
&lt;/span&gt;    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/div&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;  &lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;As you can see from the above code, the styling is contained within each component. One of the most popular CSS in the JS library in the React ecosystem is the Styled Components. You can check them out &lt;a href="https://styled-components.com/" rel="noopener noreferrer"&gt;over here.&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  State (Redux/Context)
&lt;/h2&gt;

&lt;p&gt;Before we talk above Redux or Context, we will take a step back and define what state means to a React component.&lt;/p&gt;

&lt;h3&gt;
  
  
  React State
&lt;/h3&gt;

&lt;p&gt;React's philosophy is that you build individual components that can each manage their own state as well as describe their UI. You then compose those components together to get your app.&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%2Fv1604056898402%2F1h2BX7r7Q.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%2Fv1604056898402%2F1h2BX7r7Q.png" alt="reactphilosophy-Page-1.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;But often in real-life applications, the state of components needs to be shared with other components and it becomes a challenge to pass the state through the component tree if there are multiple levels. This is generally the case as the application grows larger and becomes more complex.&lt;/p&gt;

&lt;h3&gt;
  
  
  Redux
&lt;/h3&gt;

&lt;p&gt;To solve the above problem, Redux came into the picture. Redux is a state management library and while it's often used within the context of React library, it can in fact be used with any other view library and it's not tied to React.&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%2Fv1604056911639%2FNbhf1TIMC.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%2Fv1604056911639%2FNbhf1TIMC.png" alt="reactphilosophy-Page-2.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The philosophy of Redux is pretty different. Instead of having state spread out in different places, with Redux, you stick all of your 'State' in a single location called a 'Store'. You then establish strict rules for how the state of your 'Store' can change through something called 'Actions'.&lt;/p&gt;

&lt;h3&gt;
  
  
  Context
&lt;/h3&gt;

&lt;p&gt;Context API was introduced by the React team for providing a centralized way to manage a Component's state without relying on external libraries such as 'Redux'.&lt;/p&gt;

&lt;p&gt;As per the official React docs, Context provides a way to pass data through the component tree without having to pass props down manually at every level.&lt;/p&gt;

&lt;p&gt;Each of the topics such as Redux, Context API requires a dedicated blog article to explain the details. The important takeaway as a part of this article is that 'State' management is a core part of React's ecosystem and you can manage it simply within a component's state management mechanism or use Context API or Redux library based on your use-case or the complexity of the application.&lt;/p&gt;

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

&lt;p&gt;I think that's pretty much an overview of the core components. I hope after this article, you'll idea of what is under the hood when you run CRA (create-react-app) in your CLI, and when someone says it's a React application, it's an ecosystem and not just the React library. &lt;/p&gt;

&lt;p&gt;Don't forget to subscribe to my newsletter and follow me on Twitter &lt;a href="https://twitter.com/skay_tech" rel="noopener noreferrer"&gt;@skaytech&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  You will also enjoy the following articles:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://dev.to/skaytech/why-you-should-choose-to-learn-react-2g70"&gt;Why should you learn React?&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/skaytech/a-gentle-introduction-to-the-big-o-notation-time-space-complexity-3hdd"&gt;A gentle introduction to Big O Notation, Time and Space Complexity&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/dailydotdev/what-is-currying-in-javascript-3n9l"&gt;What is Currying in JavaScript?&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/skaytech/5-must-read-tips-to-write-a-killer-blog-article-510c"&gt;5 Must-Read Tips to write a Killer Blog Article&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/skaytech/a-basic-introduction-to-webpack-4eke"&gt;A Basic Introduction to Webpack&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/skaytech/what-is-event-loop-in-javascript-5356"&gt;What is Event Loop in JavaScript?&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/skaytech/build-a-custom-spa-router-using-vanillajs-4a9l"&gt;Build a Custom SPA Router in VanillaJS&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/skaytech/docker-fundamentals-2ibi"&gt;Docker Fundamentals&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>react</category>
      <category>javascript</category>
      <category>100daysofcode</category>
      <category>codenewbie</category>
    </item>
    <item>
      <title>Why you should choose to learn 'React'?</title>
      <dc:creator>skaytech</dc:creator>
      <pubDate>Tue, 27 Oct 2020 11:39:39 +0000</pubDate>
      <link>https://dev.to/skaytech/why-you-should-choose-to-learn-react-2g70</link>
      <guid>https://dev.to/skaytech/why-you-should-choose-to-learn-react-2g70</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;I have been working with the React framework for a while now and the more I understand it, the more I'm in awe of the framework. &lt;/p&gt;

&lt;p&gt;In this article, I wanted to share my thoughts on why I think React is one of the most popular JavaScript frameworks ever and why you should consider learning it if you are planning to learn a JavaScript framework.&lt;/p&gt;

&lt;p&gt;This is the first article, under the series 'React' and is based on my learnings from Tyler Mcginnis course @ ui.dev. Do check out Tyler, he's one heck of a teacher.&lt;/p&gt;

&lt;h2&gt;
  
  
  A Powerful Composition Model
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--IxqQ-n1e--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1603796976053/niabYzG3i.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--IxqQ-n1e--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1603796976053/niabYzG3i.png" alt="Unidirectionaldataflow-Page-4.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Composition is a language-agnostic programming principle that relies on building programs or functions by composing them together.&lt;/p&gt;

&lt;p&gt;React extends the same concept and it is possible to build React components by composing them together.&lt;/p&gt;

&lt;p&gt;Let us see a very simple example, to begin with, a page containing a header, main, and a footer component.&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="nx"&gt;Header&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;props&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="o"&gt;&amp;lt;&amp;gt;&lt;/span&gt;
            &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;h3&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;props&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;headerInfo&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/h3&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nx"&gt;Footer&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;props&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="o"&gt;&amp;lt;&amp;gt;&lt;/span&gt;
            &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;h5&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;props&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;footerInfo&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/h5&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nx"&gt;Main&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;props&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
        &lt;span class="o"&gt;&amp;lt;&amp;gt;&lt;/span&gt;
            &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;h1&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;props&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;mainInfo&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/h1&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/&lt;/span&gt;&lt;span class="err"&gt;&amp;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;function&lt;/span&gt; &lt;span class="nx"&gt;Home&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;props&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;div&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;Header&lt;/span&gt; &lt;span class="nx"&gt;headerContent&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;props&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;headerInfo&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="sr"&gt;/&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;      &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;Main&lt;/span&gt; &lt;span class="nx"&gt;mainContent&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;props&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;mainInfo&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="sr"&gt;/&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;      &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;Footer&lt;/span&gt; &lt;span class="nx"&gt;footerContent&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;props&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;footerInfo&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="sr"&gt;/&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/div&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;  &lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;As you can see from the above example, every function such as Header, Main, and Footer returns a view. Each of those views is further composed within the 'Home' component. This idea of having the power to create a UI by combining any one or more components makes it incredibly powerful.&lt;/p&gt;

&lt;p&gt;And this idea has been exploited by the community to develop a multitude of third-party React components that is available on NPM.&lt;/p&gt;

&lt;p&gt;A simple analogy that can make all of the above 'click', is, React to composition is equivalent to Pizzeria to 'Build your own Pizza' or 'Legos for developers'.&lt;/p&gt;

&lt;p&gt;Reference - &lt;a href="https://reactjs.org/docs/composition-vs-inheritance.html"&gt;https://reactjs.org/docs/composition-vs-inheritance.html&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Unidirectional Data Flow
&lt;/h2&gt;

&lt;p&gt;In a traditional application, you have event handlers that update the DOM which generally holds the state of the application as shown below.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--jsYCd2xF--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1603797029476/kqjzaOrxt.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--jsYCd2xF--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1603797029476/kqjzaOrxt.png" alt="Unidirectionaldataflow-1.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;As the application grows, the event handlers start updating other parts of the state and the above diagram starts to look like the Spaghetti below.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--mNuvvMcR--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1603797044830/sPUPllSHX.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--mNuvvMcR--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1603797044830/sPUPllSHX.png" alt="Unidirectionaldataflow-2.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;With React, it follows a Unidirectional Data Flow concept which means that data has one, and only one, way to be transferred to other parts of the application.&lt;/p&gt;

&lt;p&gt;Every component has its own state and they need to only bother about updating them. Based on the change in state, React does the hard work of updating the UI based on the change in state. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--I-n34ZkW--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1603797016518/rVUgo21zN.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--I-n34ZkW--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1603797016518/rVUgo21zN.png" alt="Unidirectionaldataflow-3.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Advantages of a system with a Unidirectional data flow:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Since the state is maintained at a single location, it can be easily traced to what actions are updating the data as the flow is one way only.&lt;/li&gt;
&lt;li&gt;You can control which components to re-render on a common state change. You put all those components under one common state containing the parent component.&lt;/li&gt;
&lt;li&gt;Easy to trace and fix bugs and errors caused by any poorly written code.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Declarative UI
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--tc41nVHg--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1603797892385/Gl8oo7wi3.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--tc41nVHg--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1603797892385/Gl8oo7wi3.jpeg" alt="kelly-sikkema-v9FQR4tbIq8-unsplash.jpg"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In React everything is a component and each component has primarily two things (three actually which includes the lifecycle methods) that you need to be bothered about while defining a component.&lt;/p&gt;

&lt;p&gt;a. The Components state.&lt;/p&gt;

&lt;p&gt;b. How the UI looks based on the state.&lt;/p&gt;

&lt;p&gt;Let us take a look at the following code example in JQuery &amp;amp; React:&lt;/p&gt;

&lt;p&gt;Using JQuery:&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="nx"&gt;$&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;btn&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nx"&gt;click&lt;/span&gt;&lt;span class="p"&gt;(()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&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;toggleClass&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;highlight&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="nx"&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;text&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Add Highlight&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;
    &lt;span class="p"&gt;?&lt;/span&gt; &lt;span class="nx"&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;text&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Remove Highlight&lt;/span&gt;&lt;span class="dl"&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;$&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;text&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Add Highlight&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;})&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Using React:&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="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;Btn&lt;/span&gt;
  &lt;span class="nx"&gt;highlight&lt;/span&gt;&lt;span class="o"&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;state&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;highlight&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="nx"&gt;onToggle&lt;/span&gt;&lt;span class="o"&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;toggleBtn&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="sr"&gt;/&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Key things to note based on the above code example:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;In the JQuery example, you have to access the DOM and ensure that is updated based on events.&lt;/li&gt;
&lt;li&gt;In the React example, you have to only worry about the following two things:

&lt;ul&gt;
&lt;li&gt;The state or how to update the state based on an event. React will do the hard lifting of updating the DOM.&lt;/li&gt;
&lt;li&gt;How the Button component's UI should respond when the state changes? This is described in the 'this.toggleBtn' function.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;React provides the abstraction, so that, the Component does not need to worry about updating the DOM.&lt;/p&gt;

&lt;h2&gt;
  
  
  Utilizes "Core JavaScript" features - Minimal Custom API
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--aAhhd4oa--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1603797268468/XSb-8qkaM.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--aAhhd4oa--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1603797268468/XSb-8qkaM.png" alt="Reactjs.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;React does not try to re-create functionality that you can already do using JavaScript.&lt;/p&gt;

&lt;p&gt;Let us look at the following example of creating unordered lists from a 'products' array using the three different JavaScript Frameworks: Angular, Vue &amp;amp; React.&lt;/p&gt;

&lt;p&gt;Angular uses 'ngFor' to loop through the 'products' array.&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="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;ul&lt;/span&gt; &lt;span class="nx"&gt;id&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;products&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;li&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="nx"&gt;ngFor&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;let product in products&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
                &lt;span class="p"&gt;{{&lt;/span&gt;&lt;span class="nx"&gt;product&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="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/li&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/ul&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Vue uses 'v-for' to loop through the 'products' array.&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="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;ul&lt;/span&gt; &lt;span class="nx"&gt;id&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;products&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;li&lt;/span&gt; &lt;span class="nx"&gt;v&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="k"&gt;for&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;product in products&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
                &lt;span class="p"&gt;{{&lt;/span&gt;&lt;span class="nx"&gt;product&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="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/li&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/ul&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;React uses&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="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;ul&lt;/span&gt; &lt;span class="nx"&gt;id&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;products&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;products&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;map&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;product&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;index&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
            &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;li&lt;/span&gt; &lt;span class="nx"&gt;key&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;index&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
                &lt;span class="p"&gt;{{&lt;/span&gt;&lt;span class="nx"&gt;product&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="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/li&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/ul&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;As you can see from the above example, React uses JavaScript's map method as compared to any special APIs provided by Vue or Angular. Before Angular or Vue folks jump on me, by no means, I'm trying to belittle other frameworks. It is just one significant point that I wanted to highlight over here.&lt;/p&gt;

&lt;p&gt;The important point to note here is that React's API layer is kept to the minimum and it utilizes the features provided by JavaScript.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Right Abstraction
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--uNq-2ahg--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1603797555672/knlHUfySc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--uNq-2ahg--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1603797555672/knlHUfySc.png" alt="Brown, Pink and Green Abstract Shapes Wellness YouTube Channel Art.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I think that 'React' provides the right abstraction due to the following reasons:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;As a framework, React is highly opinionated as any abstraction should be.&lt;/li&gt;
&lt;li&gt;The abstraction provided by React empowers users to adopt it without making it very complicated.&lt;/li&gt;
&lt;li&gt;The behavior provided by the abstraction is simple enough to extend and supports almost infinite use-cases as possible without giving away the implementation details.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;As the saying goes, the 'proof is in the pudding' and you just need to look at the tools built using or on top of React to realize how powerful the abstraction provided by React is.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;&lt;a href="https://www.gatsbyjs.org/"&gt;Gatsby&lt;/a&gt;&lt;/strong&gt; is a free and open-source framework based on React that helps developers build blazing-fast websites and apps.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;a href="https://nextjs.org/"&gt;Next.js&lt;/a&gt;&lt;/strong&gt; is a JavaScript framework that lets you build server-side rendered, static web applications using React.&lt;/li&gt;
&lt;/ul&gt;

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

&lt;p&gt;I hope the reasons mentioned in the post make it compelling enough for you to start learning ReactJS as the JavaScript framework of choice.&lt;/p&gt;

&lt;p&gt;Don't forget to subscribe and follow me on Twitter &lt;a href="https://twitter.com/skay_tech"&gt;@skaytech&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  You may also like the following articles:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://dev.to/skaytech/a-basic-introduction-to-webpack-4eke"&gt;A Basic Introduction to Webpack&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/skaytech/what-is-this-in-javascript-3d3i"&gt;What is 'this' in JavaScript?&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/skaytech/build-a-custom-spa-router-using-vanillajs-4a9l"&gt;Build a custom SPA Router in Vanilla JavaScript&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/skaytech/es6-understanding-destructuring-49np"&gt;ES6 - Destructuring&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/skaytech/the-war-var-vs-let-const-2a7l"&gt;ES6 - var, let &amp;amp; const&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/skaytech/es6-higher-order-functions-495e"&gt;ES6 - Higher Order Functions&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>javascript</category>
      <category>react</category>
      <category>100daysofcode</category>
      <category>codenewbie</category>
    </item>
    <item>
      <title>A Gentle Introduction to the Big O Notation, Time &amp; Space Complexity</title>
      <dc:creator>skaytech</dc:creator>
      <pubDate>Tue, 13 Oct 2020 17:18:00 +0000</pubDate>
      <link>https://dev.to/skaytech/a-gentle-introduction-to-the-big-o-notation-time-space-complexity-3hdd</link>
      <guid>https://dev.to/skaytech/a-gentle-introduction-to-the-big-o-notation-time-space-complexity-3hdd</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;I have been in Software Engineering for a decade and a half and I am not a Computer Science graduate. Hence, I've never truly been taught Data Structures or Algorithms as a part of the course curriculum. Having said that, it did not stop me from being a good software engineer. &lt;/p&gt;

&lt;p&gt;However, I was always curious to find out what it was all about and finally got some time to understand the absolute fundamentals. I'm hoping I can share my learnings in a way most of the non-computer science graduates can relate to.&lt;/p&gt;

&lt;p&gt;In this article, we will look at the following three concepts:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Big O Notation&lt;/li&gt;
&lt;li&gt;Time Complexity&lt;/li&gt;
&lt;li&gt;Space Complexity&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Big O Notation
&lt;/h2&gt;

&lt;p&gt;Big O notation is used in computer science to describe the performance or complexity of an algorithm. In simple words, it is used to denote how long an algorithm takes to run and how much memory it takes as the input to the algorithm grows over time.&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%2Fv1602601563285%2FXMy-vGguV.jpeg" 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%2Fv1602601563285%2FXMy-vGguV.jpeg" alt="greg-nunes-mTNftwxCWCg-unsplash (1).jpg"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;With Big O Notation we express the runtime in terms of &lt;em&gt;how quickly it grows relative to the input, as the input gets larger&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;Let's expand on the words highlighted in 'italics' above:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;How quickly the runtime grows - It is generally hard to pin down the exact runtime used by your program, since, it is dependent on the processor speed and the other programs running on the computer at the moment. So, instead of talking about the 'runtime' directly, we use Big O Notation to talk about how quickly the runtime grows.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Relative to the input - If we were measuring our runtime directly, we could express our speed in seconds and minutes. Since we are measuring how quickly our runtime grows, we need to express our speed in terms of something else. With Big O, the size of the input is denoted as 'n'. So, we can say that as the runtime grows “on the order of the size of the input” (O(n)) or “on the order of the square of the size of the input” (O(n²)).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;As the input gets larger - Our algorithm may have steps that seem expensive when the input size 'n' is small but is eclipsed eventually by other steps as '&lt;em&gt;n'&lt;/em&gt; gets larger. For Big O Notation analysis, we care more about the stuff that grows fastest as the input grows, because everything else is quickly eclipsed as '&lt;em&gt;n'&lt;/em&gt; gets very large.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Time Complexity
&lt;/h2&gt;

&lt;p&gt;We have sort of defined time complexity in the above section while introducing Big O Notation.&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%2Fv1602601605405%2Fo4jH0_RgV.jpeg" 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%2Fv1602601605405%2Fo4jH0_RgV.jpeg" alt="nathan-dumlao-5Hl5reICevY-unsplash.jpg"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Time complexity is a function describing the amount of time an algorithm takes in terms of the amount of input to the algorithm. In layman’s terms, We can say time complexity is the sum of the number of times each statement gets executed.&lt;/p&gt;

&lt;p&gt;There are three different types of time complexity:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Constant Time ⇒ O(1) - The runtime does not change irrespective of the input size.&lt;/li&gt;
&lt;li&gt;Linear Time ⇒ O(n) - The runtime grows linearly as the input 'n' grows.&lt;/li&gt;
&lt;li&gt;Quadratic Time ⇒ O(n²) - The time it takes to complete a function increases like a quadratic function.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Let us look at a few code examples to understand time complexity in a better way.&lt;/p&gt;

&lt;h3&gt;
  
  
  Constant Time - O(1)
&lt;/h3&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;displayFirstItem&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;inpArray&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;inpArray&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&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;p&gt;The above function runs in &lt;strong&gt;O(1) time (or “constant time”)&lt;/strong&gt; relative to its input. This means that the input array could be 1 item or 1,000 items, but this function would still run once and display the first item in the array.&lt;/p&gt;

&lt;h3&gt;
  
  
  Linear Time ⇒ O(n)
&lt;/h3&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;displayAllItems&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;inpArray&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;inpArray&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;forEach&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;function&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;item&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;item&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="p"&gt;});&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The above function runs in O(n) time (or “linear time”), where '&lt;em&gt;n&lt;/em&gt;' is the number of items in the array. This means that if the array has 10 items, the function will run 10 times. If it has 1,000 items, the function will run 1,000 times.&lt;/p&gt;

&lt;h3&gt;
  
  
  Quadratic Time ⇒ O(n²)
&lt;/h3&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;displayAllPossibleOrderedPairs&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;inpArray&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;inpArray&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;forEach&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;firstItem&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;inpArray&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;forEach&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;secondItem&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;firstItem&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;secondItem&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="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In the above example, there are two loops nested. If the array has '&lt;em&gt;n'&lt;/em&gt; items, the outer loop runs '&lt;em&gt;n'&lt;/em&gt; times, and the inner loop runs '&lt;em&gt;n' times for each iteration of the outer loop&lt;/em&gt;, giving us n² total prints. &lt;/p&gt;

&lt;p&gt;Thus, the function runs in &lt;strong&gt;O(n²) time (or “quadratic time”)&lt;/strong&gt;. If the array has 10 items, the function will run 100 times. If it has 1,000 items, it will run 1,000,000 times.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Worst-Case Scenario
&lt;/h2&gt;

&lt;p&gt;The worst-case scenario is generally discussed with Big O Notation, since, there are often cases when the worst-case runtime is significantly worse than the best case runtime.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;contains&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;haystack&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;needle&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;

  &lt;span class="c1"&gt;// Does the haystack contain the needle?&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="nx"&gt;haystack&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;length&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="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;haystack&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="nx"&gt;needle&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="kc"&gt;true&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="k"&gt;return&lt;/span&gt; &lt;span class="kc"&gt;false&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;p&gt;In the above example, there might be 100 items in the haystack, but the first item might be the needle, in which case I would return in just 1 iteration of the loop. In such a case, it would appear O(1) to the runtime. &lt;/p&gt;

&lt;p&gt;However, if the needle was to be found in the last iteration, then the runtime would be O(n). Hence, to be more specific, we could always say that the best-case scenario would have an O(1) runtime, and the worst-case scenario would be O(n) runtime.&lt;/p&gt;

&lt;h2&gt;
  
  
  Space Complexity
&lt;/h2&gt;

&lt;p&gt;Space complexity is a function describing the amount of memory (space) an algorithm takes in terms of the amount of input to the algorithm. When we say “this algorithm takes constant extra space,” because the amount of extra memory needed doesn’t vary with the number of items processed.&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%2Fv1602601664268%2FK5H2Hm-Oh.jpeg" 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%2Fv1602601664268%2FK5H2Hm-Oh.jpeg" alt="patrick-mcmanaman-LN_g3qA8ohg-unsplash.jpg"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So, the question is when would we compromise the speed of execution? A simple answer to that is the availability of resources that you can allocate to the running program.&lt;/p&gt;

&lt;p&gt;Let us look at a few code examples:&lt;/p&gt;

&lt;h3&gt;
  
  
  O(1) - Fixed Space (For a fixed input size)
&lt;/h3&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;greet&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;inpArray&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&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="nx"&gt;inpArray&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;length&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;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="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Hello&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;                                          
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In the above example, the function takes O(1) i.e. fixed space, since the size of the input array does not change and we are only printing a String on the console.&lt;/p&gt;

&lt;h3&gt;
  
  
  O(n) - Space takes grows linearly
&lt;/h3&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;greetNTimes&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="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;greetArray&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[];&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="nx"&gt;n&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;greetArray&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Hello&lt;/span&gt;&lt;span class="dl"&gt;'&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="nx"&gt;greetArray&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;p&gt;In the above function, as the size of input 'n' grows, the size of greetArray also grows. This requires additional memory resources to be allocated to accommodate the larger array.&lt;/p&gt;

&lt;h3&gt;
  
  
  O(1) - Fixed Space (For a variable input size)
&lt;/h3&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;getLargestItem&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;items&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;largest&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nb"&gt;Number&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;MAX_VALUE&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nx"&gt;items&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;forEach&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;item&lt;/span&gt; &lt;span class="o"&gt;=&amp;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;item&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;largest&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="nx"&gt;largest&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;item&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="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;largest&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;p&gt;In the above example, while it the size of 'items' might change, it does not result in any allocation of memory resources. Hence, the function takes a fixed space or O(1) and does not depend on the input.&lt;/p&gt;

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

&lt;h3&gt;
  
  
  So how to optimize our code?
&lt;/h3&gt;

&lt;p&gt;Before optimizing the code, we should first understand the goal behind the optimization. Are we optimizing the code that is running a part of a batch job or are we optimizing a code that is being used in real-time while being accessed by thousands of users?&lt;/p&gt;

&lt;p&gt;The goal is very important, since, then we can work towards finding out alternate solutions for the problem, and we can compare their runtimes to satisfy our goal. &lt;/p&gt;

&lt;p&gt;While it might appear that constant time O(1) is probably better than linear time O(n), you must consider other factors such as is the code readable enough and is the code easy to maintain, how much memory is it consuming overall, etc. &lt;/p&gt;

&lt;p&gt;I hope you enjoyed the article. I sincerely hope this article can act as a useful guide especially for the non-computer science graduates who want to venture into the world of Software development.&lt;/p&gt;

&lt;p&gt;You can follow me on twitter &lt;a href="https://twitter.com/skay_tech" rel="noopener noreferrer"&gt;@skaytech&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  You will also enjoy the following articles:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://dev.to/skaytech/a-basic-introduction-to-webpack-4eke"&gt;A Basic Introduction to Webpack&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/skaytech/what-is-this-in-javascript-3d3i"&gt;What is 'this' in JavaScript?&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/skaytech/build-a-custom-spa-router-using-vanillajs-4a9l"&gt;Build a custom SPA Router in Vanilla JavaScript&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/skaytech/es6-understanding-destructuring-49np"&gt;ES6 - Destructuring&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/skaytech/the-war-var-vs-let-const-2a7l"&gt;ES6 - var, let &amp;amp; const&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/skaytech/es6-higher-order-functions-495e"&gt;ES6 - Higher Order Functions&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>100daysofcode</category>
      <category>codenewbie</category>
      <category>datastructures</category>
      <category>webdev</category>
    </item>
    <item>
      <title>What is Currying in JavaScript?</title>
      <dc:creator>skaytech</dc:creator>
      <pubDate>Fri, 09 Oct 2020 12:58:09 +0000</pubDate>
      <link>https://dev.to/dailydotdev/what-is-currying-in-javascript-3n9l</link>
      <guid>https://dev.to/dailydotdev/what-is-currying-in-javascript-3n9l</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;In this article, we will first look at what first-class citizens and higher-order functions are to lay the foundation to explain 'Currying' in JavaScript. The code samples provided along with the explanation should make it easy to follow and understand the concepts.&lt;/p&gt;

&lt;h2&gt;
  
  
  First-Class Citizens
&lt;/h2&gt;

&lt;p&gt;In JavaScript, the functions are treated as 'First Class' citizens. What this means is that any function can be returned to another function, since a function is fundamentally an object.&lt;/p&gt;

&lt;p&gt;Let us take a quick example to explain this better. The below code is an example of a simple function.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="c1"&gt;//A Simple Arrow Function returning a value '50'&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;sum&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="mi"&gt;50&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;

&lt;span class="c1"&gt;//Invoke the function and display the value on the console.&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="nf"&gt;sum&lt;/span&gt;&lt;span class="p"&gt;());&lt;/span&gt; &lt;span class="c1"&gt;//Output -&amp;gt; 50&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In the above example, the number 50 is returned when the function sum() is invoked.&lt;/p&gt;

&lt;p&gt;As per the definition of a First-Class citizen, we can return the function sum() instead of the value 50 as shown in the code example below.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="c1"&gt;//Return the Function sum() instead of returning the value by adding the additional ()&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;sum&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&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;50&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;

&lt;span class="c1"&gt;//Invoke the function and display the value on the console.&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="nf"&gt;sum&lt;/span&gt;&lt;span class="p"&gt;());&lt;/span&gt;

&lt;span class="cm"&gt;/*
Output
-------
() =&amp;gt; {
  return 50;
}
*/&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Higher-Order Functions
&lt;/h2&gt;

&lt;p&gt;Higher-order functions are functions that take other functions as arguments or functions that return a function as their result.&lt;/p&gt;

&lt;p&gt;The below code example will make the above explanation more clear.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="c1"&gt;//Callback Function - Returns the sum of a &amp;amp; b&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;sum&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;a&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;b&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="nx"&gt;a&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nx"&gt;b&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="c1"&gt;//Higher order function - takes 'func' as an argument &amp;amp; returns a 'func' for execution&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;higherOrderFunction&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;func&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;a&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;b&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="nf"&gt;func&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;a&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;b&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="c1"&gt;//Invoke the higherOrderFunction and pass 'sum' function as an argument with the digits 2 &amp;amp; 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="nf"&gt;higherOrderFunction&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="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt; &lt;span class="c1"&gt;//Output -&amp;gt; 5&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Things to note:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The function 'higherOrderFunction' accepts a function 'func' as a parameter.&lt;/li&gt;
&lt;li&gt;The function 'func' that is passed in as a parameter is referred to as a callback.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Array.forEach, Array.map, Array.filter are some examples of high-order functions.&lt;/p&gt;

&lt;h2&gt;
  
  
  Currying
&lt;/h2&gt;

&lt;p&gt;Currying a function is the process of taking a single function of multiple arguments and decomposing it into a sequence of functions that each take a single argument.&lt;/p&gt;

&lt;p&gt;Let us take the following simple example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="c1"&gt;//An Arrow function taking in arguments x &amp;amp; y and returning the sum&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;sum&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;x&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;y&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;x&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nx"&gt;y&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;

&lt;span class="c1"&gt;//Output -&amp;gt; 5&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="nf"&gt;sum&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;

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

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="c1"&gt;//By applying Currying the same can be broken into a function returning another function&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;sum&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;x&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;return &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;y&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;x&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nx"&gt;y&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="c1"&gt;//Output -&amp;gt; 5&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="nf"&gt;sum&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;)(&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Using ES6 Arrow Functions, the above code can further be written in a simple manner as shown below.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="c1"&gt;//Simplified way to write the function using ES6 - Arrow Functions&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;sum&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;x&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;y&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;x&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nx"&gt;y&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="c1"&gt;//Output -&amp;gt; 5&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="nf"&gt;sum&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;)(&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That's all there is to currying. Let us look at a practical use-case of where it can be applied.&lt;/p&gt;

&lt;h2&gt;
  
  
  A Practical Use-Case
&lt;/h2&gt;

&lt;p&gt;Let us assume we have to read entries from a database of an e-commerce application that has the entities, user, product, and ratings. &lt;/p&gt;

&lt;p&gt;To query a single product from the database, we can write a function 'getProductById' as shown below.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="c1"&gt;//Simplified way to write the function using ES6 - Arrow Functions&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;getProductById&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;connection&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;id&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;connection&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;select&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;products&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;where&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="nx"&gt;id&lt;/span&gt; &lt;span class="p"&gt;})&lt;/span&gt;    
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="c1"&gt;//Invoke the function getProductById by passing the connection object &amp;amp; the product Id&lt;/span&gt;
&lt;span class="nf"&gt;getProductById&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;connection&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;By applying the 'currying' concept, we can simplify the above code as shown below.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="c1"&gt;//By applying Currying -&amp;gt; The function productById will return a function that'll query the products table by 'id'.&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;getProductById&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;connection&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;id&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;connection&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;select&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;products&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;where&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="nx"&gt;id&lt;/span&gt; &lt;span class="p"&gt;})&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="c1"&gt;//Invoke the function getProductById by passing the connection object &amp;amp; the product Id&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;getProductByIdQuery&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;getProductById&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;connection&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="cm"&gt;/**
 * The Output of the above function 'getProductById' will be
 * 
 * (id) =&amp;gt; {
 *    connection.select('products').where({ id })
 * }
 * 
 * and it will be assigned to getProductByIdQuery function
 */&lt;/span&gt;

&lt;span class="c1"&gt;//getProductByIdQuery can be simply invoked to fetch the product by it's Id&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;product&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;getProductByIdQuery&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;//Ouput -&amp;gt; Return product matching the 'id' 1&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The advantages of the above approach:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The above approach obviously simplifies the code by avoiding the calling method to pass the 'connection' object repeatedly.&lt;/li&gt;
&lt;li&gt;Further, the biggest advantage is that we can encapsulate the 'connection' object by modifying the access level to the getProductById() function as private. In simple words, nobody should know about the 'connection' object who is querying for products.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;We can further apply the 'currying' concept to the above example and take it to the next level and make it even more generic, so that, you can query for products, users, and reviews table.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="c1"&gt;//By applying Currying -&amp;gt; The function productById will return a function that'll query the products table by 'id'.&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;getConnection&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;connection&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;table&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;id&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;connection&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;select&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;table&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;where&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="nx"&gt;id&lt;/span&gt; &lt;span class="p"&gt;})&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="c1"&gt;//While we initialize the application - Get the Database connection&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;getTableQuery&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;getConnection&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;connection&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="cm"&gt;/**
 * The Output of the above function 'getConnection' will be
 * (table) =&amp;gt; {
 *    (id) =&amp;gt; {
 *        connection.select('products').where({ id })
 *     }
 * }
 * and it will be assigned to getTableQuery function
 */&lt;/span&gt;

&lt;span class="c1"&gt;//Pass the table name 'products' to get the 'getProductById' query&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;getProductByIdQuery&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;getTableQuery&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;products&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="cm"&gt;/**
 * The Output of the above function 'getTableQuery' will be
 * 
 * (id) =&amp;gt; {
 *    connection.select('products').where({ id })
 * }
 * 
 * and it will be assigned to getProductByIdQuery function
 */&lt;/span&gt;

&lt;span class="c1"&gt;//getProductByIdQuery can be simply invoked to fetch the product by it's Id&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;product&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;getProductByIdQuery&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;//Ouput -&amp;gt; Return product matching the 'id' 1&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now that we have found a way to generalize querying any table, querying users and reviews are as simple as the code shown below.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="cm"&gt;/**
* Pass the table name to get the 'getUserById' and 'getReviewById' query
*/&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;getUserByIdQuery&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;getTableQuery&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;users&lt;/span&gt;&lt;span class="dl"&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;getReviewByIdQuery&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;getTableQuery&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;reviews&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="c1"&gt;//Fetch the user with the 'id' 5 using getUserByIdQuery&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;user&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;getUserByIdQuery&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="c1"&gt;//Fetch the review with the 'id' 10 using getReviewByIdQuery&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;review&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;getReviewByIdQuery&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

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

&lt;/div&gt;



&lt;p&gt;As you can see, using the above code simplifies things, promotes reuse, and overall encourages the use of encapsulation.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;&lt;a href="https://api.daily.dev/get?r=devto" rel="noopener noreferrer"&gt;daily.dev&lt;/a&gt; delivers the best programming news every new tab. We will rank hundreds of qualified sources for you so that you can hack the future.&lt;/em&gt;&lt;br&gt;
&lt;a href="https://api.daily.dev/get?r=devto" rel="noopener noreferrer"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fb996k4sm4efhietrzups.png" alt="Daily Poster"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>100daysofcode</category>
      <category>codenewbie</category>
      <category>javascript</category>
      <category>webdev</category>
    </item>
    <item>
      <title>5 Must-Read Tips to write a Killer Blog Article!</title>
      <dc:creator>skaytech</dc:creator>
      <pubDate>Wed, 30 Sep 2020 10:45:16 +0000</pubDate>
      <link>https://dev.to/skaytech/5-must-read-tips-to-write-a-killer-blog-article-510c</link>
      <guid>https://dev.to/skaytech/5-must-read-tips-to-write-a-killer-blog-article-510c</guid>
      <description>&lt;h2&gt;
  
  
  KISS - Keep it Simple, Stupid
&lt;/h2&gt;

&lt;p&gt;KISS is an acronym coined by the U.S Navy in 1960 (&lt;a href="https://en.wikipedia.org/wiki/KISS_principle"&gt;source wikipedia&lt;/a&gt;) and it is also a very famous design principle in the technology world. I cannot stress how much it also applies while writing your blog.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--DOsMK1pQ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1601457050165/c-0b_Sl4e.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--DOsMK1pQ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1601457050165/c-0b_Sl4e.jpeg" alt="tim-mossholder-7aBrZmwEQtg-unsplash.jpg"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It is recommended to have a simple introduction, telling the audience what they can expect from your blog article and what how the reader will benefit if they read the article. This sets up a good premise to capture the engagement of the reader.&lt;/p&gt;

&lt;p&gt;Likewise, a good conclusion summarizing the points that you've covered in your article, along with any reference links for further reading will be a good way to conclude the article.&lt;/p&gt;

&lt;p&gt;A bonus tip is to have your subscription and the twitter handle at the end of the post to ensure your reader has the ability to connect with you to increase your overall engagement.&lt;/p&gt;

&lt;h2&gt;
  
  
  KIC - Keep it Concise
&lt;/h2&gt;

&lt;p&gt;It is highly recommended to keep it to the point and concise. The simple reason being that your readers are generally very busy. Ask yourself if your reader could ready your entire article during a 5-10 coffee/tea break.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--GdC_5rMg--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1601457401780/GAbZVBPsX.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--GdC_5rMg--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1601457401780/GAbZVBPsX.jpeg" alt="annie-spratt-GNQV8xrXUis-unsplash.jpg"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;As a rule of thumb, the ideal length for an article is the length occupied when you press the 'Page Down' key 4 times. If you feel you want to explain more, then evaluate if you can make it into a series of articles vs one blog post.&lt;/p&gt;

&lt;p&gt;Regarding the content, break it down into points and turn them into sub-headings. Each sub-heading should have a logical start and end. As a bonus, it'll be good to conclude your sub-heading by introducing the next topic in your article. This improves your overall continuity and increases reader engagement.&lt;/p&gt;

&lt;h2&gt;
  
  
  Count the number of "You"s in the Article.
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--mWoBPR0X--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1601457551050/3jrmBnpJT.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--mWoBPR0X--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1601457551050/3jrmBnpJT.jpeg" alt="ben-robbins-S20PlUJRviI-unsplash.jpg"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;While this might sound silly, this is very important. Why? The simple reason is that I'm writing to you, the reader, and not for myself. So I'll comb through the article and change as many self-references as possible from "me" or "I" to "you"s in the article. &lt;/p&gt;

&lt;p&gt;If I'm not able to change it, it's a good indication that the article will never work in terms of engagement, since the readers will not be able to relate to the article nor the topic.&lt;/p&gt;

&lt;h2&gt;
  
  
  Use Illustrations, Images &amp;amp; Code Examples
&lt;/h2&gt;

&lt;p&gt;To the age-old saying of 'A picture is worth a 1000 words', it's cannot be more true especially when it comes to your blog article. If you are explaining an article, completing it with illustrations ensures that the concepts are reinforced in your brain.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--QP1qvHpt--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1601457813033/SXgcrlCHZ.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--QP1qvHpt--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1601457813033/SXgcrlCHZ.jpeg" alt="vivek-kumar-riAKT8Z7ifE-unsplash.jpg"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Images with the text help the readers consume content easily, as compared to just text, which can tend to get monotonous. Placing the images strategically within your article is important and care should be taken to not break the reader's flow while placing the images.&lt;/p&gt;

&lt;p&gt;A good rule of thumb is to either read out your article yourself or give it to a friend and ask them where it kind of gets monotonous or the attention slip away and place the image around those portions.  &lt;/p&gt;

&lt;p&gt;The above can be extended while embedding code snippets while writing your technical article. It is easier with code snippets, since, your article would naturally go about explaining the code.&lt;/p&gt;

&lt;h2&gt;
  
  
  Show and Tell
&lt;/h2&gt;

&lt;p&gt;Finally, you'll need to tell your reader how they've benefited from your article in a way they can identify. A good way to do this is by providing them with a bunch of actionable items, for example, you can provide them with the required resources to take the knowledge they have gained from your article and move forward.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--bSuOFbRL--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1601457934850/hkT0vNVvS.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--bSuOFbRL--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1601457934850/hkT0vNVvS.jpeg" alt="thought-catalog-xHaZ5BW9AY0-unsplash.jpg"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;For a technical article, providing a demo to your work and possibly the Github repository greatly increases engagement and is very satisfying to the reader.&lt;/p&gt;

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

&lt;p&gt;In simple words, write from your heart. Write about the things you are most passionate about and the rest will follow. Start writing consistently and you'll improve leaps and bounds.&lt;/p&gt;

&lt;p&gt;I hope you've enjoyed this article and I would like to recommend two more excellent articles on blogging tips:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://iamshadmirza.com/how-to-write-blog-without-motivation"&gt;How to write a blog without motivation?&lt;/a&gt; by &lt;a class="comment-mentioned-user" href="https://dev.to/iamshadmirza"&gt;@iamshadmirza&lt;/a&gt;
&lt;/p&gt;

&lt;p&gt;&lt;a href="https://blog.greenroots.info/how-to-write-consistently-a-guide-for-technical-writers"&gt;A Guide for writing consistently for technical writers!&lt;/a&gt; by &lt;a class="comment-mentioned-user" href="https://dev.to/atapas"&gt;@atapas&lt;/a&gt;
&lt;/p&gt;

&lt;p&gt;If you enjoy my articles, don't forget to Subscribe. You can also find me on Twitter &lt;a href="https://twitter.com/skay_tech"&gt;@skaytech&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  You may also enjoy the following articles:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://dev.to/skaytech/hiring-software-engineers-for-start-ups-an-engineering-manager-s-perspective-5b50"&gt;Hiring for Start-ups?&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/skaytech/why-do-you-want-to-work-for-us-interview-question-demystified-1gh2"&gt;Why do you want to work for us? Interview question Demystified&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/skaytech/a-basic-introduction-to-webpack-4eke"&gt;A Basic Introduction to Webpack&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/skaytech/what-is-this-in-javascript-3d3i"&gt;What is 'this' in JavaScript?&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/skaytech/docker-fundamentals-2ibi"&gt;Docker Fundamentals&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/skaytech/es6-understanding-destructuring-49np"&gt;ES6 - Destructuring&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/skaytech/the-war-var-vs-let-const-2a7l"&gt;ES6 - var, let &amp;amp; const&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/skaytech/es6-higher-order-functions-495e"&gt;ES6 - Higher Order Functions&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>100daysofcode</category>
      <category>codenewbie</category>
      <category>writing</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>How to Evaluate your Product Idea for Market Fitment?</title>
      <dc:creator>skaytech</dc:creator>
      <pubDate>Mon, 28 Sep 2020 08:08:15 +0000</pubDate>
      <link>https://dev.to/skaytech/how-to-evaluate-your-product-idea-for-market-fitment-n5e</link>
      <guid>https://dev.to/skaytech/how-to-evaluate-your-product-idea-for-market-fitment-n5e</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;This article is on Product Management and is based on my experience working with start-ups over the last few years. But, I would recommend all engineers to give it a read to understand the amount of effort that goes behind researching whether a product is really needed in the market or not, even, before it comes to the engineering team for productizing.&lt;/p&gt;

&lt;p&gt;Evaluating your product idea against the market is essential as it'll help you determine whether to go ahead with the decision of productizing your idea.&lt;/p&gt;

&lt;p&gt;This is a long article, but one that I have cherished writing, since it is such as an important step in the entire product management journey.&lt;/p&gt;

&lt;h2&gt;
  
  
  Product Opportunity Assessment
&lt;/h2&gt;

&lt;p&gt;The product opportunity assessment involves the following steps and the product manager must ensure that every step is given the due importance and enough time is allocated to do a thorough analysis.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--08jliQar--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1601278379736/TiCZkvDxP.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--08jliQar--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1601278379736/TiCZkvDxP.jpeg" alt="1.jpg"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The steps involved in product idea assessment are as follows:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Validate your product idea.&lt;/li&gt;
&lt;li&gt;Identify the target market.&lt;/li&gt;
&lt;li&gt;Determine the market size.&lt;/li&gt;
&lt;li&gt;Perform competitor analysis.&lt;/li&gt;
&lt;li&gt;Make a decision on productizing your idea.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Let us look at each of the steps in detail.&lt;/p&gt;

&lt;h2&gt;
  
  
  Validate your Product Idea
&lt;/h2&gt;

&lt;p&gt;To validate your product idea, your main focus area should be on the problem you are trying to solve. Understand whether there’s a need for your solution in the market.&lt;/p&gt;

&lt;p&gt;Use the following framework to validate your product idea:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Who are your customers?&lt;/li&gt;
&lt;li&gt;What are their use cases? Why should they use your product?&lt;/li&gt;
&lt;li&gt;How well is your product doing for their use cases? Are there obvious weak spots?&lt;/li&gt;
&lt;li&gt;What other features would improve those weak spots?&lt;/li&gt;
&lt;li&gt;How could your product get more users?&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--8qw6eITI--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1601278561260/ll9X1e1oH.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--8qw6eITI--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1601278561260/ll9X1e1oH.jpeg" alt="diggity-marketing-s8HyIEe7lF0-unsplash.jpg"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It is important to talk to several core target users and gather feedback on their pain points. Most often they would be talking about managing their existing problems through some sort of a workaround and usually, those are the ones your product should focus on.&lt;/p&gt;

&lt;p&gt;Many of you might ask yourself, How do I know that I've talked to enough sets of users? A simple answer to that is after a certain point, the issues/problems/concerns, etc. start getting repetitive and there’s nothing new added to the list of pain points. That’s usually a very good indication that you’ve covered your core user group.&lt;/p&gt;

&lt;p&gt;The following graph (inspired by Dean Olsen) gives an accurate illustration of how to segment the opportunities into the four quadrants as shown below:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--8tQuYCGr--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1601278710941/m_7S_sffv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--8tQuYCGr--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1601278710941/m_7S_sffv.png" alt="3.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Identify the Target Market
&lt;/h2&gt;

&lt;p&gt;The target market can be identified by segmenting your core users using various segmentation techniques as described here:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--FwNg7Dw6--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1601278741479/kcIFh-Bga.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--FwNg7Dw6--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1601278741479/kcIFh-Bga.png" alt="4.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Demographic Segmentation
&lt;/h3&gt;

&lt;p&gt;This segmentation technique is usually done based on various attributes such as age, gender, marital status, family size, income, etc.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--N2BcwDJO--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1601278780578/y_PYUyNC0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--N2BcwDJO--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1601278780578/y_PYUyNC0.png" alt="5.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;For example, If you are building an App for lending books for nursery kids, then your core user group would be women between the age of 25 - 45.&lt;/p&gt;

&lt;h3&gt;
  
  
  Behavioral Segmentation
&lt;/h3&gt;

&lt;p&gt;This segmentation technique uses Pareto analysis to drill down and segment users based on the usage of an existing solution.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--IBy4ntbX--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1601278812437/sY0pxg5ue.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--IBy4ntbX--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1601278812437/sY0pxg5ue.png" alt="6.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;For example, users who use the App only during promotional offers vs. users who are regular users can provide insights into how to roll out incentives to convert the ‘promotional’ users to ‘regular’ users.&lt;/p&gt;

&lt;h3&gt;
  
  
  Psychographic Segmentation
&lt;/h3&gt;

&lt;p&gt;This segmentation technique has gained huge popularity over recent years and it focuses on segmenting users based on their lifestyle choices, opinions, values, and interests.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--H8vKnlTk--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1601278850426/ro89BhMCl.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--H8vKnlTk--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1601278850426/ro89BhMCl.png" alt="7.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;For example, while two kinds of users might have a common interest in reading books, one user might be a Harry Potter fan whereas the other might be a Lord of the Rings fan. This helps in applying marketing techniques based on the user’s interests.&lt;/p&gt;

&lt;h3&gt;
  
  
  Need-based Segmentation
&lt;/h3&gt;

&lt;p&gt;This segmentation technique uses conjoint analysis to segment the market by the unique needs of a customer. In other words, the segmentation is done purely on the unique needs of the customer and that is a great input for need-based marketing.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--kdvQz3f5--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1601278926750/5xkFSD8lT.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--kdvQz3f5--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1601278926750/5xkFSD8lT.png" alt="8.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Determine the Market Size
&lt;/h2&gt;

&lt;p&gt;Once you identify the target market, the next step is to determine the market size. This is required so that it helps you understand the competition in the market and helps you determine the likely ROI for your investment.&lt;/p&gt;

&lt;p&gt;To determine market size:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Refer to published data. The only challenge though is that the data is often unavailable for the unorganized sector.&lt;/li&gt;
&lt;li&gt;Analyze competitor sales data from financial filings or sources like Dun &amp;amp; Bradstreet.&lt;/li&gt;
&lt;li&gt;Perform customer surveys to estimate the spending patterns and numbers.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--h1B2vAsA--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1601278991772/4Y4HDJtmo.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--h1B2vAsA--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1601278991772/4Y4HDJtmo.jpeg" alt="10.jpg"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The standard practices prescribed above are often time-consuming or are very expensive. In such cases, one can use either the ‘top-down’ approach or the ‘bottom-up’ approach to round up the market size in volume or units.&lt;/p&gt;

&lt;p&gt;Before we deep dive into these approaches, we should first understand what the terminologies ‘base data’ and ‘relational data’ mean.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Base Data - The Quantitative data from a published source or a previously conducted survey.&lt;/li&gt;
&lt;li&gt;Relational Data - The Quantitative data links between the base data and the target market size.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Now, let’s look at each approach with an example.&lt;/p&gt;

&lt;h3&gt;
  
  
  The top-down approach
&lt;/h3&gt;

&lt;p&gt;The top-down approach considers using data from a broader spectrum (i.e. the total population in a region, number of production facilities, etc.) as our base data and then postulate relational data based on a fraction of the market of our interest.&lt;/p&gt;

&lt;p&gt;The sample illustration shows the top-down approach to determining the market size for cigarettes.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Owri9a5p--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1601279044623/DrJY347zW.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Owri9a5p--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1601279044623/DrJY347zW.png" alt="11.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  The Bottom-up approach
&lt;/h3&gt;

&lt;p&gt;The bottom-up approach considers data from one data point as our base data and postulating the relational data based on the overall data of the market of our interest.&lt;/p&gt;

&lt;p&gt;The sample illustration shows how to estimate the revenue of Domino’s Pizza using the bottom-up approach.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--mY3K7ELB--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1601279076745/06_70ewez.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--mY3K7ELB--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1601279076745/06_70ewez.png" alt="12.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;While it might appear that using the above-mentioned estimation techniques might not give exact results, in reality, the results will largely be accurate enough to base some decisions on.&lt;/p&gt;

&lt;h2&gt;
  
  
  Perform Competitor analysis
&lt;/h2&gt;

&lt;p&gt;With the advent of the internet, knowing your competition has only gotten that much simpler. However, the trick lies in the ability to gather useful data from various sources on the web.&lt;/p&gt;

&lt;p&gt;I’ve listed a few methodologies and sources through which you can perform competitor analysis.&lt;/p&gt;

&lt;h3&gt;
  
  
  Google Search
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--G5vAETp3--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1601279156957/TP4hMRjHV.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--G5vAETp3--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1601279156957/TP4hMRjHV.jpeg" alt="nathana-reboucas-c4aT8MfEzdw-unsplash.jpg"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;By using effective keyword search techniques, you can find out a lot of information from a simple google search.&lt;/p&gt;

&lt;p&gt;However, you might need to collate this information for further analysis.&lt;/p&gt;

&lt;h3&gt;
  
  
  Product Hunt
&lt;/h3&gt;

&lt;p&gt;Product Hunt is probably one of the most sought out websites amongst Product Managers and technologists alike. A simple search for keywords lists all the possible similar solutions or products that exist in the market.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--WPHEH4fl--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1601279248740/6xCAWacu1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--WPHEH4fl--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1601279248740/6xCAWacu1.png" alt="13.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  AlternativeTo
&lt;/h3&gt;

&lt;p&gt;This website is probably the only one of it’s kind. It’s very unique and provides a list of alternative software to the ones which we already know. You’ll be amazed at the number of other possibilities that exist to the ones we use constantly.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--uKFof6Nn--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1601279265031/rnvgtmyAW.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--uKFof6Nn--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1601279265031/rnvgtmyAW.png" alt="14.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Crunchbase
&lt;/h3&gt;

&lt;p&gt;Crunchbase provides detailed information about various companies such as the year it was founded, funding type, last funding amount, stage of start-up (seed/series-A/series-B), investors, etc.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Eopp0R9i--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1601279288524/bb_7Y3zUb.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Eopp0R9i--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1601279288524/bb_7Y3zUb.png" alt="15.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Capterra
&lt;/h3&gt;

&lt;p&gt;Capterra provides comprehensive information on products focused on business and has over 700+ categories. You can use this site to get a detailed review of the company profile, reviews, product features, and pricing.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--N5_e19NS--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1601279308451/EZSgwzZxb.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--N5_e19NS--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1601279308451/EZSgwzZxb.png" alt="16.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Similarweb
&lt;/h3&gt;

&lt;p&gt;This site helps you provide information about traffic and traffic-acquisition strategies. Using Similarweb, you can determine how the competing companies are acquiring an audience and what are the typical touch-points of your audience to help you discover ways of tapping into your target market.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--InTqHQ_j--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1601279321800/xF3fO3fwA.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--InTqHQ_j--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1601279321800/xF3fO3fwA.png" alt="17.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now that you have data from the various sources, you’ll need to collate them in a spreadsheet to understand them. You must specifically give attention to the areas where users have pointed out issues with the competitor’s products. Those areas become your product’s focus areas to be the differentiator.&lt;/p&gt;

&lt;p&gt;While it is OK to have a product similar to the competition, your product essentially should have a variance of a minimum of 25% in terms of features and must ensure that it should distinctly be better than the existing solutions.&lt;/p&gt;

&lt;h2&gt;
  
  
  Decide Go/No-Go
&lt;/h2&gt;

&lt;p&gt;Once we are through with all the steps mentioned above and collect the required data from various sources listed above, we should put them together in an RWW matrix (Source) that'll help us decide on whether to pursue the opportunity or not.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--iy0-Hklg--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1601279350425/iA-tv8Jy2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--iy0-Hklg--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1601279350425/iA-tv8Jy2.png" alt="18.png"&gt;&lt;/a&gt;&lt;/p&gt;

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

&lt;p&gt;To summarize, by using the above framework, it provides a way to validate your product idea with the market before pursuing it. &lt;/p&gt;

&lt;p&gt;Often, people do not invest enough time researching each of the steps and end up making products that are not needed in the market or face difficulties marketing the product.&lt;/p&gt;

&lt;p&gt;I hope you have enjoyed this article. Do let me know your feedback and you can connect with me on Twitter &lt;a href="https://twitter.com/skay_tech"&gt;@skaytech.&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  You may also enjoy the following articles:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://dev.to/skaytech/what-is-value-proposition-1da4"&gt;What is Value Proposition&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/skaytech/hiring-software-engineers-for-start-ups-an-engineering-manager-s-perspective-5b50"&gt;Hiring for Start-ups?&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/skaytech/why-do-you-want-to-work-for-us-interview-question-demystified-1gh2"&gt;Why do you want to work for us? Interview question Demystified&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/skaytech/a-basic-introduction-to-webpack-4eke"&gt;A Basic Introduction to Webpack&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/skaytech/what-is-this-in-javascript-3d3i"&gt;What is 'this' in JavaScript?&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/skaytech/docker-fundamentals-2ibi"&gt;Docker Fundamentals&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/skaytech/es6-understanding-destructuring-49np"&gt;ES6 - Destructuring&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/skaytech/the-war-var-vs-let-const-2a7l"&gt;ES6 - var, let &amp;amp; const&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/skaytech/es6-higher-order-functions-495e"&gt;ES6 - Higher Order Functions&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>100daysofcode</category>
      <category>codenewbie</category>
      <category>product</category>
      <category>startup</category>
    </item>
    <item>
      <title>What is Event Loop in JavaScript?</title>
      <dc:creator>skaytech</dc:creator>
      <pubDate>Thu, 17 Sep 2020 06:45:43 +0000</pubDate>
      <link>https://dev.to/skaytech/what-is-event-loop-in-javascript-5356</link>
      <guid>https://dev.to/skaytech/what-is-event-loop-in-javascript-5356</guid>
      <description>&lt;h1&gt;
  
  
  Introduction
&lt;/h1&gt;

&lt;p&gt;JavaScript Event Loop is one of the most fundamental concepts that every developer must aspire to understand. It is also one of the most frequently asked interview questions. &lt;/p&gt;

&lt;p&gt;JavaScript essentially is Single-threaded, i.e., it can only execute one task at a time. So, what happens if one request takes more than 2 minutes to execute? Will the user be kept waiting for ever? It certainly not an ideal situation. Thankfully, JavaScript's Event loop architecture comes to the rescue, as it provides the ability to process multiple requests asynchronously.&lt;/p&gt;

&lt;p&gt;We will first look at the following components that constitute Event Loop Architecture.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The Call Stack&lt;/li&gt;
&lt;li&gt;Web API&lt;/li&gt;
&lt;li&gt;Event Queue&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Once we try and understand how they work together, then explaining Event Loop becomes very simple.&lt;/p&gt;

&lt;h1&gt;
  
  
  Call Stack
&lt;/h1&gt;

&lt;p&gt;The Call Stack is a part of the JavaScript Engine and it is simply a stack in which you can add an item and the item added first is processed last. In other words, it follows the FILO - 'First In Last Out' principle.&lt;/p&gt;

&lt;p&gt;A Call Stack acts as a placeholder or a holding area for all the JavaScript functions that have been fired for execution.&lt;/p&gt;

&lt;p&gt;Let us look at the below code sample and understand how the function 'sayHello' gets added to the Call Stack.&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;const&lt;/span&gt; &lt;span class="nx"&gt;sayHello&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="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="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Hello from Skay&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt; 

&lt;span class="nf"&gt;sayHello&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Step 1 - sayHello Function gets added to the Call Stack
&lt;/h2&gt;

&lt;p&gt;From the illustration below, you can see once the function sayHello() is invoked, it is added to the call stack.&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%2Fv1600265957223%2F82wyYK6tJ.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%2Fv1600265957223%2F82wyYK6tJ.png" alt="1-EventLoop-Function Gets Added to CallStack.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 2 &amp;amp; 3 - Function returns a value &amp;amp; gets popped from the Call Stack
&lt;/h2&gt;

&lt;p&gt;Once the function returns a value, the output 'Hello from Skay' gets displayed on the console. As soon as the function returns, almost immediately, the function is also popped off from the call stack.&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%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fiacmm2i5f8g80bxeajhm.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%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fiacmm2i5f8g80bxeajhm.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now, let's look at the below code example, with two functions and understand how JavaScript Engine executes it.&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;const&lt;/span&gt; &lt;span class="nx"&gt;sayHello&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="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="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Hello from Skay&lt;/span&gt;&lt;span class="dl"&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;const&lt;/span&gt; &lt;span class="nx"&gt;timeoutFunction&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nf"&gt;setTimeout&lt;/span&gt;&lt;span class="p"&gt;(()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="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="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Hello from Timeout Function&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="p"&gt;},&lt;/span&gt; &lt;span class="mi"&gt;1000&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nf"&gt;sayHello&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="nf"&gt;timeoutFunction&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;As discussed previously, the two functions are added to the Call Stack as shown below. And the function sayHello() is popped off the stack once the function execution completes.&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%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fk31cvzd1iv9e1cwjjs8r.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%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fk31cvzd1iv9e1cwjjs8r.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;However, as for the second function 'timeoutFunction', it returns a setTimeout function which is a part of the Web API. Let us look at what Web API is first.&lt;/p&gt;

&lt;h2&gt;
  
  
  Web API
&lt;/h2&gt;

&lt;p&gt;Web APIs are built into your web browser and they are able to process data from the browser to do complex useful things. The main thing to understand is that, they are not a part of the JavaScript language, but, they are built on top of the core JS language and provide additional capabilities such as Geolocation, LocalStorage, etc.&lt;/p&gt;

&lt;p&gt;So, coming back to our code example, when the function 'timeoutFunction' is executed, it returns the 'setTimeout' function and is popped off the stack.&lt;/p&gt;

&lt;p&gt;Since the 'setTimeout' function is part of the Web API, it gets moved to the Web API as shown below. Along with that, the timer function in Web API is set to 1 second (1000 ms) based on the argument we had passed to the 'setTimeout' function as shown in the illustration 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%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F3hfgvhayo1vuszozcgq9.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%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F3hfgvhayo1vuszozcgq9.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So, what happens after one second? Ideally, you would have anticipated that the function is returned back to the Call Stack for execution. However, instead, it adds it to the Event Queue.&lt;/p&gt;

&lt;h2&gt;
  
  
  Event Queue
&lt;/h2&gt;

&lt;p&gt;Event Queue is a data structure similar to Stack, which holds the data temporarily and the important thing to note is that the data added first is processed first. In other words, it follows the FIFO -&amp;gt; 'First in First out' principle.&lt;/p&gt;

&lt;p&gt;So after one second, the 'setTimeout' function from Web API is added to the Queue as shown 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%2Fv1600266525050%2F3ygLsK7Fq.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%2Fv1600266525050%2F3ygLsK7Fq.png" alt="5-EventLoop-Queue.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Event Loop
&lt;/h1&gt;

&lt;p&gt;Finally, the 'Event Loop' we've been waiting for. The function of Event Loop can simply be explained as connecting the Event Queue to the Call Stack.&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%2Fv1600266714579%2FPZtfMYUif.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%2Fv1600266714579%2FPZtfMYUif.png" alt="6-EventLoop-Event Loop.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Event Loop does the following:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Checks if the Call Stack is empty, i.e., if all the functions have completed their execution and they have been popped off the Call Stack.&lt;/li&gt;
&lt;li&gt;Once the Call Stack is empty, it moves the first item from the Event Queue to the Call Stack.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;When the setTimeout function gets added to the Call Stack, the function simply returns the output 'Hello from Timeout Function' on the console and is popped out of the Stack.&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%2Fv1600269327723%2FGlfscXuAq.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%2Fv1600269327723%2FGlfscXuAq.png" alt="7-Finish-EventLoop.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;That's all there is to know about Event Loop. Hope the explanation with illustrations provided a way to understand Event Loop in a simple manner.&lt;/p&gt;

&lt;p&gt;In fact, there's a tool to visualize the Even Loop in real time built by &lt;a href="https://twitter.com/philip_roberts" rel="noopener noreferrer"&gt;Philip Roberts&lt;/a&gt;, which you can access from &lt;a href="http://latentflip.com/loupe/" rel="noopener noreferrer"&gt;this link.&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Conclusion
&lt;/h1&gt;

&lt;p&gt;To summarize, in this article, we learnt about how JavaScript is Single-Threaded in nature and using Event Loop, it supports processing multiple-requests with the help of a Call Stack, Web API and Event Queue.&lt;/p&gt;

&lt;p&gt;Event Loop is basically the way where JavaScript engine looks at the queue to find out if there are any immediate functions to run and picks the one added first and moves it to the Call Stack.&lt;/p&gt;

&lt;p&gt;We demonstrated the above concept using the asynchronous setTimeout function which is a part of the Web API.&lt;/p&gt;

&lt;p&gt;I hope you enjoyed the article. If you did, please do subscribe to my newsletter and don't forget to follow me on Twitter &lt;a href="https://twitter.com/skay_tech" rel="noopener noreferrer"&gt;@skaytech&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  You may also enjoy the following articles:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://dev.to/skaytech/a-basic-introduction-to-webpack-4eke"&gt;A Basic Introduction to Webpack&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/skaytech/what-is-this-in-javascript-3d3i"&gt;What is 'this' in JavaScript?&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/skaytech/build-a-custom-spa-router-using-vanillajs-4a9l"&gt;Build a custom SPA Router in Vanilla JavaScript&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/skaytech/es6-understanding-destructuring-49np"&gt;ES6 - Destructuring&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/skaytech/the-war-var-vs-let-const-2a7l"&gt;ES6 - var, let &amp;amp; const&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/skaytech/es6-higher-order-functions-495e"&gt;ES6 - Higher Order Functions&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>javascript</category>
      <category>codenewbie</category>
      <category>100daysofcode</category>
      <category>webdev</category>
    </item>
    <item>
      <title>What is Value Proposition?</title>
      <dc:creator>skaytech</dc:creator>
      <pubDate>Thu, 10 Sep 2020 08:44:02 +0000</pubDate>
      <link>https://dev.to/skaytech/what-is-value-proposition-1da4</link>
      <guid>https://dev.to/skaytech/what-is-value-proposition-1da4</guid>
      <description>&lt;h2&gt;
  
  
  &lt;strong&gt;Introduction&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Over the past 4+ years, I've been working closely with Start-ups as an engineering manager and often would wear the hat of a product manager. One thing that was a common theme across every Start-up is the emphasis on the value they add to their customers.&lt;/p&gt;

&lt;p&gt;There have been many instances when I ask founders of a start-up to describe their value proposition and they end up describing their business model. But, the interesting thing is that the end customers do not care about the business model. They simply want to know “What’s in it for me?” if I buy your product. If the product already exists in the market, they also ask the question “Why should I buy it from you”? Those questions essentially become the Value Proposition.&lt;/p&gt;

&lt;p&gt;In this article, let us look at what value proposition is, and how to build a compelling value proposition statement. We will also take a look at a few examples of good value proposition statements.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;What is Value Proposition?&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;A value proposition is a statement that answers ‘why’ someone should do business with you. It should be able to convince a potential customer why your service or product will be of more value to them than similar offerings from your competition.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--wYp1ioWX--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1599725050413/QI7psOtKJ.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--wYp1ioWX--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1599725050413/QI7psOtKJ.jpeg" alt="https://cdn.hashnode.com/res/hashnode/image/upload/v1599725050413/QI7psOtKJ.jpeg"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;A value proposition must be able to convey these values in a short, clear, and concise manner to potential customers without the need for further explanation. Each proposition must be unique, as it is a method to communicate the differentiation points of a company to the target customers.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Why is Value Proposition Important?&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;A value proposition is an important part of your company’s business strategy. It is also a powerful tool to drive sales and customer base.&lt;/p&gt;

&lt;p&gt;Since it provides a way to influence the decision-making of customers, it is often displayed on a company’s marketing material such as the company website. A compelling value proposition significantly impacts the effectiveness of your company’s marketing strategies.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;How to create a Value Proposition?&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;There are many ways to create a really compelling value proposition. Let us look at three popular ones varying from complex mapping to simple formula.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Value Proposition Canvas&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Value proposition canvas is one of the most popular methodologies available to create a value proposition statement. It is highly recommended to use the canvas, especially if you are creating a value proposition for the first time. The reason primarily is that it represents a visual medium to capture our thoughts and it can help you focus on one section at once.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--UlJfxNP4--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1599725122943/t3DAx-8Xy.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--UlJfxNP4--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1599725122943/t3DAx-8Xy.png" alt="https://cdn.hashnode.com/res/hashnode/image/upload/v1599725122943/t3DAx-8Xy.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Source: &lt;a href="https://www.peterjthomson.com/wp-content/uploads/2013/11/Value-Proposition-Canvas.pdf"&gt;Peter Thompson&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;On the customer’s side, you’ll explore the wants (emotional drivers), needs (rational motivators), and fears (undesired outcomes). In general, the objective here is to try and understand the buyer’s perceived likelihood of failure, anxiety, or reputation at work.&lt;/p&gt;

&lt;p&gt;An example of a value proposition canvas for Evernote is shown below:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--xuQDTsi9--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1599725154710/CA8G6hwXv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--xuQDTsi9--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1599725154710/CA8G6hwXv.png" alt="https://cdn.hashnode.com/res/hashnode/image/upload/v1599725154710/CA8G6hwXv.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Source: &lt;a href="https://www.peterjthomson.com/wp-content/uploads/2013/11/Value-Proposition-Canvas.pdf"&gt;Peter Thompson&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Harvard Business School’s Essential Questions&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Harvard Business School’s Institute for Strategy &amp;amp; Competitiveness simplifies the process of defining the value proposition by establishing a connection between the company and its customers.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;While the value chain focuses internally on operations, the value proposition is the element of strategy that looks outward at customers, at the demand side of the business. The strategy is fundamentally integrative, bringing the demand and supply sides together.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--_OARaB_L--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1599725221578/tv3ix2lkw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--_OARaB_L--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1599725221578/tv3ix2lkw.png" alt="https://cdn.hashnode.com/res/hashnode/image/upload/v1599725221578/tv3ix2lkw.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Source: &lt;a href="https://www.isc.hbs.edu/strategy/creating-a-successful-strategy/pages/unique-value-proposition.aspx"&gt;Harvard Institute for Strategy &amp;amp; Competitiveness&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;You start the process by brainstorming as a small group (no more than 3) around the following questions:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Which customers are you going to serve?&lt;/li&gt;
&lt;li&gt;What needs are you going to meet?&lt;/li&gt;
&lt;li&gt;What relative price will provide acceptable value to your customers and acceptable profitability for the company?&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Depending on your offering (product/service), it may make sense for you to start with the first or second question in the list. Together, all three questions create a triangle as shown in the illustration above, to create a succinct value proposition.&lt;/p&gt;

&lt;p&gt;You will come to realize which one is the “primary” leg of the triangle as you move through the exercise. For example, is the greatest value that you offer is cost savings? Or, is it that you’re offering a better product or experience at a premium cost?&lt;/p&gt;

&lt;p&gt;Harvard’s experts use the iPad as a great example. Apple created a new demand that did not exist in the market. Customers did not realize they wanted a tablet until the iPad came along.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Steve Blank Formula&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://steveblank.com/2011/09/22/how-to-build-a-web-startup-lean-launchpad-edition/"&gt;Steve Blank&lt;/a&gt;, a former Google employee, realized that many startup founders struggle when coming up with a concise value proposition and often emphasize the product features rather than the benefits they offer to the customers.&lt;/p&gt;

&lt;p&gt;Steve came up with a simple formula to transform the brainstorming process into a simple sentence.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"We help (X) do (Y) by doing (Z)"&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The formula is based on the principle that the first thing that comes to the mind may be the best. Your gut instinct could be spot on and that’s what makes this simple solution valuable.&lt;/p&gt;

&lt;p&gt;For example, your local ice cream shop may have a value proposition similar to this one:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;“We help our local customers satisfy their sweet tooth by providing them premium natural ice-cream in a community-focused space.”&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Although you may have brainstormed as a group, you should ask participants to come up with the value proposition individually. It is often the case that each participant perceives the value they offer to their potential customers differently and this can yield helpful insights in coming up with a compelling value proposition.&lt;/p&gt;

&lt;p&gt;Lastly, as you draft your value proposition, remember to use the voice of the customer. When you use the customer’s voice, you will address the gap between what you say and what you hear.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Examples of Compelling Value Proposition&lt;/strong&gt;
&lt;/h2&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Novo Watch&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;To summarize, the value proposition is all about understanding what needs of the customer you are able to meet, and how your product or service offering stands out amongst the competition that compels the customer to always favor your product or service in the market. It is important to continue to listen to your customer, evaluate how to adjust your value proposition to the ever-changing needs of the customer and markets.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--scqek3NV--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1599725372397/g4s9GtRJg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--scqek3NV--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1599725372397/g4s9GtRJg.png" alt="https://cdn.hashnode.com/res/hashnode/image/upload/v1599725372397/g4s9GtRJg.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;The Value Proposition&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;“&lt;em&gt;Timepieces handmade in Alberta from repurposed pieces of history&lt;/em&gt;”&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;What is so compelling?&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;It cannot get any more transparent than the message it conveys on the landing page of their website. It tells us why their product is valuable.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;It is handmade, which means it’s quality.&lt;/li&gt;
&lt;li&gt;Repurposed pieces of history. Even if the layman doesn’t understand those terminologies, the word history certainly signifies that there’s a unique story behind their creation.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Once you scroll down their website, you’ll see words such as “handcrafted” and “reflect history” are repeated. Not only did they do a fantastic job of presenting value upfront, but they also reinforced their core values of craftsmanship and recycled materials throughout their website.&lt;/p&gt;

&lt;h3&gt;
  
  
  Less Accounting
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--LplrxCxw--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1599725406367/g0wK9a2-2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--LplrxCxw--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1599725406367/g0wK9a2-2.png" alt="https://cdn.hashnode.com/res/hashnode/image/upload/v1599725406367/g0wK9a2-2.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;The Value Proposition&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;em&gt;“Simple accounting software for entrepreneurs who &lt;/em&gt;&lt;em&gt;dislike&lt;/em&gt;&lt;em&gt; accounting.”&lt;/em&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;What is so compelling?&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Less accounting’s value proposition addresses the following:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;It immediately addresses the target audience: entrepreneurs.&lt;/li&gt;
&lt;li&gt;The word ‘dislike’ is highlighted and underlined to convey the strong message that customers need not know accounting concepts to operate the software.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;On their website, as you scroll down, they highlight the simplicity of the software through words such as accessible, convenient, and manageable. There’s a specific use-case highlighted in the sentence ‘&lt;em&gt;Be ready for tax time&lt;/em&gt;’.&lt;/p&gt;

&lt;h3&gt;
  
  
  Unbounce
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--_Xt8LNp_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1599725446712/hHtmp-u1o.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--_Xt8LNp_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1599725446712/hHtmp-u1o.png" alt="https://cdn.hashnode.com/res/hashnode/image/upload/v1599725446712/hHtmp-u1o.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;The Value Proposition&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;&lt;em&gt;“Build, Publish, and A/B Test Landing pages without I.T.”&lt;/em&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;What is so compelling?&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Their landing page is very interesting. They have made a dynamic landing page which animates, showcasing their value proposition in three simple phrases:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Convert More Leads&lt;/li&gt;
&lt;li&gt;Convert More Sales&lt;/li&gt;
&lt;li&gt;Convert More Customers&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The brand lays out its offerings without coming off as too sales-y. It clearly talks to the target audience i.e., the marketers, and talks to their core pain point of deferring the work of creating landing pages to I.T.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Value Proposition Evolves Over Time&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;It is important to note that value proposition evolves over time especially with changing customers, markets, or even other factors such as the global pandemic that we are currently caught up in.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--00u-NsYM--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1599725502961/MI3OCLOem.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--00u-NsYM--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1599725502961/MI3OCLOem.jpeg" alt="https://cdn.hashnode.com/res/hashnode/image/upload/v1599725502961/MI3OCLOem.jpeg"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Photo by &lt;a href="https://unsplash.com/@cdc?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText"&gt;CDC&lt;/a&gt; on &lt;a href="https://unsplash.com/"&gt;Unsplash&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;A very relevant example of the same would be how food delivery companies such as Swiggy, Zomato or e-commerce companies such as Amazon, Flipkart now had to go back to their value proposition and ensure that the topmost concern for their customer today is safety and not just timely delivery or ensuring there’s adequate tracking for your delivery.&lt;/p&gt;

&lt;p&gt;They will have to emphasize and ensure how their service or product offering has adapted to the COVID-19 situation and how they continue to offer their promise ensuring ‘safety’ is of paramount importance. There’s a dedicated COVID-19 web page added to their site and sections highlighting how customers can contact their specialized team to know more about what they do to ensure they have the highest safety standards implemented. All of these steps, directly work towards ensuring that they address what the customer considers to be the utmost value, i.e., safety against COVID-19.&lt;/p&gt;

&lt;h1&gt;
  
  
  Conclusion
&lt;/h1&gt;

&lt;p&gt;To summarize, the value proposition is all about understanding what needs of the customer you are able to meet, and how your product or service offering stands out amongst the competition that compels the customer to always favor your product or service in the market.&lt;/p&gt;

&lt;p&gt;It is important to continue to listen to your customer, evaluate how to adjust your value proposition to the ever-changing needs of the customer and markets.&lt;/p&gt;

&lt;p&gt;This is my first article on Product Management. Do let me know your thoughts, comment on whether you would like to see me publish articles on Product or just stick to technology related ones. Thank you for reading so far and you can connect me on Twitter -&amp;gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  You will also likely enjoy the following articles:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://dev.to/skaytech/hiring-software-engineers-for-start-ups-an-engineering-manager-s-perspective-5b50"&gt;Hiring for Start-ups? An Engineering Manager's Perspective&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/skaytech/why-do-you-want-to-work-for-us-interview-question-demystified-1gh2"&gt;Why do you want to work for us? Interview Question Demystified&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/skaytech/es6-higher-order-functions-495e"&gt;ES6 - Higher Order Functions&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/skaytech/es6-understanding-destructuring-49np"&gt;ES6 - Understanding Destructuring&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/skaytech/a-practical-guide-to-help-you-stay-more-organised-productive-3p0g"&gt;A Practical Guide to staying organized &amp;amp; productive&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/skaytech/understanding-closures-1501"&gt;Understanding Closures&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/skaytech/the-war-var-vs-let-const-2a7l"&gt;ES6 - var, let &amp;amp; const&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/skaytech/understanding-hoisting-b48"&gt;Understanding Hoisting&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>100daysofcode</category>
      <category>codenewbie</category>
      <category>productmanagement</category>
      <category>webdev</category>
    </item>
  </channel>
</rss>
