<?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: Manak Upadhyay</title>
    <description>The latest articles on DEV Community by Manak Upadhyay (@manak).</description>
    <link>https://dev.to/manak</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%2F698505%2F2f0543f7-e0af-462e-b3c5-45809b031177.jpeg</url>
      <title>DEV Community: Manak Upadhyay</title>
      <link>https://dev.to/manak</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/manak"/>
    <language>en</language>
    <item>
      <title>The Javascript Engine</title>
      <dc:creator>Manak Upadhyay</dc:creator>
      <pubDate>Thu, 20 Oct 2022 14:28:32 +0000</pubDate>
      <link>https://dev.to/manak/the-javascript-engine-52h2</link>
      <guid>https://dev.to/manak/the-javascript-engine-52h2</guid>
      <description>&lt;p&gt;Javascript is an indispensable part of modern web development. In this &lt;em&gt;theory-heavy&lt;/em&gt; article, we will be exploring what is Javascript Engine, what is Javascript Runtime Environment, and how Javascript code is executed under the hood.&lt;/p&gt;

&lt;p&gt;A Javascript Engine is a program responsible for executing the JS code. It is a part of the &lt;strong&gt;JavaScript Runtime Environment&lt;/strong&gt;. Wait, what the hell is JavaScript Runtime Environment?&lt;/p&gt;

&lt;p&gt;A Javascript Runtime Environment is a kind of box that makes a JavaScript code actually work. It provides access to the outside world like the DOM(in case of browsers) or the File System(in case of Node) to name a few. If we do not have the Javascript Runtime Environment, we will be unable to use setTimeout, console, or other APIs methods provided by the outside world.&lt;/p&gt;

&lt;p&gt;In a typical web browser, a Javascript runtime environment consists of:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;JS Engine&lt;/li&gt;
&lt;li&gt;Web APIs&lt;/li&gt;
&lt;li&gt;Callback Queue aka Job Queue aka Macro task Queue&lt;/li&gt;
&lt;li&gt;Event loop&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--qLendNLJ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zky8jk1xsc1es9kj4irw.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--qLendNLJ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zky8jk1xsc1es9kj4irw.jpeg" alt="Javascript Runtime Environment" width="880" height="660"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We will cover only JS Engine in this blog.&lt;/p&gt;

&lt;p&gt;All browsers have their JS engine. Google Chrome has V8. Mozilla has Spider Monkey and the list goes on. The JS Engine basically converts high-level code(what we write) to machine-level code(what computers understand).&lt;/p&gt;

&lt;p&gt;Before we dive deep and dig out what happens in the process, we need to know two super important things: a &lt;em&gt;compiler&lt;/em&gt; and an &lt;em&gt;interpreter&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Compiler&lt;/strong&gt;: It takes the source code and first compiles it line by line before even executing a single line of code. The compiler compiles the code into machine code which is highly optimized and simultaneously checks for syntactic or semantical errors. After compilation, it generates a file that contains the low-level code understandable by the machine. Used in C++ (remember the .exe file from your good old college days?).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Interpreter&lt;/strong&gt;: It takes the source code and starts executing it line by line immediately.&lt;/p&gt;




&lt;p&gt;So now, you may ask if Javascript is a compiled or interpreted language.&lt;/p&gt;

&lt;p&gt;Well, it is the best of both worlds. Here’s how:&lt;/p&gt;

&lt;p&gt;Basically, there are three steps involved in the code execution:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Parsing&lt;/li&gt;
&lt;li&gt;Execution&lt;/li&gt;
&lt;li&gt;Compilation&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  1. Parsing
&lt;/h2&gt;

&lt;p&gt;The JS engine takes the source code, breaks it down into tokens, and generates a data structure called Abstract Syntax Tree (AST). If there is a syntax error in the program, the execution is stopped here, and control returns.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Execution
&lt;/h2&gt;

&lt;p&gt;This generated AST gets fed into the interpreter which generates bytecode and starts executing the code line by line. While executing the bytecode, the interpreter collects profiling data, which can be used later to speed up the execution. The profiling data contains code that can be optimized. For example, a function is invoked multiple times.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Compilation
&lt;/h2&gt;

&lt;p&gt;The generated bytecode and the profiling data are passed to something known as an optimizing compiler, which generates highly-optimized and efficient machine code(based on the profiling data) that runs very fast. This optimized code replaces the non-optimized code generated by the interpreter and gradually the Javascript Engine becomes hot and code execution improves.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--YwFWYTya--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3pqeuxmp794lsvzl57by.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--YwFWYTya--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3pqeuxmp794lsvzl57by.jpeg" alt="Javascript Engine" width="880" height="660"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;So, Javascript uses both interpreter and compiler aka it has JIT (Just-in-time) Compilation.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;That’s it for today. Thanks for reading!&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>webdev</category>
      <category>beginners</category>
      <category>node</category>
    </item>
    <item>
      <title>C++ complete roadmap</title>
      <dc:creator>Manak Upadhyay</dc:creator>
      <pubDate>Fri, 17 Dec 2021 21:03:34 +0000</pubDate>
      <link>https://dev.to/manak/c-complete-roadmap-5e4</link>
      <guid>https://dev.to/manak/c-complete-roadmap-5e4</guid>
      <description>&lt;p&gt;Let's jump in!&lt;/p&gt;

&lt;p&gt;If you are a beginner I will suggest you to make a time table of at least 45 days which will be sufficient in order to get a really good understanding of C++. Now, you can break your 45 days into 6 weeks and start with the concepts.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1st Week&lt;/strong&gt;: Now, these seven days will introduce you to something that you have no previous knowledge of. So make sure you understand the foundations well and give a kickstart to the world of programming.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;What is C++?&lt;/li&gt;
&lt;li&gt;It’s history and features.&lt;/li&gt;
&lt;li&gt;Understanding and writing our first Hello World program in C++.&lt;/li&gt;
&lt;li&gt;Tokens&lt;/li&gt;
&lt;li&gt;Variables, Datatypes.&lt;/li&gt;
&lt;li&gt;Keywords&lt;/li&gt;
&lt;li&gt;How to take input from the user?&lt;/li&gt;
&lt;li&gt;Operators

&lt;ul&gt;
&lt;li&gt;Arithmetic Operators.&lt;/li&gt;
&lt;li&gt;Logical Operators.&lt;/li&gt;
&lt;li&gt;Relational Operators.&lt;/li&gt;
&lt;li&gt;Other operators.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;Selection Statements

&lt;ul&gt;
&lt;li&gt;if statements&lt;/li&gt;
&lt;li&gt;if-else&lt;/li&gt;
&lt;li&gt;else-if&lt;/li&gt;
&lt;li&gt;switch&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;2nd Week&lt;/strong&gt;: Now you have understood the basic units of a program well. Its time to take a step forward. So, schedule yourself to learn the following topics.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Loops

&lt;ul&gt;
&lt;li&gt;for loop&lt;/li&gt;
&lt;li&gt;while loop&lt;/li&gt;
&lt;li&gt;do-while loop&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;Jump Statements

&lt;ul&gt;
&lt;li&gt;goto&lt;/li&gt;
&lt;li&gt;break&lt;/li&gt;
&lt;li&gt;continue&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;Comments.&lt;/li&gt;
&lt;li&gt;Arrays

&lt;ul&gt;
&lt;li&gt;One-Dimensional Array.&lt;/li&gt;
&lt;li&gt;Two-Dimensional Array.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;Strings.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Now, start solving some problems on these topics, so that you get a good grip on them.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3rd Week&lt;/strong&gt;: It’s time to start functions and play with pointers.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Functions

&lt;ul&gt;
&lt;li&gt;Call by value.&lt;/li&gt;
&lt;li&gt;Call by reference&lt;/li&gt;
&lt;li&gt;Function Overloading.&lt;/li&gt;
&lt;li&gt;Inline functions.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Pointers&lt;/strong&gt;: Now this is a topic that most of the students find difficult. But believe me, it’s a myth. If you will understand the basics of pointers well, you will surely love C++, as it is one of C++’s coolest features. So get a hold on them.&lt;/li&gt;
&lt;li&gt;Relation between Pointers and Array.&lt;/li&gt;
&lt;li&gt;Array to Functions.&lt;/li&gt;
&lt;li&gt;Structures.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;As I said, solve problems to check your understanding.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4th Week&lt;/strong&gt;: Now, these topics are asked everywhere like Interviews, practical exams, etc. So don’t make haste and understand them in depth.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Classes and Objects.&lt;/li&gt;
&lt;li&gt;this keyword, static keyword, Friend Functions.&lt;/li&gt;
&lt;li&gt;Constructors.

&lt;ul&gt;
&lt;li&gt;Default Constructor.&lt;/li&gt;
&lt;li&gt;Parametrized Constructor.&lt;/li&gt;
&lt;li&gt;Copy Constructor.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;Destructors.&lt;/li&gt;
&lt;li&gt;Concepts of Object-Oriented Programming(OOP).

&lt;ul&gt;
&lt;li&gt;Abstraction.&lt;/li&gt;
&lt;li&gt;Encapsulation.&lt;/li&gt;
&lt;li&gt;Inheritance.&lt;/li&gt;
&lt;li&gt;Polymorphism.&lt;/li&gt;
&lt;li&gt;Data Hiding.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Practice problems on these concepts.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;5th Week:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Inheritance

&lt;ul&gt;
&lt;li&gt;Types of Inheritance.&lt;/li&gt;
&lt;li&gt;Derived and Base class.&lt;/li&gt;
&lt;li&gt;Access Specifiers.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;Polymorphism.

&lt;ul&gt;
&lt;li&gt;Compile Time Polymorphism.&lt;/li&gt;
&lt;li&gt;Overloading.&lt;/li&gt;
&lt;li&gt;Overriding.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;Run Time Polymorphism.

&lt;ul&gt;
&lt;li&gt;Virtual Functions.&lt;/li&gt;
&lt;li&gt;Operator Overloading.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;Exception Handling.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Practice, practice, and practice.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;6th Week:&lt;/strong&gt; Get familiar with:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Templates.&lt;/li&gt;
&lt;li&gt;Data File Handling.&lt;/li&gt;
&lt;li&gt;Macros.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That’s it. After learning the above topics you can stand anywhere and say I know C++. :)&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Most Important Tip&lt;/strong&gt;: You will face problems while learning some concepts, but please don’t quit. Because everybody faces them and it’s totally OKAY. Give yourself time and jump to that topic again cause this is how things work in the world of programming.&lt;/p&gt;

&lt;p&gt;Happy Coding:)&lt;/p&gt;

</description>
      <category>programming</category>
      <category>tutorial</category>
      <category>beginners</category>
      <category>cpp</category>
    </item>
    <item>
      <title>Float vs Double</title>
      <dc:creator>Manak Upadhyay</dc:creator>
      <pubDate>Fri, 17 Dec 2021 20:40:30 +0000</pubDate>
      <link>https://dev.to/manak/float-vs-double-3gpj</link>
      <guid>https://dev.to/manak/float-vs-double-3gpj</guid>
      <description>&lt;p&gt;Float and double, both are used to represent floating point numbers in programming languages. The main difference between them is their range and the number of bits/bytes they use.&lt;/p&gt;

&lt;p&gt;In Java, float uses 4 bytes and has comparatively less range than double which uses 8 bytes. Float gives you presion up to 6 decimal places while double gives you precison up to 16 decimal places.&lt;/p&gt;

&lt;p&gt;Let's take an example, suppose you made a program in which a variable is used to represent distance. Now if we want presion up to few decimal places like 1.23, 5.3821, etc we can use float. But for precision up to more decimal places like 1.23728164829 we will use double.&lt;/p&gt;

&lt;p&gt;Happy Coding :)&lt;/p&gt;

</description>
      <category>programming</category>
      <category>beginners</category>
      <category>tutorial</category>
      <category>java</category>
    </item>
  </channel>
</rss>
