<?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>Forem: Aniruddh Mukherjee</title>
    <description>The latest articles on Forem by Aniruddh Mukherjee (@amkhrjee).</description>
    <link>https://forem.com/amkhrjee</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%2F359154%2Fdb1d2f78-afe8-40dd-8fa4-0c8b868d0f62.jpg</url>
      <title>Forem: Aniruddh Mukherjee</title>
      <link>https://forem.com/amkhrjee</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/amkhrjee"/>
    <language>en</language>
    <item>
      <title>Node.js - Everything You Need To Know</title>
      <dc:creator>Aniruddh Mukherjee</dc:creator>
      <pubDate>Mon, 10 Aug 2020 16:13:40 +0000</pubDate>
      <link>https://forem.com/amkhrjee/node-js-everything-you-need-to-know-2l3p</link>
      <guid>https://forem.com/amkhrjee/node-js-everything-you-need-to-know-2l3p</guid>
      <description>&lt;h2&gt;
  
  
  Context &amp;amp; Some History
&lt;/h2&gt;

&lt;p&gt;In 1995, when the Netscape Foundation needed a way to make the web pages load dynamically in their newly released  &lt;strong&gt;Netscape Navigator&lt;/strong&gt;, they decided to add a scripting language to the browser. Brendan Eich was assigned with the task of devising a new language, and thus, JavaScript was born. JavaScript was always meant to be used inside of a browser. It was never intended to be used for server-side programming.&lt;/p&gt;

&lt;p&gt;Ryan Dahl,  after being challenged by the problem of and the complexity of solutions to, updating a progress meter on a web page for uploading files with Ruby web servers. In a 2010 interview, Dahl said, "It amazed me this was such a hard problem.". The JavaScript 'arms-race' provided the language which could be used easily by web developers more used to working in the browser, and he combined it with his knowledge of event-driven servers, and the first version of Node.js was released. At that time, JavaScript lacked server-side libraries, so Dahl and other developers had to create what is regarded today as standard libraries for the server-side JavaScript. &lt;/p&gt;

&lt;h3&gt;
  
  
  NodeJS - What and How?
&lt;/h3&gt;

&lt;p&gt;The computer or mobile device that you are using for reading this blog right now only understands machine code, which is hard to understand for a human and hence assembly languages are built on top of that, and even these assembly languages are hard to read and write. So, languages like C, C++ are built on top of those assembly languages to communicate with the machine. JavaScript, on the other hand, is built to be run on browsers only. A machine cannot understand and hence compile JavaScript, as it's not built on assembly languages like C and C++. It's built for browsers. &lt;/p&gt;

&lt;p&gt;The browsers have the run-time engine that is written in languages like C++, that compile the JavaScript code inside of it and convert that into machine code to communicate with the computer. So, at the end of the day, we stumble upon the problem of the computer not being able to understand JavaScript without a browser. &lt;/p&gt;

&lt;p&gt;Node.js comes to solve this problem. According to Wikipedia, "Node.js is an open-source, cross-platform, JavaScript runtime environment (Framework) that executes JavaScript code outside a web browser.". In simple English, that means Node.js enables one to compile JavaScript outside of the browser engine environment. But, how, you might ask. Well, Node.js is also written in C++ and it wraps around Google's V8 Engine, allowing itself to compile JavaScript into Machine Code without any &lt;em&gt;actual&lt;/em&gt; browser intervention. Node.js adds even more functionality on top of the JavaScript engine. According to W3 Schools, here is what Node.js can do - &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Can generate dynamic page content&lt;/li&gt;
&lt;li&gt;Can create, open, read, write, delete, and close files on server&lt;/li&gt;
&lt;li&gt;Can collect form data&lt;/li&gt;
&lt;li&gt;Can add, delete, modify data in your database&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--llPb_oes--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/b8xom4slqnkzd97420ts.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--llPb_oes--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/b8xom4slqnkzd97420ts.png" alt="Alt Text" width="880" height="660"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Something More
&lt;/h3&gt;

&lt;p&gt;Node.js enables one to use JavaScript in command-line tools and for server-side scripting and thus enabling one to get into a "JavaScript Everywhere" paradigm.&lt;/p&gt;

&lt;p&gt;Though .js is the standard filename extension for JavaScript code, the name "Node.js" doesn't refer to a particular file in this context and is merely the name of the product.&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>node</category>
      <category>codenewbie</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Making Responsive React Web Apps without any libraries</title>
      <dc:creator>Aniruddh Mukherjee</dc:creator>
      <pubDate>Mon, 18 May 2020 05:25:20 +0000</pubDate>
      <link>https://forem.com/amkhrjee/making-responsive-react-web-apps-without-any-libraries-5h6h</link>
      <guid>https://forem.com/amkhrjee/making-responsive-react-web-apps-without-any-libraries-5h6h</guid>
      <description>&lt;h2&gt;
  
  
  Context
&lt;/h2&gt;

&lt;p&gt;For people who are new to coding or making their first web application with React, or just trying their hands on some HTML and CSS, making the application responsive to all screen-sizes is a major pain. It is very common among developers to altogether neglect this aspect of their app in the first place, letting it become major trouble in the long run. When you share the link to your newly made web app with your friends, remember that they are going to open that in their smartphones and not on a desktop, so, the app that you are so proud of, may end up looking like a scattered jigsaw puzzle on their tiny screens. So, if you don't want to see the sign-up button flying on top of the app logo, it's important to take this problem into consideration in the first place. &lt;/p&gt;

&lt;h2&gt;
  
  
  Why not libraries?
&lt;/h2&gt;

&lt;p&gt;While libraries like Bootstrap and Reactstrap are great for cutting down the time for writing CSS, they come with their own trade-offs of lack of creative freedom. It becomes tough to design a completely custom web app with your desired theming with these libraries which bring upon a number of limitations in the design process. So, pure CSS is the only way to make your web app look the way you want it to be, up to every tiny grain of detail.&lt;/p&gt;

&lt;h2&gt;
  
  
  First Rule: Try not to mix them!
&lt;/h2&gt;

&lt;p&gt;It is commonplace that we start coding some parts of the frontend in Bootstrap and then for some parts we use pure CSS, and in the end, when you are trying to change something, it all becomes a mess. Sometimes the CSS doesn't work the way you expected and sometimes the Bootstrap behaves weirdly, making the process of debugging, and altogether, making the app responsive. Ergo, even if you are using both libraries and CSS, try to use them in a way they don't collide with each other.&lt;/p&gt;

&lt;h2&gt;
  
  
  Start with a mindset
&lt;/h2&gt;

&lt;p&gt;It is important to keep in mind that the app is not  going to run your system forever, for most of the time, it's going to run on a screen much smaller than your monitor and you should be coding the front-end accordingly. &lt;/p&gt;

&lt;h2&gt;
  
  
  Forget the pixels
&lt;/h2&gt;

&lt;p&gt;It is common among newbies, to use the measurement parameter 'px' while writing their CSS. Pixels are fixed quantities. It represents an absolute value, just like meter or inch. It's fixed, and that's why you should be avoiding it. What may look like a small distance on your giant monitor, may turn out to be a huge distance on someone's iPhone SE, because the 'px' remain fixed, even if the screen size change. And that's why you should be using relative units. Relative units change their value with different screen sizes and resolutions, making the process of building responsive apps smoother.  &lt;/p&gt;

&lt;h2&gt;
  
  
  Go Relative
&lt;/h2&gt;

&lt;p&gt;CSS has several relative units. The most useful ones are rem, em, vh, vw, and percentages. You will be using these a lot for making your CSS responsive. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;em&lt;/strong&gt; is relative to the font-size of the current parent.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;rem&lt;/strong&gt; is root em, and as the name suggests, it is relative to the font-size of the root element. It depends on the default font-size set on the user's web browser. In Chrome, the default is set to 16px.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;vh&lt;/strong&gt; stands for view-height of the browser window&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;vw&lt;/strong&gt; stands for the view-width of the browser window&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;percentage&lt;/strong&gt; is relative to the parent element&lt;/p&gt;

&lt;h2&gt;
  
  
  Dive into Containers
&lt;/h2&gt;

&lt;p&gt;If the key parts of the user interface are divided into small chunks of containers, it makes the process a whole lot easier and less messy. So always wrap up the key components into separate parent containers. For example,&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;div&lt;/span&gt; &lt;span class="na"&gt;className&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"container"&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;p&lt;/span&gt; &lt;span class="na"&gt;className&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"text"&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;Big Tuna&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;p&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;img&lt;/span&gt; &lt;span class="na"&gt;className&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"jim-image"&lt;/span&gt; &lt;span class="na"&gt;src&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;Jim&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt; &lt;span class="na"&gt;alt&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"X"&lt;/span&gt; &lt;span class="p"&gt;/&amp;gt;&lt;/span&gt;
&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;div&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Fixing the Fonts
&lt;/h2&gt;

&lt;p&gt;In the case of fonts, use em or rem. This will set  the font-size in context of the font-size used in the parent container, thus maintaining a smooth flow in the design. Using px instead of relative units may seem like a legit solution in development, but it messes up when opened in different devices. &lt;/p&gt;

&lt;h2&gt;
  
  
  Padding &amp;amp; Margin
&lt;/h2&gt;

&lt;p&gt;For padding and margin avoid using em, use rem, or percentage.  Using absolute units will result in serious troubles in specifically in this case as padding and margin are dependent on the screen size. &lt;/p&gt;

&lt;h2&gt;
  
  
  Flexing with Flexbox
&lt;/h2&gt;

&lt;p&gt;If you are not building a retro website from the 90s, you will definitely need to use flexbox to build modern websites. Flexbox provides a very easy-to-implement way to distribute different elements in a container. For using flexbox, you need to all the elements in a parent element and set the display property to flex. Flexbox comes with a variety of customization options. The beauty of flex is that it is responsive to screen sizes, which means it can grow or shrink the elements depending on screen-size. You can read more about flexbox &lt;a href="https://css-tricks.com/snippets/css/a-guide-to-flexbox/"&gt;here&lt;/a&gt;.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--G7MUqOHW--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://encrypted-tbn0.gstatic.com/images%3Fq%3Dtbn%253AANd9GcQV8GLAhH5YFcrkbLCft7Ync4jduPRErqfHAzBSkgM7VPFRXoQ9%26usqp%3DCAU" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--G7MUqOHW--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://encrypted-tbn0.gstatic.com/images%3Fq%3Dtbn%253AANd9GcQV8GLAhH5YFcrkbLCft7Ync4jduPRErqfHAzBSkgM7VPFRXoQ9%26usqp%3DCAU" alt="Flexbox image" width="335" height="150"&gt;&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nc"&gt;.parent&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;display&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;flex&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;h2&gt;
  
  
  Getting into Grids
&lt;/h2&gt;

&lt;p&gt;Grid is the superior version of flexbox. Unlike flexbox, Grid is two-dimensional, which means you can work with rows and columns at the same time.  Just like flexbox, you need to wrap up the elements you want as the &lt;em&gt;grid items&lt;/em&gt; in a &lt;em&gt;grid container&lt;/em&gt; and apply a display property of grid.  Grid comes with a vast array of functionalities and customizations. Read more about  them &lt;a href="https://css-tricks.com/snippets/css/complete-guide-grid/"&gt;here&lt;/a&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nc"&gt;.grid-container&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;display&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;grid&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;h2&gt;
  
  
  Media Query
&lt;/h2&gt;

&lt;p&gt;Media query is where you explicitly say the CSS that &lt;em&gt;this piece of code is only for the screen size mentioned&lt;/em&gt;. Media query takes parameter in terms of screen width:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="k"&gt;@media&lt;/span&gt; &lt;span class="n"&gt;only&lt;/span&gt; &lt;span class="n"&gt;screen&lt;/span&gt; &lt;span class="n"&gt;and&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;max-width&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;give_a_value&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="c"&gt;/* Your CSS for the specific screen size goes  here */&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The most common value for providing  responsiveness to most modern smartphones like the iPhone X, is a max-width of 768px.&lt;/p&gt;

&lt;h2&gt;
  
  
  Use the Browser Dev Tools
&lt;/h2&gt;

&lt;p&gt;Most modern web browsers come with an excellent support of developer tools. For checking how yor web app look on a mobile device, you can quickly go to the dev tools and change the screen size to any device of your choice from the given options. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ugPKYDdj--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://docs.microsoft.com/en-us/microsoft-edge/devtools-guide-chromium/media/device-mode-toggle-device-toolbar-option-show-device-frame.msft.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ugPKYDdj--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://docs.microsoft.com/en-us/microsoft-edge/devtools-guide-chromium/media/device-mode-toggle-device-toolbar-option-show-device-frame.msft.png" alt="https://docs.microsoft.com/en-us/microsoft-edge/devtools-guide-chromium/media/device-mode-toggle-device-toolbar-option-show-device-frame.msft.png" width="880" height="454"&gt;&lt;/a&gt;&lt;/p&gt;

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

&lt;p&gt;Adding responsiveness to your web app is not an easy task and sometimes it can be frustrating to fix the site for all the screen sizes that out there. But, if you are a beginner and making a web app just for fun, you don't need to work for each of the devices that is out there. Just work for the one that you know for sure is going to be used  the most. Try to develop a habit of thinking responsively. If you can work it out smartly, implenting  the two layout systems mentioned here effectively, actually, it's not that much of a work. It's just that it takes time and practice to develop the thinking  process.&lt;/p&gt;

</description>
      <category>react</category>
      <category>responsive</category>
      <category>css</category>
      <category>webdev</category>
    </item>
  </channel>
</rss>
