<?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: Tanishq Kr. Kaushal</title>
    <description>The latest articles on DEV Community by Tanishq Kr. Kaushal (@tanishqkrk).</description>
    <link>https://dev.to/tanishqkrk</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%2F867350%2F08e9d6d1-0148-41bb-9e13-c0840cbca8f0.jpeg</url>
      <title>DEV Community: Tanishq Kr. Kaushal</title>
      <link>https://dev.to/tanishqkrk</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/tanishqkrk"/>
    <language>en</language>
    <item>
      <title>What the hell is this Execution Context?!</title>
      <dc:creator>Tanishq Kr. Kaushal</dc:creator>
      <pubDate>Sat, 24 Sep 2022 13:47:57 +0000</pubDate>
      <link>https://dev.to/tanishqkrk/what-the-hell-is-this-execution-context-4bcc</link>
      <guid>https://dev.to/tanishqkrk/what-the-hell-is-this-execution-context-4bcc</guid>
      <description>&lt;p&gt;&lt;em&gt;JavaScript has quite the reputation for being the most popular language in the world, and 98% of world's websites use JavaScript as their main source of development for either front, end or both ends.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;But how does JS functions under the hood to be this popular and powerful?&lt;/p&gt;

&lt;p&gt;It is all possible because of the JavaScript runtime environment, which contains many functionalities and tools which contains the call stack, the event loop, callback queue, microtask queue, a collection of web APIs. &lt;a href="https://dev.tourl"&gt;More on that JS runtime env&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Inside the call stack, the code is executed one function at a time. Every time code is executed an Execution context is created with it.&lt;/p&gt;

&lt;p&gt;An execution context is a virtual environment which includes 2 parts, the variable environment (memory) &amp;amp; Thread of execution (Code)&lt;/p&gt;

&lt;h2&gt;
  
  
  Variable Environment:
&lt;/h2&gt;

&lt;p&gt;The values inside the this are stored as key:value pairs registering all the variables and functions inside the code. The variables are stored as the variable itself, and same with the functions, it stores functions as a whole no matter the size, there are indeed certain exceptions, but overall functions are stored as whole inside the Execution context as a whole.&lt;/p&gt;

&lt;h2&gt;
  
  
  Thread of Execution:
&lt;/h2&gt;

&lt;p&gt;Inside this all the functioning happens, the code is executed line by line, since JS is a single threaded language, it can only execute one command of line at once.&lt;/p&gt;

&lt;p&gt;Here's my poorly drawn adaptation of an Execution context:&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--eH_qZ7wS--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/a6rsoyq2tnpneh2tlmfg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--eH_qZ7wS--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/a6rsoyq2tnpneh2tlmfg.png" alt="Execution context" width="800" height="440"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  The process:
&lt;/h2&gt;

&lt;p&gt;JS skims through the code twice, in the first run, it registers all the variables and functions. Functions are registered as they are, but in case of variables, they are stored as 'undefined'. It means we can access the variable prior to it being defined but it'll return undefined.&lt;/p&gt;

&lt;p&gt;for ex:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;console.log(a);
var a = 10;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is a valid code in JS it'll log undefined in the console, but do take note this is only possible in ONLY the case of var and not let/const. That's one of the differences between var, let and const. This phenomenon to access variables prior to their declaration is hoisting, more on that in another blog.&lt;/p&gt;

&lt;p&gt;On the second run it executes the code line by line and every time there is a variable is defined, it updates the value of that variable from undefined to the value inside the variable environment.&lt;/p&gt;

&lt;p&gt;Once the execution is completed, the Execution context is popped off the call stack.&lt;br&gt;
At the base, every time the code is run, the Global Execution context is created, and every Execution context after that is on top of it.&lt;/p&gt;

&lt;p&gt;And that is how the code is executed inside the JS runtime, but this is only the tip of the iceberg, there are a LOT of tools inside the JS Runtime that plays a role in executing code!&lt;/p&gt;

&lt;p&gt;Hope you liked! :)&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>webdev</category>
      <category>programming</category>
      <category>beginners</category>
    </item>
    <item>
      <title>My personal practice while building websites.</title>
      <dc:creator>Tanishq Kr. Kaushal</dc:creator>
      <pubDate>Wed, 01 Jun 2022 18:50:45 +0000</pubDate>
      <link>https://dev.to/tanishqkrk/my-personal-practice-while-building-websites-183d</link>
      <guid>https://dev.to/tanishqkrk/my-personal-practice-while-building-websites-183d</guid>
      <description>&lt;p&gt;If you're reading this, there's a 40% chance you're a front-end web developer, you might be a student, just getting into the field, or you might be an expert for 10+ years, one thing every single beginner front-end web developer and programmers in general, struggle is how to start that development process!&lt;br&gt;
Of course we'll write the HTML first and do everything AFTER that, but still, we've got parts to design a site, HTML, CSS and JS, plus managing those 3 in order to keep the code clean and the site fast and that management is what troubles most new developers.&lt;br&gt;
Every single developer out there has their own personal development procedure, and there is no wrong or right, it's totally subjective depending on what you prefer.&lt;br&gt;
I'm here to share my own design and development system, which I feel might be useful if you get confused in what to do first.&lt;/p&gt;

&lt;p&gt;Note: This procedure is recommended considering you're a beginner, you probably do now know a framework, you're getting your way around the holy trinity (HTML,CSS and JS) right now. &lt;/p&gt;

&lt;h1&gt;Initial data collection&lt;/h1&gt;

&lt;p&gt;Initialize by creating a project folder in a proper directory and not your desktop.&lt;/p&gt;

&lt;p&gt;The first step that I take is collect all the data required for the website, this includes the images, 
audios, videos, backgrounds, patterns, the UX design and what not. Just everything you'll put inside the site or use as reference.
Put all that inside a new folder named 'assets'. With this, you're done with your first step towards building the website. &lt;/p&gt;

&lt;h1&gt;Create the files&lt;/h1&gt;

&lt;p&gt;Now when you've collected the data, it's time to move on to the coding part, to start you'll have to create some files:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;index.html&lt;/li&gt;
&lt;li&gt;style.css&lt;/li&gt;
&lt;li&gt;theme.css&lt;/li&gt;
&lt;li&gt;selectors.js&lt;/li&gt;
&lt;li&gt;script.js&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These files are regarding a single page website. For the multi-page websites, I'll explain later.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;index.html&lt;/code&gt;, you guessed it, the main page, the greeting webpage to the user. &lt;br&gt;
&lt;code&gt;style.css&lt;/code&gt; the style of that page, it'll include the the styling of particular elements in the page.&lt;br&gt;
&lt;code&gt;theme.css&lt;/code&gt;, is as it sounds, the theme of the website, here you'll define the &lt;code&gt;:root&lt;/code&gt; variables, like theme colors, and border radius, the fonts throughout the website, any other themed element like scrollbar and other stuff, which is totally variable and could be changed in future without any hassles of going through the entire code again.&lt;br&gt;
&lt;code&gt;selectors.js&lt;/code&gt;, these includes all the &lt;code&gt;document.querySelector()&lt;/code&gt; etc variables, the selectors stored inside variables to use inside the,&lt;br&gt;
&lt;code&gt;script.js&lt;/code&gt; file, the main JavaScript file, the logic to your website.&lt;br&gt;
Having a selector file keeps your JS file clean and readable, and all you've to worry about is the code and not the selectors, because they're stored safely inside a different file.&lt;br&gt;
So far, your project folder should look like this:&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--1Ba5-uiT--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/l6imhmis736csvnnl3e6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--1Ba5-uiT--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/l6imhmis736csvnnl3e6.png" alt="Image description" width="322" height="171"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;Coding the website&lt;/h1&gt;

&lt;p&gt;This is the fun part because we finally start the actual development.&lt;br&gt;
Start off with the index file, put all the data inside, from the header icons and links, to the footer logo, everything, text, links, images, icons, purely in their original state,&lt;b&gt; don't add any inline CSS or any script or CSS in the head or anywhere in the HTML&lt;/b&gt;, leave the HTML to be HTML.&lt;br&gt;
Add the head files, add theme.css above style.css and selectors.js above script.js.&lt;br&gt;
Now when you've thrown all the content inside your html file, it's time to start the styling, from the header to the footer, use a top to bottom approach and give everything the styles, the colors, sizes, background and everything, don't add the hover and clicking effects yet, leave them for later.&lt;br&gt;
Now when we've completed the styling and our website looks like a static webpage, we're going to add the hover and click effects, and finally after that, comes to responsiveness. Add media queries to your website and make it functional.&lt;/p&gt;

&lt;p&gt;Till this, you've a static and good looking webpage in your hand, now comes the JS, take all the classes and ids you think you'll use to manipulate the DOM, put them all in the selectors file. And finally start giving logic and functionality to your webpage by working on the script file.&lt;/p&gt;

&lt;p&gt;If you've a multiple page website, what you should do it after coding the html of all those other pages, link the theme to them as well, and then give separate style sheets, try to have similar looking elements throughout your site, reusable content and a design system to reduce your styling process.&lt;/p&gt;

&lt;p&gt;And that, is my personal procedure before starting a project with the holy trinity, hope you liked it!&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>webdev</category>
      <category>beginners</category>
      <category>programming</category>
    </item>
    <item>
      <title>First commit!</title>
      <dc:creator>Tanishq Kr. Kaushal</dc:creator>
      <pubDate>Wed, 25 May 2022 06:26:15 +0000</pubDate>
      <link>https://dev.to/tanishqkrk/first-commit-14a6</link>
      <guid>https://dev.to/tanishqkrk/first-commit-14a6</guid>
      <description>&lt;h1&gt;Hey there everyone!&lt;/h1&gt;

&lt;p&gt;I'm Tanishq Kaushal, a budding and aspiring web developer, currently I'm polishing my JavaScript skills and getting better at design patterns and writing clean code.
This is my first post in dev.to and I'm glad to be here among such wonderful and supporting developers!&lt;/p&gt;

&lt;p&gt;Since I'm new to this platform, let me give out my portfolios and contact details for collaboration and projects!&lt;/p&gt;

&lt;p&gt;✏️&lt;a href="https://tanishqkrk.github.io/tanishqkrk-portfolio/"&gt;My Portfolio!&lt;/a&gt;&lt;br&gt;
🐈‍⬛&lt;a href="https://github.com/tanishqkrk"&gt;My GitHub!&lt;/a&gt;&lt;br&gt;
🐤&lt;a href="https://twitter.com/TanishqKaushal"&gt;My Twitter!&lt;/a&gt;&lt;br&gt;
📷&lt;a href="https://instagram.com/tanishqkrk"&gt;My Instagram!&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;b&gt;Make sure to check out my resume and comment your review!&lt;/b&gt;&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>webdev</category>
      <category>beginners</category>
      <category>programming</category>
    </item>
  </channel>
</rss>
