<?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: Sakib Ahmed</title>
    <description>The latest articles on DEV Community by Sakib Ahmed (@codeslinger).</description>
    <link>https://dev.to/codeslinger</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%2F515241%2F86882507-641c-4784-9c38-52434ccf3a5b.jpeg</url>
      <title>DEV Community: Sakib Ahmed</title>
      <link>https://dev.to/codeslinger</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/codeslinger"/>
    <language>en</language>
    <item>
      <title>The difference between DOM and Virtual DOM</title>
      <dc:creator>Sakib Ahmed</dc:creator>
      <pubDate>Fri, 22 Apr 2022 15:39:39 +0000</pubDate>
      <link>https://dev.to/codeslinger/the-difference-between-dom-and-virtual-dom-52o1</link>
      <guid>https://dev.to/codeslinger/the-difference-between-dom-and-virtual-dom-52o1</guid>
      <description>&lt;p&gt;In this article, we will try to find out what is DOM and its problems. What is Virtual DOM, and explain how it solved the problems of the real DOM. &lt;/p&gt;

&lt;h2&gt;
  
  
  Intro
&lt;/h2&gt;

&lt;p&gt;The creation of React by Facebook developers introduces a new term, virtual DOM. Virtual DOM plays a major role in drastically improving the performance of applications created using this library. In the following text, we will define both the virtual and the real DOM and explain how the virtual DOM solved the problems of the real DOM.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is DOM
&lt;/h2&gt;

&lt;p&gt;Just to get things straight - DOM stands for Document Object Model and is an abstraction of a structured text.  It takes HTML elements and wraps them in an object with a tree structure — maintaining the parent/child relationships of those nested HTML elements. &lt;br&gt;
The HTML DOM provides an interface (API) to traverse and modify the nodes in a number of ways — such as adding nodes, removing nodes, editing a node’s content, etc. It contains methods like getElementById or removeChild. We usually use JavaScript language to work with the DOM.&lt;br&gt;
Any manipulation of certain elements inside it causes complete re-render. With more and more complex web applications these complete renders of real DOM are very costly, causing applications to have slow performance.&lt;/p&gt;

&lt;h2&gt;
  
  
  Problem With DOM
&lt;/h2&gt;

&lt;p&gt;DOM manipulation is the heart of the modern, interactive web. But unfortunately, it is also a lot slower than most JavaScript operations.&lt;br&gt;
As mentioned above the HTML DOM is always tree-structured - which is allowed by the structure of the HTML document. This is great because we can traverse trees fairly easily. Unfortunately, easily doesn’t mean quickly here. This slowness is made worse by the fact that most JavaScript frameworks update the DOM much more than they have to.&lt;br&gt;
Nowadays The DOM trees are huge. it’s common to have a thousand nodes in a single SPA (Single Page Applications - SPAs). Since we are more and more pushed towards dynamic web apps, we need to modify the DOM tree incessantly and a lot. Inefficient updating like repainting the whole page for each change is very very expensive And this is a real performance and development pain.&lt;/p&gt;

&lt;p&gt;And this is exactly where the Virtual DOM comes into action.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is Virtual DOM
&lt;/h2&gt;

&lt;p&gt;The Virtual DOM is a lightweight abstraction of the real DOM. You can think of it as a copy of the DOM, that can be updated without affecting the actual DOM. &lt;br&gt;
It consists of two copies of real DOM represented as tree structures. One copy is an exact replica of real DOM and stays that way while the other copy changes as manipulation with certain elements happen. At that moment the two compare and the change between them is extracted. Extracted change is then implemented inside real DOM without it having to completely re-render. After successful implementation, there are again two exact replicas. When manipulation with a certain element happens again the process is repeated.&lt;br&gt;
It has all the same properties as the real DOM object but doesn’t have the ability to write to the screen like the real DOM. The virtual DOM gains its speed and efficiency from the fact that it’s lightweight. In fact, a new virtual DOM is created after every re-render.&lt;/p&gt;

&lt;p&gt;To Keep Real and Virtual DOM in sync  a process called Reconciliation is used. Diffing algorithm is a technique of reconciliation that is used by React.&lt;/p&gt;

&lt;h2&gt;
  
  
  How Does it solve the problem? 
&lt;/h2&gt;

&lt;p&gt;When you render an element in virtual DOM, every single virtual DOM object gets updated.&lt;br&gt;
This sounds incredibly inefficient, but the cost is insignificant because the virtual DOM can update so quickly.&lt;br&gt;
Once the virtual DOM has been updated, then React compares the virtual DOM with a virtual DOM snapshot that was taken right before the update.&lt;br&gt;
By comparing the new virtual DOM with a pre-update version, React figures out exactly which virtual DOM objects have changed. This process is called “diffing.”&lt;br&gt;
Once React knows which virtual DOM objects have changed, then React updates those objects, and only those objects, on the real DOM. In our example from earlier, React would be smart enough to rebuild your one checked-off list item and leave the rest of your list alone.&lt;br&gt;
This makes a big difference! React can update only the necessary parts of the DOM. React’s reputation for performance comes largely from this innovation.&lt;/p&gt;

&lt;p&gt;In summary, here’s what happens when you try to update the DOM in React:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;The entire virtual DOM gets updated.&lt;/li&gt;
&lt;li&gt;The virtual DOM gets compared to what it looked like before you updated it. React figures out which objects have changed.&lt;/li&gt;
&lt;li&gt;The changed objects, and the changed objects only, get updated on the real DOM.&lt;/li&gt;
&lt;li&gt;Changes in the real DOM cause the screen to change.&lt;/li&gt;
&lt;/ol&gt;

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

&lt;p&gt;The creation of Virtual DOM solved real DOM’s low performance and slow re-render. It enabled web applications to be more complex and more interactive for users without having to sacrifice so much performance.&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>react</category>
      <category>webdev</category>
      <category>typescript</category>
    </item>
    <item>
      <title>Free JavaScript Coding Classes/Courses – For Beginners [2022 Guide]</title>
      <dc:creator>Sakib Ahmed</dc:creator>
      <pubDate>Tue, 22 Feb 2022 21:31:33 +0000</pubDate>
      <link>https://dev.to/codeslinger/free-javascript-coding-classescourses-for-beginners-2022-guide-5hmf</link>
      <guid>https://dev.to/codeslinger/free-javascript-coding-classescourses-for-beginners-2022-guide-5hmf</guid>
      <description>&lt;p&gt;&lt;em&gt;Disclosure: This post &lt;strong&gt;Dose Not&lt;/strong&gt; includes affiliate links in any shape or form.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Everybody needs to learn to code. Coding is the new literacy. If you can't code you'll soon become obsolete, plus coding is easy so you have no excuse. these are all statements that are not true but I've been told that fear-based sales tactics will scare you into unicorn my post. &lt;/p&gt;

&lt;p&gt;Today's blog is about a variety of practical Classes/Courses that have helped me learn to code in JavaScript can help you start a great career as a JavaScript developer for &lt;strong&gt;Free&lt;/strong&gt;. &lt;/p&gt;

&lt;p&gt;The freeCodeCamp courses are completely free and some of them even include a free certification that you can add to your LinkedIn or résumé.&lt;/p&gt;

&lt;p&gt;Here is the complete list of free courses. Once you find a course that interests you, click that link and it will jump you down to a more detailed description of that course.&lt;/p&gt;



&lt;h2&gt;
  
  
  Free JavaScript Courses
&lt;/h2&gt;

&lt;p&gt;1.&lt;a href="https://www.youtube.com/watch?v=PkZNo7MFNFg"&gt;Learn JavaScript – Full Course for Beginners&lt;/a&gt;&lt;br&gt;
This freeCodeCamp YouTube, course is about conditions, loops, functions, objects, arrays, and ES6.&lt;/p&gt;

&lt;p&gt;2.&lt;a href="https://www.freecodecamp.org/learn/javascript-algorithms-and-data-structures/"&gt;JavaScript Algorithms and Data Structures&lt;/a&gt;&lt;br&gt;
This course focus on the basic of JavaScript, ES6, regular expressions, basic data structures, Object-Oriented Programming, and functional programming. (Free Certification🏆)&lt;/p&gt;

&lt;p&gt;3.&lt;a href="https://www.youtube.com/watch?v=W6NZfCO5SIk"&gt;JavaScript Tutorial for Beginners: Learn JavaScript in 1 Hour&lt;/a&gt;&lt;br&gt;
In this Programming with Mosh course, you will learn about JavaScript basics like objects, arrays, and functions.&lt;/p&gt;

&lt;p&gt;4.&lt;a href="https://javascript.info/"&gt;The Modern JavaScript Tutorial&lt;/a&gt;&lt;br&gt;
In this tutorial, you will learn about JavaScript basics, error handling, promises, async/await, and the DOM.&lt;/p&gt;

&lt;p&gt;5.&lt;a href="https://www.learn-js.org/"&gt;LearnJS&lt;/a&gt;&lt;br&gt;
In this tutorial, you will learn about JavaScript basics, Object-Oriented Programming, inheritance, and data structures.&lt;/p&gt;

&lt;p&gt;6.&lt;a href="https://www.javascripttutorial.net/"&gt;JavaScript Tutorial&lt;/a&gt;&lt;br&gt;
In this tutorial, you will learn JavaScript fundamentals, ES6, BOM, the DOM, and web APIs.&lt;/p&gt;

&lt;p&gt;7.&lt;a href="https://www.sololearn.com/learning/1024"&gt;JavaScript&lt;/a&gt;&lt;br&gt;
In this SoloLearn course, you will learn about conditions, loops, functions, objects, arrays, the DOM, and events.&lt;/p&gt;

&lt;p&gt;8.&lt;a href="https://www.youtube.com/watch?v=jS4aFq5-91M"&gt;JavaScript Programming&lt;/a&gt;&lt;br&gt;
In this freeCodeCamp YouTube course, you will learn about the basics of JavaScript and build a blackjack game and Google Chrome extension.&lt;/p&gt;

&lt;p&gt;9.&lt;a href="https://www.theodinproject.com/paths/full-stack-javascript?"&gt;Full-stack JavaScript&lt;/a&gt;&lt;br&gt;
This Odin Project course will teach you HTML, CSS, JavaScript, and NodeJS through a series of lessons and projects.&lt;/p&gt;

&lt;p&gt;10.&lt;a href="https://www.youtube.com/watch?v=BwuLxPH8IDs"&gt;TypeScript Course for Beginners 2021 – Learn TypeScript from Scratch!&lt;/a&gt;&lt;br&gt;
This course teaches array types, object types, tuples, function types, and callbacks.&lt;/p&gt;

&lt;p&gt;11.&lt;a href="https://www.freecodecamp.org/learn/apis-and-microservices/"&gt;Backend Development and APIs&lt;/a&gt;&lt;br&gt;
In this freeCodeCamp course, you will learn the basics of Node.js, NPM, Express, and MongoDB. (Free Certification🏆)&lt;/p&gt;

&lt;p&gt;12.&lt;a href="https://www.youtube.com/watch?v=TlB_eWDSMt4"&gt;Node.js Tutorial for Beginners: Learn Node in 1 Hour&lt;/a&gt;&lt;br&gt;
This Programming with Mosh course teaches different modules like the path module, OS module, file system module, and NPM commands.&lt;/p&gt;

&lt;p&gt;13.&lt;a href="https://www.youtube.com/watch?v=Oe421EPjeBE"&gt;Node.js and Express.js – Full Course&lt;/a&gt;&lt;br&gt;
In this freeCodeCamp YouTube course, you will learn about NPM commands, different modules, async patterns, events, streams, and HTTP basics.&lt;/p&gt;

&lt;p&gt;If you have any questions or feedback, then please drop a comment. Thanks&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>beginners</category>
      <category>tutorial</category>
      <category>career</category>
    </item>
  </channel>
</rss>
