<?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: Phani Murari</title>
    <description>The latest articles on DEV Community by Phani Murari (@phanimurari).</description>
    <link>https://dev.to/phanimurari</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%2F407701%2F77f3b89e-9a3e-468b-805f-85f2eb24d614.jpeg</url>
      <title>DEV Community: Phani Murari</title>
      <link>https://dev.to/phanimurari</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/phanimurari"/>
    <language>en</language>
    <item>
      <title>🚀 Mastering the 10 Pillars of Front-End</title>
      <dc:creator>Phani Murari</dc:creator>
      <pubDate>Fri, 22 Sep 2023 18:03:48 +0000</pubDate>
      <link>https://dev.to/phanimurari/mastering-the-10-pillars-of-front-end-5fa</link>
      <guid>https://dev.to/phanimurari/mastering-the-10-pillars-of-front-end-5fa</guid>
      <description>&lt;h4&gt;
  
  
  Dive into concise explanations, relatable examples, and handy code snippets for every essential concept a senior developer must know! 🔥
&lt;/h4&gt;




&lt;h2&gt;
  
  
  🔄 1. Event Loop
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Explanation:&lt;/strong&gt; The event loop checks if the call stack is empty. If so, it checks the message queue for waiting events and executes them.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Example:&lt;/strong&gt; 🍳 Think of a chef (event loop) checking if there's a dish (task) ready. If yes, it's served. If not, they check for new orders (events).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Code:&lt;/strong&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="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;First&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="nx"&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="nx"&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;Second&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;0&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Third&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;  &lt;span class="c1"&gt;// Outputs: First, Third, Second&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/EventLoop"&gt;📚 Official Resource&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  🎨 2. Critical Rendering Path
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Explanation:&lt;/strong&gt; The steps a browser follows to convert HTML, CSS, and JavaScript into visible pixels.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Example:&lt;/strong&gt; 🏢 Think of constructing a building: foundation (DOM), design (CSSOM), and paint (rendering).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Official Resource:&lt;/strong&gt; &lt;a href="https://developers.google.com/web/fundamentals/performance/critical-rendering-path"&gt;📚 Google Developers - Critical Rendering Path&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  🖋️ 3. Let, Const, Var and Block Scoping
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Explanation:&lt;/strong&gt; &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;var&lt;/code&gt;: function-scoped, re-declarable, and updatable.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;let&lt;/code&gt;: block-scoped, not re-declarable, but updatable.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;const&lt;/code&gt;: block-scoped, neither re-declarable nor updatable.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Example:&lt;/strong&gt; 🏫 In a classroom: sections (&lt;code&gt;var&lt;/code&gt;), roll numbers in a section (&lt;code&gt;let&lt;/code&gt;), and birth names (&lt;code&gt;const&lt;/code&gt;).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Code:&lt;/strong&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="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;x&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;10&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="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="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;x&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;20&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;y&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;30&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;z&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;40&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;x&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;  &lt;span class="c1"&gt;// Outputs: 20&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/var"&gt;📚 Official Resource&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  🧠 4. Closure
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Explanation:&lt;/strong&gt; A function having access to its own variables, outer function's variables, and global variables.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Example:&lt;/strong&gt; 🙋 A person remembering their name, family name, and celebrities' names.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Code:&lt;/strong&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="kd"&gt;function&lt;/span&gt; &lt;span class="nx"&gt;outer&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;outerVar&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Outside!&lt;/span&gt;&lt;span class="dl"&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;inner&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;outerVar&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;inner&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;myClosure&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;outer&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="nx"&gt;myClosure&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;  &lt;span class="c1"&gt;// Outputs: Outside!&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Closures"&gt;📚 Official Resource&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  🔄 5. Functional Programming
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Explanation:&lt;/strong&gt; A paradigm where functions are primary, emphasizing immutability and pure functions.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Example:&lt;/strong&gt; 🥪 Making sandwiches using fresh ingredients and the same recipe.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Code:&lt;/strong&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="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;array&lt;/span&gt; &lt;span class="o"&gt;=&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="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="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;double&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;array&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;item&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;item&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;  &lt;span class="c1"&gt;// [2, 4, 6]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function"&gt;📚 Official Resource&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  🔍 6. This Keyword Behavior
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Explanation:&lt;/strong&gt; &lt;code&gt;this&lt;/code&gt; refers to the object executing the current function. Its context varies.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Example:&lt;/strong&gt; 🎓 In class, &lt;code&gt;this&lt;/code&gt; student means the one answering.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Code:&lt;/strong&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="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;obj&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;John&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;sayName&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="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;this&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;name&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;
&lt;span class="nx"&gt;obj&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;sayName&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;  &lt;span class="c1"&gt;// Outputs: John&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/this"&gt;📚 Official Resource&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  🛠️ 7. Frameworks Usage
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Explanation:&lt;/strong&gt; Frameworks offer a structure for faster development. Understand their core concepts and the problems they solve.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Example:&lt;/strong&gt; 🚗 Use a car for long distances, not a short walk.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Official Resource:&lt;/strong&gt; Varies, e.g., &lt;a href="https://reactjs.org/docs/getting-started.html"&gt;📚 React Docs&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  👩‍👩‍👧 8. Prototypical Inheritance
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Explanation:&lt;/strong&gt; In JavaScript, objects inherit properties and methods from others. This is prototypical inheritance.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Example:&lt;/strong&gt; 👪 Children inheriting traits from parents.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Code:&lt;/strong&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="kd"&gt;function&lt;/span&gt; &lt;span class="nx"&gt;Parent&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{}&lt;/span&gt;
&lt;span class="nx"&gt;Parent&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;prototype&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;sayHello&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="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Hello from parent&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;function&lt;/span&gt; &lt;span class="nx"&gt;Child&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{}&lt;/span&gt;
&lt;span class="nx"&gt;Child&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;prototype&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;Object&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;create&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;Parent&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;prototype&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;child&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nx"&gt;Child&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="nx"&gt;child&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;sayHello&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;  &lt;span class="c1"&gt;// Outputs: Hello from parent&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Inheritance_and_the_prototype_chain"&gt;📚 Official Resource&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  ⌚ 9. Async, Await vs. Promises
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Explanation:&lt;/strong&gt; &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;Promises&lt;/code&gt;: Handle asynchronous operations with states (pending, fulfilled, rejected).&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;async/await&lt;/code&gt;: Makes asynchronous code look synchronous.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Example:&lt;/strong&gt; 📅 Promise is like a task promise. Async/await marks it on a to-do list and waits.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Code:&lt;/strong&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="c1"&gt;// Promise&lt;/span&gt;
&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nx"&gt;fetchData&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="k"&gt;new&lt;/span&gt; &lt;span class="nb"&gt;Promise&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;resolve&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;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;resolve&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Data fetched&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;2000&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;// async/await&lt;/span&gt;
&lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nx"&gt;fetchAndDisplay&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;data&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;fetchData&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
  &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;data&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;&lt;a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise"&gt;📚 Official Resource&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  ⏲️ 10. Debounce vs Throttle
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Explanation:&lt;/strong&gt; &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;Debounce&lt;/code&gt;: Groups events if they're in quick succession.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;Throttle&lt;/code&gt;: Executes a function at most once in a specified period.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Example:&lt;/strong&gt; 🗣️ Debounce waits for someone to finish speaking. Throttle limits speech to once every minute.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Code:&lt;/strong&gt; Using Lodash:&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="c1"&gt;// Debounce&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;debouncedSave&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;_&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;debounce&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;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Saved&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="mi"&gt;300&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="c1"&gt;// Throttle&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;throttledSave&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;_&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;throttle&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;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Saved&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="mi"&gt;300&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://lodash.com/docs/"&gt;📚 Official Resource&lt;/a&gt;&lt;/p&gt;




&lt;p&gt;Best of luck with your interviews! 🍀🚀&lt;/p&gt;

</description>
      <category>frontend</category>
      <category>job</category>
      <category>hire</category>
      <category>javascript</category>
    </item>
    <item>
      <title>React Hooks - useEffect()</title>
      <dc:creator>Phani Murari</dc:creator>
      <pubDate>Fri, 21 Jul 2023 18:12:15 +0000</pubDate>
      <link>https://dev.to/phanimurari/react-hooks-useeffect-56m1</link>
      <guid>https://dev.to/phanimurari/react-hooks-useeffect-56m1</guid>
      <description>&lt;h2&gt;
  
  
  Hey HOOOKERRRR!!!! 👋
&lt;/h2&gt;

&lt;p&gt;Today, we're diving into the magical world of React Hooks - focusing specifically on the &lt;code&gt;useEffect()&lt;/code&gt; Hook. So buckle up and let's get this ride started! 🚀&lt;/p&gt;

&lt;h2&gt;
  
  
  Wait, what's &lt;code&gt;useEffect()&lt;/code&gt;? 🤔
&lt;/h2&gt;

&lt;p&gt;Great question! If you're familiar with lifecycle methods in class components like &lt;code&gt;componentDidMount&lt;/code&gt;, &lt;code&gt;componentDidUpdate&lt;/code&gt;, and &lt;code&gt;componentWillUnmount&lt;/code&gt;, you can think of &lt;code&gt;useEffect()&lt;/code&gt; as all these combined into one. Yes, you heard that right! One Hook to rule them all. 👑&lt;/p&gt;

&lt;p&gt;But hold on, here comes the real kicker - &lt;code&gt;useEffect()&lt;/code&gt; is for functional components. Now that's pretty neat, huh? 😲&lt;/p&gt;

&lt;h2&gt;
  
  
  Alright, I'm intrigued. But why should I use it?
&lt;/h2&gt;

&lt;p&gt;Excited about &lt;code&gt;useEffect()&lt;/code&gt;, but not sure why you'd want to use it? No worries! Let me break it down for you:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;You know when you have to do something extra in your app like getting data from a server, changing something on the screen, or setting up an ongoing process? That's what we call 'side effects', and &lt;code&gt;useEffect()&lt;/code&gt; is like a magic tool for handling these in functions. 🧰&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Remember how in class components, you might have to write the same code in different lifecycle methods? &lt;code&gt;useEffect()&lt;/code&gt; helps you avoid this repeat performance by allowing you to put your code in one place only. It's all about that tidy life! 🧹&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Now let's talk about our good friend &lt;code&gt;useState()&lt;/code&gt;. If you enjoyed how &lt;code&gt;useState()&lt;/code&gt; made your code shorter and more readable, you're going to love &lt;code&gt;useEffect()&lt;/code&gt; for the same reasons! It helps to keep your code neat, tidy, and easy on the eyes. 🌈&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Feel like a superhero with Hooks yet? Let's fly into more details! 🚀&lt;/p&gt;

&lt;h2&gt;
  
  
  Let's get hands-on with &lt;code&gt;useEffect()&lt;/code&gt;. 🔧
&lt;/h2&gt;

&lt;p&gt;To use &lt;code&gt;useEffect()&lt;/code&gt;, you need to call it with a function (which runs your side effect) and an array of dependencies. If any of the dependencies change, the effect will run again.&lt;/p&gt;

&lt;p&gt;Here's the basic syntax:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;useEffect(() =&amp;gt; {
    // Your side effect goes here.
}, [/* your dependencies go here */]);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Example&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Let's say we want to fetch a user's data from an API and display it. With &lt;code&gt;useEffect()&lt;/code&gt;, it's a piece of cake:&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="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;useEffect&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;useState&lt;/span&gt; &lt;span class="p"&gt;}&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="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nx"&gt;UserProfile&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="nx"&gt;userId&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="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;user&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;setUser&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;useState&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

  &lt;span class="nx"&gt;useEffect&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;fetch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;`https://api.example.com/users/&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;userId&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&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;then&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;response&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;response&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;json&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt;
      &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;then&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;data&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;setUser&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;data&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="nx"&gt;userId&lt;/span&gt;&lt;span class="p"&gt;]);&lt;/span&gt; &lt;span class="c1"&gt;// We're using userId as a dependency&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="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;user&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;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;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="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="nx"&gt;p&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;user&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;description&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;/p&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="p"&gt;(&lt;/span&gt;
        &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;p&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nx"&gt;Loading&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;/p&lt;/span&gt;&lt;span class="err"&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="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;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="nx"&gt;UserProfile&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In this example, whenever &lt;code&gt;userId&lt;/code&gt; changes, our effect will run, fetching the new user's data and updating the &lt;code&gt;user&lt;/code&gt; state. &lt;/p&gt;

&lt;h2&gt;
  
  
  Cleaning up with &lt;code&gt;useEffect()&lt;/code&gt;. 🧹
&lt;/h2&gt;

&lt;p&gt;Sometimes, your effect might set up something that needs to be cleaned up before the component unmounts, or before the effect runs again. For that, you can return a cleanup function from your effect.&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="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;useEffect&lt;/span&gt; &lt;span class="p"&gt;}&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="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nx"&gt;Timer&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;useEffect&lt;/span&gt;&lt;span class="p"&gt;(()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;timeoutId&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&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="nx"&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;One second has passed!&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="k"&gt;return&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;clearTimeout&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;timeoutId&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;span class="c1"&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 this case, if &lt;code&gt;Timer&lt;/code&gt; were to unmount before the timeout finishes, the cleanup function would run and prevent the timeout callback from causing an error.&lt;/p&gt;

&lt;p&gt;Pretty cool, right? 😎&lt;/p&gt;

&lt;p&gt;For a more detailed look at &lt;code&gt;useEffect()&lt;/code&gt;, you can always refer to the official React documentation &lt;a href="https://reactjs.org/docs/hooks-effect.html"&gt;here&lt;/a&gt;. &lt;/p&gt;

&lt;p&gt;Happy coding! ✌️&lt;/p&gt;

&lt;p&gt;Want to join me on this coding adventure beyond the blog? &lt;/p&gt;

&lt;h3&gt;
  
  
  I'm Phani Murari
&lt;/h3&gt;

&lt;p&gt;Let's connect and keep the learning going  🚀&lt;/p&gt;

&lt;p&gt;📸 &lt;a href="https://www.instagram.com/im_phani_murari/"&gt;Instagram&lt;/a&gt; - For behind-the-scenes, daily life and more tech tips.&lt;/p&gt;

&lt;p&gt;💼 &lt;a href="https://www.linkedin.com/in/phanimurari/"&gt;LinkedIn&lt;/a&gt; - For professional insights, my latest work updates, and networking opportunities.&lt;/p&gt;

&lt;p&gt;Looking forward to meeting you in the digital world! 🌐&lt;/p&gt;

</description>
      <category>react</category>
      <category>hooks</category>
      <category>beginners</category>
      <category>javascript</category>
    </item>
    <item>
      <title>Coding vs Programming: Let's Clear the Confusion</title>
      <dc:creator>Phani Murari</dc:creator>
      <pubDate>Sun, 16 Apr 2023 18:23:52 +0000</pubDate>
      <link>https://dev.to/phanimurari/coding-vs-programming-lets-clear-the-confusion-1chn</link>
      <guid>https://dev.to/phanimurari/coding-vs-programming-lets-clear-the-confusion-1chn</guid>
      <description>&lt;p&gt;Hello Friends! 🙌&lt;/p&gt;

&lt;p&gt;Welcome to the exciting world of technology! As newcomers, it's common to wonder about the difference between &lt;strong&gt;coding&lt;/strong&gt; and &lt;strong&gt;programming&lt;/strong&gt;. 🤔 To help you understand the distinction, we'll use a simple, relatable analogy and provide clear examples.&lt;/p&gt;

&lt;p&gt;Picture yourself building a house. In this scenario, &lt;em&gt;coding&lt;/em&gt; represents the bricklaying process, while &lt;em&gt;programming&lt;/em&gt; encompasses the overall planning, design, and management of the construction. Intrigued? Let's explore each concept in more detail.&lt;/p&gt;

&lt;h2&gt;
  
  
  Coding: Writing the Instructions 🖥️
&lt;/h2&gt;

&lt;p&gt;Coding is like learning a new spoken language such as Hindi, English, or Bengali. You're translating human-readable instructions into a language that computers can understand. This is done by writing code using a specific programming language like Python, Java, or C++.&lt;/p&gt;

&lt;h3&gt;
  
  
  A Simple Coding Example 🌟
&lt;/h3&gt;

&lt;p&gt;Imagine you want to add two numbers using Python:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;number1&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;
&lt;span class="n"&gt;number2&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;7&lt;/span&gt;

&lt;span class="nb"&gt;sum&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;number1&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;number2&lt;/span&gt;

&lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"The sum of"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;number1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"and"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;number2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"is"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;sum&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here, you write the code to add two numbers using Python's syntax. This is the essence of coding.&lt;/p&gt;

&lt;h2&gt;
  
  
  Programming: Solving Problems with Code 🧠
&lt;/h2&gt;

&lt;p&gt;Programming goes beyond simply writing code. It's the process of designing, implementing, and maintaining a software solution to a problem. Programming includes problem-solving, designing algorithms, creating data structures, and understanding the logic behind the code. In short, programming involves coding, testing, debugging, and analyzing.&lt;/p&gt;

&lt;h3&gt;
  
  
  A Practical Programming Example 🔧
&lt;/h3&gt;

&lt;p&gt;Picture yourself building an e-commerce website like Amazon or Flipkart. You would need to:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Understand the requirements (features, user interface, etc.)&lt;/li&gt;
&lt;li&gt;Design the database and data structures&lt;/li&gt;
&lt;li&gt;Develop algorithms for searching, sorting, and filtering products&lt;/li&gt;
&lt;li&gt;Write the code (coding) in a programming language&lt;/li&gt;
&lt;li&gt;Test and debug the code&lt;/li&gt;
&lt;li&gt;Optimize performance&lt;/li&gt;
&lt;li&gt;Deploy and maintain the website&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;In this example, programming involves a wide range of tasks, with coding being just one of many steps.&lt;/p&gt;

&lt;h2&gt;
  
  
  Wrapping It Up 🎁
&lt;/h2&gt;

&lt;p&gt;Coding and programming are related but distinct concepts. While coding involves writing code in a programming language, programming is the comprehensive process of creating a software solution, including design, implementation, and maintenance. Grasping the difference between the two will not only help you communicate more effectively in the tech world but also allow you to decide which aspect you'd like to concentrate on as you learn and grow in the field.&lt;/p&gt;

&lt;p&gt;I hope this article has made the distinction between coding and programming engaging, clear, and easy to understand. If you have any questions or need further clarification, please feel free to comment below, and I'll be happy to help! 😊&lt;/p&gt;

&lt;p&gt;Happy learning, and best of luck on your tech journey! 🚀&lt;/p&gt;

</description>
      <category>programming</category>
      <category>coding</category>
    </item>
    <item>
      <title>Deploying Node Application using Render</title>
      <dc:creator>Phani Murari</dc:creator>
      <pubDate>Thu, 23 Mar 2023 18:23:16 +0000</pubDate>
      <link>https://dev.to/phanimurari/deploying-node-application-using-render-1223</link>
      <guid>https://dev.to/phanimurari/deploying-node-application-using-render-1223</guid>
      <description>&lt;h4&gt;
  
  
  Are you ready to take your Node.js application to the next level 🚀?
&lt;/h4&gt;

&lt;p&gt;If you're looking for a hassle-free simple step by step way to deploy your app and get it up and running in minutes, then you're in luck!&lt;/p&gt;

&lt;p&gt;In this post, we're going to explore how to deploy a Node.js application using Render, a powerful cloud platform that makes deployment fast, easy, and reliable. &lt;/p&gt;

&lt;p&gt;Whether you're a seasoned developer or just starting out, you'll find everything you need to know to get your application up and running in no time. &lt;/p&gt;

&lt;p&gt;In this post we learn how to deploy a simple login Node application using the render.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Let's deploy the below sample Login Application to render.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Github Repository URL :&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/phanimurari/dev-post-sample-login-app.git" rel="noopener noreferrer"&gt;https://github.com/phanimurari/dev-post-sample-login-app.git&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I highly recommend trying out the above GitHub repository and getting hands-on experience by deploying a sample login application locally.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Let's jump into deploying part&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step1:&lt;/strong&gt; &lt;/p&gt;

&lt;p&gt;Create a Account on &lt;a href="https://render.com/" rel="noopener noreferrer"&gt;Render&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It is highly recommended to register on Render using your GitHub account as it enables seamless integration of your project repositories on GitHub with the Render services. &lt;/p&gt;

&lt;p&gt;This will streamline the process of deploying and managing your applications on Render, allowing for a more efficient and convenient workflow.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step2:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Click on &lt;strong&gt;New+&lt;/strong&gt; and select &lt;strong&gt;Web Service&lt;/strong&gt; &lt;/p&gt;

&lt;p&gt;Refer to the below screenshot for a better 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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fffie92cnck6jv3xr6rvb.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%2Fuploads%2Farticles%2Fffie92cnck6jv3xr6rvb.png" alt="Image description"&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step3:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Let's create your project repository by clicking on the &lt;strong&gt;connect&lt;/strong&gt; button.&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%2Fuploads%2Farticles%2Fkzxmr8of0oay0d40qbsi.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%2Fuploads%2Farticles%2Fkzxmr8of0oay0d40qbsi.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 4:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Give a unique name for deployed node application&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Select your &lt;strong&gt;Region&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Select the branch where your code exists in the GitHub repository.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Select &lt;strong&gt;Run Time&lt;/strong&gt; as &lt;strong&gt;Node&lt;/strong&gt;(As your deploying the Node application)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Select &lt;strong&gt;Build Command&lt;/strong&gt; that build your Node application, In my case it is installing the Node Modules.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Execute the below command to install the Node Modules.&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Select &lt;strong&gt;Start Command&lt;/strong&gt; that start your node application.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In my case executing the below command will start my node application.&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&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%2Fuploads%2Farticles%2Fxhcnxobu3w0thqu3v0yo.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%2Fuploads%2Farticles%2Fxhcnxobu3w0thqu3v0yo.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhi8rm1fqcc5l9tq3nl9e.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%2Fuploads%2Farticles%2Fhi8rm1fqcc5l9tq3nl9e.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Click on the &lt;strong&gt;Create Web Service&lt;/strong&gt; button to create the web service.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Step 5&lt;/strong&gt; &lt;/p&gt;

&lt;p&gt;You simply wait for some time, till your deployed node application is built and deployed succesfully.&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%2Fuploads%2Farticles%2F27g709nakv493fy7jh6u.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%2Fuploads%2Farticles%2F27g709nakv493fy7jh6u.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If any error during the build or depolying, you can check out those errors in the &lt;strong&gt;Logs&lt;/strong&gt; as shown in the reference Screenshot.&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%2Fuploads%2Farticles%2F8d0rhbliz7u7195yxga2.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%2Fuploads%2Farticles%2F8d0rhbliz7u7195yxga2.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 6&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Testing the deployed Node Application APIs&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Register API&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsm2fw2t2ig9ja47obu61.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%2Fuploads%2Farticles%2Fsm2fw2t2ig9ja47obu61.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Login API&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftki36o85btr12lt8waze.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%2Fuploads%2Farticles%2Ftki36o85btr12lt8waze.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I love to appreciate your enthusiasm to learn more.&lt;/p&gt;

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

&lt;h5&gt;
  
  
  I'm Phani Murari
&lt;/h5&gt;

&lt;p&gt;&lt;a href="https://www.instagram.com/im_phani_murari/" rel="noopener noreferrer"&gt;Instagram&lt;/a&gt;&lt;br&gt;
&lt;a href="https://www.linkedin.com/in/phanimurari/" rel="noopener noreferrer"&gt;LinkedIn&lt;/a&gt;&lt;/p&gt;

</description>
      <category>node</category>
      <category>javascript</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Get Started with React Hooks</title>
      <dc:creator>Phani Murari</dc:creator>
      <pubDate>Sun, 29 May 2022 19:23:42 +0000</pubDate>
      <link>https://dev.to/phanimurari/get-started-with-react-hooks-188p</link>
      <guid>https://dev.to/phanimurari/get-started-with-react-hooks-188p</guid>
      <description>&lt;h1&gt;
  
  
  Hello Everyone 👋!
&lt;/h1&gt;

&lt;p&gt;In this post, let's learn about the React Hooks.&lt;/p&gt;

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

&lt;p&gt;Hooks are a new addition in React 16.8. it will let you use state and other React features without writing a class.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Wait! Without class?????&lt;/strong&gt; 😮 &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Yes&lt;/strong&gt;, without class we can &lt;strong&gt;use React features&lt;/strong&gt; using the React Hooks.&lt;/p&gt;

&lt;p&gt;Okay! great but why React Hooks when i am super familiar with Classes.&lt;/p&gt;

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

&lt;p&gt;Check the below to understand why Frontend Dev's loves ❤️ the React Hooks.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Reduce the burden to think about whether we have to use the class component or function component, &lt;em&gt;Always go with a function component&lt;/em&gt; ✌️&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Reuse the logic between the components easily.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;More power with less lines of code and many more.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Industry is moving towards and gradually adapting React Hooks.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I am hoping that you got some Good reason to learn React Hooks.&lt;/p&gt;

&lt;p&gt;Let's understand the one of the basic hook - useState() provided by the React.&lt;/p&gt;

&lt;h2&gt;
  
  
  useState() ⚡
&lt;/h2&gt;

&lt;p&gt;Let's understand the &lt;code&gt;useState()&lt;/code&gt; hook by comparing with the &lt;code&gt;state&lt;/code&gt; object in class component.&lt;/p&gt;

&lt;p&gt;In class component we have the &lt;strong&gt;state&lt;/strong&gt; object, we will store the data in the state that changes within the time.&lt;/p&gt;

&lt;p&gt;But how to use state in the function component ❔&lt;/p&gt;

&lt;p&gt;With the help of &lt;strong&gt;useState()&lt;/strong&gt; hook you can add state to the function components as well.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Syntax&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const [currentState, setterFun] = useState(initialValue)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Example&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A simple &lt;strong&gt;Counter&lt;/strong&gt; example to understand the implementation of &lt;strong&gt;useState&lt;/strong&gt; hook&lt;br&gt;
&lt;/p&gt;

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

function ClickCounter() {
  const [count, setCount] = useState(0);
  // Here count - currentState
  // Here setCount - setterFun

  const onClickButton = () =&amp;gt; setCount(count + 1);
  // When the button clicked incrementing the count(currentState) by 1

  return (
    &amp;lt;div&amp;gt;
      &amp;lt;p&amp;gt;You clicked {count} times&amp;lt;/p&amp;gt;
      &amp;lt;button onClick={onClickButton}&amp;gt;Click me&amp;lt;/button&amp;gt;
    &amp;lt;/div&amp;gt;
  );
}

export default ClickCounter;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We can update the state by using the callback function if the next state is computed based on the previous state&lt;/p&gt;

&lt;p&gt;In the above counter example, the state incremented value is based on the previous state. Hence we have updated the state by using the callback function.&lt;br&gt;
&lt;/p&gt;

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

function ClickCounter() {
  const [count, setCount] = useState(0);
  // Here count - currentState
  // Here setCount - setterFun

  const onClickButton = () =&amp;gt; setCount((prevState) =&amp;gt; prevState + 1);
  // When the button clicked incrementing the count(currentState) by 1

  return (
    &amp;lt;div&amp;gt;
      &amp;lt;p&amp;gt;You clicked {count} times&amp;lt;/p&amp;gt;
      &amp;lt;button onClick={onClickButton}&amp;gt;Click me&amp;lt;/button&amp;gt;
    &amp;lt;/div&amp;gt;
  );
}

export default ClickCounter;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Let's understand how to declare the multiple state variables.
&lt;/h4&gt;

&lt;p&gt;Yes, you can declare the multiple state variables using the &lt;strong&gt;useState&lt;/strong&gt; hook multiple times as shown below.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const [stateVariableOne, setterFunForStateVariableOne] = useState(initialValue);
const [stateVariableTwo, setterFunForStateVariableTwo] = useState(initialValue);
const [stateVariableThree, setterFunForStateVariableThree] = useState(initialValue);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Refer to the official documentation of &lt;a href="https://reactjs.org/docs/hooks-reference.html#usestate"&gt;React Hooks - useState&lt;/a&gt; for a detailed understanding.&lt;/p&gt;

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

&lt;p&gt;I love to appreciate your enthusiasm to learn more.&lt;/p&gt;

&lt;h4&gt;
  
  
  I'm Phani Murari
&lt;/h4&gt;

&lt;p&gt;&lt;a href="https://www.instagram.com/im_phani_murari/"&gt;Instagram&lt;/a&gt;&lt;br&gt;
&lt;a href="https://www.linkedin.com/in/phanimurari/"&gt;LinkedIn&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  CodeIsPeace
&lt;/h1&gt;

</description>
      <category>react</category>
      <category>javascript</category>
      <category>beginners</category>
      <category>hooks</category>
    </item>
    <item>
      <title>When to use Class Component and Function Component??</title>
      <dc:creator>Phani Murari</dc:creator>
      <pubDate>Sun, 09 May 2021 18:37:17 +0000</pubDate>
      <link>https://dev.to/phanimurari/where-to-use-class-component-and-functional-component-1ed5</link>
      <guid>https://dev.to/phanimurari/where-to-use-class-component-and-functional-component-1ed5</guid>
      <description>&lt;h3&gt;
  
  
  Hello Everyone,
&lt;/h3&gt;

&lt;p&gt;In this post let's understand where to use the Class Component and Functional Component in react&lt;/p&gt;

&lt;p&gt;Before diving, Let's start understanding what is a component in react?&lt;/p&gt;

&lt;h3&gt;
  
  
  Component
&lt;/h3&gt;

&lt;p&gt;Websites or Web Applications developed using react is the combination and interlinking of different Components.&lt;/p&gt;

&lt;p&gt;Components let you develop the UI of the website independently and even we can use reusable components to implement a similar UI.&lt;/p&gt;

&lt;p&gt;React facilitates the developer with &lt;strong&gt;Class Component&lt;/strong&gt; and &lt;strong&gt;Functional Components&lt;/strong&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Class Components
&lt;/h3&gt;

&lt;p&gt;Class Components are built using &lt;a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes"&gt;ES6 Class&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;class Welcome extends React.Component {
  render() {
    return &amp;lt;h1&amp;gt;Super Excited to post my first post in Dev Community&amp;lt;/h1&amp;gt;;
  }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Functional Component
&lt;/h3&gt;

&lt;p&gt;The simplest way to write the Component in react is to write a JavaScript function&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function welcome(props) {

 return &amp;lt;h1&amp;gt;Super Excited to post my first post in Dev Community&amp;lt;/h1&amp;gt;;

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

&lt;/div&gt;



&lt;p&gt;We can use the Arrow Functions as well for the functional Components&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const welcome = (props) =&amp;gt; &amp;lt;h1&amp;gt;Super Excited to post my first post in Dev Community&amp;lt;/h1&amp;gt;;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Hope we had a short and good recap about the Class and Functional Components&lt;/p&gt;

&lt;p&gt;The above two components which are written in class and Functional Components are equivalent from React’s point of view.&lt;/p&gt;

&lt;p&gt;Now the major question rises in your developer's mind!&lt;/p&gt;

&lt;h1&gt;
  
  
  When to use the Class Component and the Functional Component??
&lt;/h1&gt;

&lt;p&gt;To answer this question we need to have a decent understanding of the state of the component.&lt;/p&gt;

&lt;p&gt;To recall or revise the concept of the &lt;code&gt;state&lt;/code&gt; of the component, I suggest you refer to &lt;a href="https://reactjs.org/docs/state-and-lifecycle.html#gatsby-focus-wrapper"&gt;this&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;In class components, the render method will be called, whenever the state of the components changes. On the other hand, the Functional components render the UI based on the props.&lt;/p&gt;

&lt;p&gt;Whenever we have the use case with the State of the component and rendering the UI based on the Component State, use the &lt;strong&gt;Class Components&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Class Components&lt;/strong&gt; should be preferred whenever we have the requirement with the &lt;strong&gt;state&lt;/strong&gt; of the component.&lt;/p&gt;

&lt;p&gt;In the beginner stage of the developer journey, we should be familiar with the &lt;strong&gt;Class Components&lt;/strong&gt; and the &lt;strong&gt;Functional Components&lt;/strong&gt;, As we progress towards the Advanced stage of our developer journey, We are able to understand much more cool stuff provided by React like &lt;strong&gt;Hooks&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In React version &amp;gt; 16.8, React even facilitates developers with &lt;strong&gt;Hooks&lt;/strong&gt; to use the &lt;strong&gt;state&lt;/strong&gt; and other React features even without writing the &lt;strong&gt;Class Component&lt;/strong&gt; &lt;/p&gt;

&lt;p&gt;To know more about &lt;strong&gt;Hooks&lt;/strong&gt;, Refer to &lt;a href="https://reactjs.org/docs/hooks-intro.html"&gt;this&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I love to appreciate your enthusiasm to learn more.&lt;/p&gt;

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

&lt;h3&gt;
  
  
  I'm Phani Murari
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://www.instagram.com/im_phani_murari/"&gt;Instagram&lt;/a&gt;&lt;br&gt;
&lt;a href="https://www.linkedin.com/in/phanimurari/"&gt;LinkedIn&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  CodeIsPeace
&lt;/h1&gt;

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