<?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: Sourabh Singh</title>
    <description>The latest articles on DEV Community by Sourabh Singh (@voidmain1812).</description>
    <link>https://dev.to/voidmain1812</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%2F1005346%2Fc08c0e57-19bc-44bc-b5ee-3401ec2746fc.png</url>
      <title>DEV Community: Sourabh Singh</title>
      <link>https://dev.to/voidmain1812</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/voidmain1812"/>
    <language>en</language>
    <item>
      <title>Working Of Compiler In JavaScript</title>
      <dc:creator>Sourabh Singh</dc:creator>
      <pubDate>Sun, 19 Mar 2023 14:27:15 +0000</pubDate>
      <link>https://dev.to/voidmain1812/working-of-compiler-in-javascript-kmo</link>
      <guid>https://dev.to/voidmain1812/working-of-compiler-in-javascript-kmo</guid>
      <description>&lt;p&gt;JavaScript falls under the general category of "dynamic" or "interpreted" languages. But it is often misunderstood, in-fact JavaScript is &lt;strong&gt;Interpreted&lt;/strong&gt; as well as &lt;strong&gt;Compiled&lt;/strong&gt; language. Let's understand more about the execution of JavaScript code in the Blog&lt;/p&gt;

&lt;h2&gt;
  
  
  Working of Compiler in JavaScript
&lt;/h2&gt;

&lt;p&gt;In traditional compilation process of a language, a chunk of source code undergo typically three steps before execution.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Tokenizing / Lexing&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Parsing&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Code Generation&lt;/strong&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Tokenizing / Lexing:
&lt;/h2&gt;

&lt;p&gt;Breaking up a Sting of characters into meaningful chunks called tokens.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--_ZfInJzb--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9f93fgq1eqgfjdtq1xuq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--_ZfInJzb--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9f93fgq1eqgfjdtq1xuq.png" alt="Image to explain the process of tokenizing in compiler" width="360" height="344"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Parsing:
&lt;/h2&gt;

&lt;p&gt;A Stream (array) of tokens are turned into a tree of nested elements, which collectively represents the grammar structure of the program. This tree is called &lt;strong&gt;"AST"&lt;/strong&gt; (Abstract Syntax Tree).&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Iz7QDg4Q--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vyeh0ywlwkt5nxkqrfc8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Iz7QDg4Q--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vyeh0ywlwkt5nxkqrfc8.png" alt="Abstract Syntax Tree" width="880" height="495"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Code Generation:
&lt;/h2&gt;

&lt;p&gt;The process of taking an AST &amp;amp; turning it into executable code.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--kTmSrAwW--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6tb1slqei69zwcstjx97.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--kTmSrAwW--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6tb1slqei69zwcstjx97.png" alt="AST to Code" width="850" height="247"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;But, the JavaScript Engine is vastly more complex than just these steps. Any Java-Script code is compiled even before it is executed.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; Execution of JavaScript Code is done by Interpreter.&lt;/p&gt;
&lt;h2&gt;
  
  
  Compilation before execution:
&lt;/h2&gt;

&lt;p&gt;JavaScript compiles all the declarations &amp;amp; Assignments before the code is sent for execution so that the interpreter can skip those lines. This is done for faster execution speed.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let a = 3;    //The declaration and assignment of variable 
                will be compiled before execution.
console.log(a)  //This part will be executed by JavaScript 
                  interpreter
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Thanks for reading this blog.&lt;br&gt;
Drop a like if you found this blog helpful and follow me for more of such blogs. 😄😄&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>javascript</category>
      <category>programming</category>
      <category>computerscience</category>
    </item>
    <item>
      <title>HOW TO USE JAVASCRIPT IN YOUR IDE WITHOUT BROWSER</title>
      <dc:creator>Sourabh Singh</dc:creator>
      <pubDate>Sun, 22 Jan 2023 07:09:27 +0000</pubDate>
      <link>https://dev.to/voidmain1812/how-to-use-javascript-in-your-ide-without-browser-2dhc</link>
      <guid>https://dev.to/voidmain1812/how-to-use-javascript-in-your-ide-without-browser-2dhc</guid>
      <description>&lt;h2&gt;
  
  
  JavaScript in IDE
&lt;/h2&gt;

&lt;p&gt;Some time ago it was not possible to use JavaScript without a web browser but, now with the help of Node.js it is possible to use JavaScript inside any IDE or code editor without touching your Web Browser.&lt;/p&gt;

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

&lt;h2&gt;
  
  
  Node.js and JavaScript
&lt;/h2&gt;

&lt;p&gt;In order to use JavaScript in your code editor or IDE we have to initialise a npm package which can be done by following command in your terminal.&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;p&gt;After executing this command you will be prompted several questions in your terminal where you have to press enter after specifying the answer.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt;&lt;br&gt;
You can leave the prompt empty and press enter. The terminal will feed the default value as input.&lt;/p&gt;

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

&lt;p&gt;Doing so will initialise a package.json file in your folder. which will have all the necessary details of the your package.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcmmb657z0xfkm35ktnln.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcmmb657z0xfkm35ktnln.png" alt="package.json after npm init" width="800" height="423"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Using Node.js Packages
&lt;/h2&gt;

&lt;p&gt;In order to use various Node.js Packages you will need to install them first with the following command:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;With NPM&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;With Yarn&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;yarn add &amp;lt;package-name&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After this you need to declare the packages inside your JS file to access all it's features.&lt;/p&gt;

&lt;p&gt;For Example let us use the prompt-sync package inside our JS file:&lt;br&gt;
&lt;strong&gt;1.Installing the package&lt;/strong&gt; with Node Package Manager (npm)&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 prompt-sync --save
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;2.Declaring a variable&lt;/strong&gt; to use package's properties&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const prompt = require("prompt-sync")();
let name = prompt("Enter Your Name");
console.log(name)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



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

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;require&lt;/strong&gt; fetches the package from node modules.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;prompt&lt;/strong&gt; takes input from user.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;console.log(name)&lt;/strong&gt; prints the entered value.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Congrats !!&lt;/strong&gt; you've learnt how to use JavaScript without browser inside your favourite code editor or IDE.&lt;/p&gt;

&lt;p&gt;Drop a like if you found this blog helpful and follow me for more of such blogs. 😄😄&lt;/p&gt;

</description>
      <category>gratitude</category>
      <category>discuss</category>
    </item>
    <item>
      <title>JavaScript as your first programming language</title>
      <dc:creator>Sourabh Singh</dc:creator>
      <pubDate>Sun, 15 Jan 2023 08:02:59 +0000</pubDate>
      <link>https://dev.to/voidmain1812/javascript-as-your-first-programming-language-3fcl</link>
      <guid>https://dev.to/voidmain1812/javascript-as-your-first-programming-language-3fcl</guid>
      <description>&lt;p&gt;If you are a beginner in programming and you don't know where to start from then JavaScript is "&lt;strong&gt;THE LANGUAGE&lt;/strong&gt;" for you.&lt;/p&gt;

&lt;h2&gt;
  
  
  WHAT IS JAVASCRIPT ?
&lt;/h2&gt;

&lt;p&gt;If we go to the formal definition of JavaScript provided by &lt;a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript#:~:text=JavaScript%20(JS)%20is%20a%20lightweight,Apache%20CouchDB%20and%20Adobe%20Acrobat." rel="noopener noreferrer"&gt;MDN-Web-Docs&lt;/a&gt; JavaScript (JS) is a lightweight, interpreted, or just-in-time compiled programming language with first-class functions.&lt;br&gt;
Many beginners think that JavaScript is only useful for developing web-pages but they are wrong. I'll explain how further in this blog.&lt;/p&gt;

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

&lt;h2&gt;
  
  
  WHY JAVASCRIPT ?
&lt;/h2&gt;

&lt;p&gt;JavaScript came into existence around 27 years ago, and since then it has gone through number of improvements. And according to a survey done by &lt;strong&gt;GitHub&lt;/strong&gt; JavaScript has been #1 choice for developers since years.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;photo taken from &lt;a href="https://octoverse.github.com/2022/top-programming-languages" rel="noopener noreferrer"&gt;octoverse.github.com&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fa2xryy37hqvo5idtavaf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fa2xryy37hqvo5idtavaf.png" alt="Image showing popularity of various programming languages among developers" width="800" height="418"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you asked me the same question that which programming language to start with 10-13 years ago, before the existence of &lt;a href="https://nodejs.org/en/" rel="noopener noreferrer"&gt;Node.js&lt;/a&gt;, I must've given a different answer but the improvements that JavaScript got after the entry of &lt;strong&gt;Node.js&lt;/strong&gt; changed my mind completely.&lt;/p&gt;

&lt;h2&gt;
  
  
  JAVASCRIPT vs. OTHER LANGUAGES 🔥🔥
&lt;/h2&gt;

&lt;p&gt;After the entry of Node.js JavaScript has became very much powerful. Now you can perform any kind of task that any other programming language ( say C, C++, Java, Python) can do. And it also has a large amount of additional features that other languages are not able to perform that easily.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F908uyggxjznwf4w2sg4w.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F908uyggxjznwf4w2sg4w.png" alt="Showcase image for Node.js" width="800" height="473"&gt;&lt;/a&gt;&lt;br&gt;
&lt;strong&gt;Node.js&lt;/strong&gt; made JavaScript usable even outside the browsers hence made it possible to perform some of the complex tasks like &lt;strong&gt;Machine Learning&lt;/strong&gt; and &lt;strong&gt;DSA&lt;/strong&gt; easier to perform in JavaScript.&lt;/p&gt;

&lt;h2&gt;
  
  
  POWER OF JAVASCRIPT 💪🏻
&lt;/h2&gt;

&lt;p&gt;At current stage JavaScript is capable of performing various complex tasks very easily as compared to other languages.&lt;br&gt;
&lt;strong&gt;THE FLEXIBILITY OF JAVASCRIPT&lt;/strong&gt;&lt;br&gt;
JavaScript can perform all the following tasks very well.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Web Development&lt;/li&gt;
&lt;li&gt;Application Development (IOS &amp;amp; Android)&lt;/li&gt;
&lt;li&gt;Computer Application Development(for Windows, MacOS and Linux)&lt;/li&gt;
&lt;li&gt;Machine Learning (see &lt;a href="https://www.tensorflow.org/js" rel="noopener noreferrer"&gt;TensorFlow.js&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;VR &amp;amp; AR Development (see &lt;a href="https://threejs.org/" rel="noopener noreferrer"&gt;Three.js&lt;/a&gt;, &lt;a href="https://ar-js-org.github.io/AR.js-Docs/" rel="noopener noreferrer"&gt;AR.js&lt;/a&gt;)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;This must've explained that JavaScript is way more powerful than just creating web pages 😄&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  BENEFITS OF LEARNING JAVASCRIPT
&lt;/h2&gt;

&lt;p&gt;Following are some of the major benefits of learning JavaScript&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;If you are learning JavaScript then you don't need to learn any other language for any other purpose.&lt;/li&gt;
&lt;li&gt;You can learn and create bigger projects at the same time.&lt;/li&gt;
&lt;li&gt;There is a very huge demand in the tech industry for JavaScript developers and the supply is very sort so it will bring great opportunities to you.&lt;/li&gt;
&lt;li&gt;JavaScript has a huge community of experienced and passionate programmers which means a huge support&lt;/li&gt;
&lt;li&gt;JavaScript will further improve with time and it will become more powerful&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  RESOURCES TO LEARN JAVASCRIPT
&lt;/h2&gt;

&lt;p&gt;There are various free and paid resources to learn JavaScript both online and offline.&lt;br&gt;
&lt;strong&gt;FREE ONLINE COURSES TO LEARN JAVASCRIPT&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://youtube.com/playlist?list=PLu0W_9lII9ahR1blWXxgSlL4y9iQBnLpR&amp;amp;si=EnSIkaIECMiOmarE" rel="noopener noreferrer"&gt;JavaScript Tutorials for Beginners in Hindi (By-Code With Harry&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://youtube.com/watch?v=lI1ae4REbFM&amp;amp;si=EnSIkaIECMiOmarE" rel="noopener noreferrer"&gt;JavaScript Tutorial for Beginners - Full Course in 12 Hours 2022 (By-Clever Programmer&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://youtube.com/watch?v=jS4aFq5-91M&amp;amp;si=EnSIkaIECMiOmarE" rel="noopener noreferrer"&gt;JavaScript Programming - Full Course (By-Free Code Camp)&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Must Consider&lt;/strong&gt;: You Don't Know JS series by Kyle Simpson&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Offline Books : &lt;a href="https://www.oreilly.com/search/?q=you+dont+know+js&amp;amp;type=article&amp;amp;type=book&amp;amp;type=journal" rel="noopener noreferrer"&gt;oreilly.com&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Online Articles: &lt;a href="https://github.com/getify/You-Dont-Know-JS" rel="noopener noreferrer"&gt;GitHub&lt;/a&gt; &lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Thank You for learning this this article. Please like if you found it useful 😄😄&lt;/p&gt;

</description>
      <category>productivity</category>
      <category>discuss</category>
      <category>codequality</category>
    </item>
  </channel>
</rss>
