<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" xmlns:googleplay="http://www.google.com/schemas/play-podcasts/1.0"><channel><title><![CDATA[Ateev’s Newsletter]]></title><description><![CDATA[Musings of an Engineer]]></description><link>https://ateevchopra.com</link><image><url>https://ateevchopra.com/img/substack.png</url><title>Ateev’s Newsletter</title><link>https://ateevchopra.com</link></image><generator>Substack</generator><lastBuildDate>Fri, 17 Apr 2026 07:31:54 GMT</lastBuildDate><atom:link href="https://ateevchopra.com/feed" rel="self" type="application/rss+xml"/><copyright><![CDATA[Ateev]]></copyright><language><![CDATA[en]]></language><webMaster><![CDATA[ateev@substack.com]]></webMaster><itunes:owner><itunes:email><![CDATA[ateev@substack.com]]></itunes:email><itunes:name><![CDATA[Ateev]]></itunes:name></itunes:owner><itunes:author><![CDATA[Ateev]]></itunes:author><googleplay:owner><![CDATA[ateev@substack.com]]></googleplay:owner><googleplay:email><![CDATA[ateev@substack.com]]></googleplay:email><googleplay:author><![CDATA[Ateev]]></googleplay:author><itunes:block><![CDATA[Yes]]></itunes:block><item><title><![CDATA[Musings of an Engineer]]></title><description><![CDATA[Welcome to Ateev&#8217;s Newsletter by me, Ateev.]]></description><link>https://ateevchopra.com/p/coming-soon</link><guid isPermaLink="false">https://ateevchopra.com/p/coming-soon</guid><dc:creator><![CDATA[Ateev]]></dc:creator><pubDate>Sat, 24 Apr 2021 09:08:47 GMT</pubDate><content:encoded><![CDATA[<p>Welcome to Ateev&#8217;s Newsletter by me, Ateev. Founding Member - Orange Health | x Sr Engineer Paktor, Practo | Programmer | Teacher | Nomad</p><p>Sign up now so you don&#8217;t miss the first issue.</p><p class="button-wrapper" data-attrs="{&quot;url&quot;:&quot;https://ateevchopra.com/subscribe?&quot;,&quot;text&quot;:&quot;Subscribe now&quot;,&quot;action&quot;:null,&quot;class&quot;:null}" data-component-name="ButtonCreateButton"><a class="button primary" href="https://ateevchopra.com/subscribe?"><span>Subscribe now</span></a></p><p>In the meantime, <a href="https://ateevchopra.com/p/coming-soon?utm_source=substack&utm_medium=email&utm_content=share&action=share">tell your friends</a>!</p>]]></content:encoded></item><item><title><![CDATA[React.Js: Achieving 20ms server response time with Server Side Rendering and caching]]></title><description><![CDATA[We all love ReactJs for it&#8217;s rendering performance, modularity and the freedom it gives to choose your stack. But there is one thing that&#8230;]]></description><link>https://ateevchopra.com/p/react-js-achieving-20ms-server-response-time-with-server-side-rendering-1ea80e420d88</link><guid isPermaLink="false">https://ateevchopra.com/p/react-js-achieving-20ms-server-response-time-with-server-side-rendering-1ea80e420d88</guid><dc:creator><![CDATA[Ateev]]></dc:creator><pubDate>Mon, 17 Oct 2016 17:39:14 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!OLYB!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4cfa376e-5d34-442a-a2e9-d56ab6baa8f2_800x533.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>We all love ReactJs for it&#8217;s rendering performance, modularity and the freedom it gives to choose your stack. But there is one thing that makes it stand out. <strong>Server side rendering</strong>. Before React, most of the javascript frameworks focused on building Single Page Applications and did a pretty great job at it. But now it&#8217;s 2016, the era of <strong>Hybrid Apps! </strong>Apps that can run beyond browser environment<strong>. </strong>React has started a trend by supporting server side rendering, which enables us to build end-to-end javascript apps.</p><h3><strong>Little Background</strong></h3><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!OLYB!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4cfa376e-5d34-442a-a2e9-d56ab6baa8f2_800x533.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!OLYB!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4cfa376e-5d34-442a-a2e9-d56ab6baa8f2_800x533.jpeg 424w, https://substackcdn.com/image/fetch/$s_!OLYB!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4cfa376e-5d34-442a-a2e9-d56ab6baa8f2_800x533.jpeg 848w, https://substackcdn.com/image/fetch/$s_!OLYB!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4cfa376e-5d34-442a-a2e9-d56ab6baa8f2_800x533.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!OLYB!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4cfa376e-5d34-442a-a2e9-d56ab6baa8f2_800x533.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!OLYB!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4cfa376e-5d34-442a-a2e9-d56ab6baa8f2_800x533.jpeg" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/4cfa376e-5d34-442a-a2e9-d56ab6baa8f2_800x533.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!OLYB!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4cfa376e-5d34-442a-a2e9-d56ab6baa8f2_800x533.jpeg 424w, https://substackcdn.com/image/fetch/$s_!OLYB!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4cfa376e-5d34-442a-a2e9-d56ab6baa8f2_800x533.jpeg 848w, https://substackcdn.com/image/fetch/$s_!OLYB!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4cfa376e-5d34-442a-a2e9-d56ab6baa8f2_800x533.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!OLYB!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F4cfa376e-5d34-442a-a2e9-d56ab6baa8f2_800x533.jpeg 1456w" sizes="100vw" fetchpriority="high"></picture><div></div></div></a></figure></div><p>I am currently working on <a href="https://practo.com/healthfeed">Practo&#8217;s Healthfeed</a>, a place where doctors and health specialists write health articles and share their expertise. If not anything else, any blogging platform needs to be good at <strong>ONE</strong> thing the most: the <strong>SEO</strong>. Any blog with good SEO is destined to get more readers than anyone else. And more readers means more SEO&nbsp;!</p><p>To get better SEO you have to do a lot of things right. But here we&#8217;ll only talk the most important two, the most fundamentals for good SEO:</p><ul><li><p>Making your site <strong>crawlable for bots</strong>.</p></li><li><p>Make it <strong>FAST</strong>. Like Millennium Falcon fast&nbsp;!</p></li></ul><h3><strong>Enters React&nbsp;!</strong></h3><p>When React came out, one of it&#8217;s selling point was that it supported Server Side Rendering (SSR). To make your app support SSR, All you need is a <strong>node server</strong> and an <strong>API</strong>. The modern architecture looks something like this:</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!zG6D!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F130e73ee-d8e3-464e-a138-ccf92bc8220e_800x363.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!zG6D!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F130e73ee-d8e3-464e-a138-ccf92bc8220e_800x363.png 424w, https://substackcdn.com/image/fetch/$s_!zG6D!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F130e73ee-d8e3-464e-a138-ccf92bc8220e_800x363.png 848w, https://substackcdn.com/image/fetch/$s_!zG6D!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F130e73ee-d8e3-464e-a138-ccf92bc8220e_800x363.png 1272w, https://substackcdn.com/image/fetch/$s_!zG6D!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F130e73ee-d8e3-464e-a138-ccf92bc8220e_800x363.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!zG6D!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F130e73ee-d8e3-464e-a138-ccf92bc8220e_800x363.png" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/130e73ee-d8e3-464e-a138-ccf92bc8220e_800x363.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!zG6D!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F130e73ee-d8e3-464e-a138-ccf92bc8220e_800x363.png 424w, https://substackcdn.com/image/fetch/$s_!zG6D!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F130e73ee-d8e3-464e-a138-ccf92bc8220e_800x363.png 848w, https://substackcdn.com/image/fetch/$s_!zG6D!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F130e73ee-d8e3-464e-a138-ccf92bc8220e_800x363.png 1272w, https://substackcdn.com/image/fetch/$s_!zG6D!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F130e73ee-d8e3-464e-a138-ccf92bc8220e_800x363.png 1456w" sizes="100vw"></picture><div></div></div></a></figure></div><p>Notice&nbsp;! The node server acts as a mediate person between the user and the API server. So the Flow goes like this:</p><ul><li><p>User hits the URL, <strong>Request goes to the Node Server</strong>.</p></li><li><p>Node Server makes request to the API Server and <strong>takes the data from the API</strong> server.</p></li><li><p><strong>Pushes the data to the APP</strong>, which in return creates the final HTML for the user.</p></li><li><p><strong>Returns the HTML</strong> string back to the user.</p></li></ul><p>Now the whole setup is done&nbsp;! Server is taking requests, API is giving response and finally user/bots are getting a fully rendered HTML page. <strong>But this can turn out to be a user&#8217;s nightmare</strong>.</p><h3><strong>Issues&nbsp;!</strong></h3><ul><li><p>What if API server is <strong>slow</strong>! Like 500ms response time.</p></li></ul><p>One problem with the server side rendering is that it&#8217;s response time relies heavily on the API server&#8217;s response time. That means, no matter how efficient and fast app you&#8217;ve made, the user will see the white screen for atleast 500ms, provided your node server has 0 ms response time. Which is practically impossible (for now).</p><p>So let&#8217;s see the breakdown here:</p><ul><li><p><strong>500 ms</strong> response time from API</p></li><li><p><strong>150 ms</strong> for server side rendering (yes, it takes that much)</p></li><li><p><strong>10 ms</strong> for node server</p></li><li><p><strong>150 ms</strong> network latency</p></li></ul><p>So a user will get response after almost <strong>810ms</strong>&nbsp;! Now, of course these are just average numbers, but in real world, it can be lot worse. Since we don&#8217;t have much control over the network latency, we&#8217;ll keep that out. So the server response time is currently at <strong>660 ms</strong>.</p><p>To improve the situation, we&#8217;ll first catch the biggest fish: API response time.</p><h3><strong>Enters Redis&nbsp;!</strong></h3><p>Redis is one of the most powerful data-structure store, which is super fast and efficient. You can store anything in there as key value pairs. Integrating redis to store the node environment is super easy. If we <strong>store the API result in the redis</strong>, we can save our network trip to the API server.</p><p>So now, whenever the user makes some request, the node server will query the Redis if it already has the response. If it has, it&#8217;ll directly pass it to the app for rendering and finally return the HTML string. If it doesn&#8217;t have the response, we&#8217;ll go ahead and call the API and now store this result in the redis before passing it to the app.</p><p>The new breakdown will be:</p><ul><li><p><strong>150 ms</strong> for server side rendering</p></li><li><p><strong>5ms</strong> for the redis server (NOTE: The rendering time might be less or very high, depending upon your application size.)</p></li><li><p><strong>10 ms</strong> for node server</p></li></ul><p>With just caching our API responses, we have dropped down from 660 ms to <strong>160 ms</strong>.</p><h3><strong>Squeeze More&nbsp;!</strong></h3><p>Although 160 ms is good, we can get more by just a small trick.</p><p><em><strong>Instead of storing the API response in redis, why not store the whole HTML string itself&nbsp;?</strong></em></p><p>and this was the result&nbsp;!</p><div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!ZXG0!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9500b083-5888-4a36-8430-ba8cb37073cf_800x403.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!ZXG0!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9500b083-5888-4a36-8430-ba8cb37073cf_800x403.png 424w, https://substackcdn.com/image/fetch/$s_!ZXG0!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9500b083-5888-4a36-8430-ba8cb37073cf_800x403.png 848w, https://substackcdn.com/image/fetch/$s_!ZXG0!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9500b083-5888-4a36-8430-ba8cb37073cf_800x403.png 1272w, https://substackcdn.com/image/fetch/$s_!ZXG0!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9500b083-5888-4a36-8430-ba8cb37073cf_800x403.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!ZXG0!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9500b083-5888-4a36-8430-ba8cb37073cf_800x403.png" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/9500b083-5888-4a36-8430-ba8cb37073cf_800x403.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:true,&quot;topImage&quot;:false,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!ZXG0!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9500b083-5888-4a36-8430-ba8cb37073cf_800x403.png 424w, https://substackcdn.com/image/fetch/$s_!ZXG0!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9500b083-5888-4a36-8430-ba8cb37073cf_800x403.png 848w, https://substackcdn.com/image/fetch/$s_!ZXG0!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9500b083-5888-4a36-8430-ba8cb37073cf_800x403.png 1272w, https://substackcdn.com/image/fetch/$s_!ZXG0!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F9500b083-5888-4a36-8430-ba8cb37073cf_800x403.png 1456w" sizes="100vw" loading="lazy"></picture><div></div></div></a></figure></div><p>The average response time fell to <strong>20 ms</strong>&nbsp;!</p><h3><strong>Cache busting</strong></h3><p>If not handled properly, caching becomes a pain in the ass. People start constantly reporting older data/bugs become common. So with great cache, we also need a good cache busting strategy. Usually We have two cases where we have to clear the cache:</p><ul><li><p><strong>When author updates the article. (When data updates happen)</strong></p></li></ul><p>When an author updates something, he wants to see the changes reflected immediately&nbsp;! For this, we created a small param <code>cache=false</code>. Whenever the url is hit with this URL, the node server makes and API call instead of fetching data from the redis cache. And hence the cache is updated with the newer data.</p><ul><li><p><strong>Whenever you deploy&nbsp;!</strong></p></li></ul><p>Whenever you deploy, new chunk hash for js and css files gets generated. This means if you&#8217;re storing the whole HTML string in the cache, it&#8217;ll become invalid with the deployment. Hence, whenever you deploy, the redis db needs to be flushed completely.</p><h3><strong>Conclusions</strong></h3><p>Node is fast. So is React&nbsp;! But sometimes we need to add a new player to achieve that impossible goal without sacrificing any user experience points. Redis is awesome. Use all of these wisely.</p>]]></content:encoded></item><item><title><![CDATA[Why React ?]]></title><description><![CDATA[Javascript community is exploding. And React is one of the biggest buzz word of it. Everyone is choosing React as their main framework to&#8230;]]></description><link>https://ateevchopra.com/p/why-react-231af9e73d9a</link><guid isPermaLink="false">https://ateevchopra.com/p/why-react-231af9e73d9a</guid><dc:creator><![CDATA[Ateev]]></dc:creator><pubDate>Thu, 13 Oct 2016 07:01:39 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!1uz8!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffb27e212-e244-4012-b3b4-689f89e5cb9e_800x533.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!1uz8!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffb27e212-e244-4012-b3b4-689f89e5cb9e_800x533.jpeg" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!1uz8!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffb27e212-e244-4012-b3b4-689f89e5cb9e_800x533.jpeg 424w, https://substackcdn.com/image/fetch/$s_!1uz8!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffb27e212-e244-4012-b3b4-689f89e5cb9e_800x533.jpeg 848w, https://substackcdn.com/image/fetch/$s_!1uz8!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffb27e212-e244-4012-b3b4-689f89e5cb9e_800x533.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!1uz8!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffb27e212-e244-4012-b3b4-689f89e5cb9e_800x533.jpeg 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!1uz8!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffb27e212-e244-4012-b3b4-689f89e5cb9e_800x533.jpeg" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/fb27e212-e244-4012-b3b4-689f89e5cb9e_800x533.jpeg&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!1uz8!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffb27e212-e244-4012-b3b4-689f89e5cb9e_800x533.jpeg 424w, https://substackcdn.com/image/fetch/$s_!1uz8!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffb27e212-e244-4012-b3b4-689f89e5cb9e_800x533.jpeg 848w, https://substackcdn.com/image/fetch/$s_!1uz8!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffb27e212-e244-4012-b3b4-689f89e5cb9e_800x533.jpeg 1272w, https://substackcdn.com/image/fetch/$s_!1uz8!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2Ffb27e212-e244-4012-b3b4-689f89e5cb9e_800x533.jpeg 1456w" sizes="100vw" fetchpriority="high"></picture><div></div></div></a></figure></div><p>Javascript community is exploding. And React is one of the biggest buzz word of it. Everyone is choosing React as their main framework to make any new web app, Android App, iOS App and even TV apps ( Yes, Netflix&nbsp;!).</p><p>Why you should choose React for your next project&nbsp;? What makes it so great&nbsp;? Some say it&#8217;s speed. If you think that&#8217;s the reason, you should go use vanilla javascript. Not just vanilla, There are many frameworks that can perform better than React. Mithril is one good example. So if not React, what makes it so popular&nbsp;?</p><h3><strong>Components&nbsp;!</strong></h3><blockquote><p>One should always write code that is <a href="http://programmingisterrible.com/post/139222674273/write-code-that-is-easy-to-delete-not-easy-to">easy to delete, not easy to extend</a>.</p></blockquote><p>When you start thinking your project in terms of small modules, like lego blocks&nbsp;!, everything becomes so easier. With React, one can easily achieve this. In fact the core of React itself is built around modular principles. To think it more clearly, think everything is a component. A button, A slider, A navbar, a sidebar. <strong>Everything is a component</strong>. There are smaller components which can be reused across anywhere in project. And these components combine to create bigger components. But what advantage does breaking our project into components gives us&nbsp;?</p><ul><li><p>It makes <strong>code reuse</strong> super easy&nbsp;! Not just inter-project, components can be reused across projects.</p></li><li><p><strong>Lesser bugs</strong>. Each component is self sufficient. Overlapping is way less.</p></li><li><p><strong>Easy to debug</strong>. You&#8217;ll know easily which component needs tweaking.</p></li><li><p>Easy <strong>maintainability</strong>. Changing something means changing one component. Usually it doesn&#8217;t affect other components. Same of adding new components.</p></li></ul><h3><strong>It&#8217;s a library. Not a framework</strong></h3><p>React is just a View framework. The V in the MVC. And it&#8217;s even pretty good at it. But how does it makes our life easier&nbsp;? With just V, we have a wide variety of things to choose from. We can choose what we want for model layer. we can choose if we want routing or not. And the way React is made, it&#8217;s compatible with almost anything. It&#8217;s like oreos. Everything goes with oreos. It gives us <strong>liberty to choose the best tools for the job.</strong> This also allows us to easily replace one library with the other with less.</p><p>In many big frameworks, such liberty is not there. You have to use the same router, it comes with. You have to use the same network library it comes with. Even if you choose to use something else, you cannot get rid of inbuilt tools. It&#8217;s there. Always.</p><p>This is one of the reasons how React got such a great <a href="https://github.com/reactjs">community</a>. With react as a great View Library, <strong>Redux</strong> came as a great data handling library. <strong>React-Router</strong> came as a great routing solution. And so on. More on these later.</p><p>So being a library gives us freedom. Which is awesome&nbsp;!</p><h3><strong>Functional Programming</strong></h3><p>React uses functional approach for creating UI elements. The core of React is functional. This enables us to make <strong>stateless components</strong>. You pass data to pure functions, and they return back rendered elements with that data. This makes reusability of components very easy. One can pass different types of data to render similar looking components, sharing the same component. It also helps in easy debugging and great control over the data and it&#8217;s flow.</p><p>It also enables us in making great dev tools like <a href="https://gaearon.github.io/react-hot-loader/">hot reloading</a>, time travelling etc.</p><h3><strong>Hybrid Applications</strong></h3><p>React is great if you are making a client side application. We will always want public (outside authentication walls) apps to be server rendered because of obvious reasons <strong>(SEO)</strong>. But there was a reason that world moved to single page apps (SPAs). It was getting in the way of app performance and user experience.</p><p>There is no need to fetch the entire document every time you open a link on the app. In universal apps, Every time you open a page for the first time, the <strong>server fetches the data</strong>, pass it the React, <strong>generates the markup on server itself </strong>and finally <strong>sends that markup to the browser</strong>. So the first page is rendered server side.</p><p>All the<strong> subsequent views are rendered by the browser</strong> itself by making data requests to the API directly.</p><p>So this gives us the best of both worlds. <strong>A SEO ready app, and a fast rendering, user friendly app</strong>.</p><p>Enough of why we should use React. Let&#8217;s discuss</p><h3><strong>Why not to use React&nbsp;?</strong></h3><p><strong>Speed</strong>: React uses Virtual DOM. Which makes DOM manipulations faster. But will it make YOUR app faster&nbsp;? Does you app does intensive DOM manipulations&nbsp;? Most of them don&#8217;t. Here is an example shown in React.js 2015 conf.</p><p>Same app was made using React and Angular. You can see the difference in rendering.</p><ul><li><p><a href="http://speed.examples.500tech.com/ngrepeat/before/angular.html">AngularJS</a></p></li><li><p><a href="http://speed.examples.500tech.com/ngrepeat/before/react.html">ReactJS</a></p></li></ul><p>But with changing just one line in angular code, <a href="http://speed.examples.500tech.com/ngrepeat/after/angular.html">this</a> happens. From this, the biggest learning is that <strong>good code and timely optimizations can only make your project faster</strong>, not the choice of framework/ library you use.</p><p><strong>Learning Curve: </strong>React is just a view library. To make a complete new application, a new person <strong>needs to learn all the other libraries/modules.</strong></p><h3><strong>Final words</strong></h3><p><strong>Use React because of it&#8217;s code structure and modularity</strong>. That is where a lot of dev productivity is saved. Use React for its ease of server side rendering. Use React for its awesome growing community and support.</p>]]></content:encoded></item><item><title><![CDATA[Dropping your friends home after party ?]]></title><description><![CDATA[there's an app for that.]]></description><link>https://ateevchopra.com/p/dropping-your-friends-home-after-party-f23d6ace540a</link><guid isPermaLink="false">https://ateevchopra.com/p/dropping-your-friends-home-after-party-f23d6ace540a</guid><dc:creator><![CDATA[Ateev]]></dc:creator><pubDate>Wed, 21 Aug 2013 11:09:36 GMT</pubDate><enclosure url="https://substackcdn.com/image/fetch/$s_!yJkZ!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F93f8d8a0-5fe0-44f7-8334-d3a994a08adc_800x533.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<div class="captioned-image-container"><figure><a class="image-link image2" target="_blank" href="https://substackcdn.com/image/fetch/$s_!yJkZ!,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F93f8d8a0-5fe0-44f7-8334-d3a994a08adc_800x533.png" data-component-name="Image2ToDOM"><div class="image2-inset"><picture><source type="image/webp" srcset="https://substackcdn.com/image/fetch/$s_!yJkZ!,w_424,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F93f8d8a0-5fe0-44f7-8334-d3a994a08adc_800x533.png 424w, https://substackcdn.com/image/fetch/$s_!yJkZ!,w_848,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F93f8d8a0-5fe0-44f7-8334-d3a994a08adc_800x533.png 848w, https://substackcdn.com/image/fetch/$s_!yJkZ!,w_1272,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F93f8d8a0-5fe0-44f7-8334-d3a994a08adc_800x533.png 1272w, https://substackcdn.com/image/fetch/$s_!yJkZ!,w_1456,c_limit,f_webp,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F93f8d8a0-5fe0-44f7-8334-d3a994a08adc_800x533.png 1456w" sizes="100vw"><img src="https://substackcdn.com/image/fetch/$s_!yJkZ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F93f8d8a0-5fe0-44f7-8334-d3a994a08adc_800x533.png" data-attrs="{&quot;src&quot;:&quot;https://substack-post-media.s3.amazonaws.com/public/images/93f8d8a0-5fe0-44f7-8334-d3a994a08adc_800x533.png&quot;,&quot;srcNoWatermark&quot;:null,&quot;fullscreen&quot;:null,&quot;imageSize&quot;:null,&quot;height&quot;:null,&quot;width&quot;:null,&quot;resizeWidth&quot;:null,&quot;bytes&quot;:null,&quot;alt&quot;:null,&quot;title&quot;:null,&quot;type&quot;:null,&quot;href&quot;:null,&quot;belowTheFold&quot;:false,&quot;topImage&quot;:true,&quot;internalRedirect&quot;:null,&quot;isProcessing&quot;:false,&quot;align&quot;:null,&quot;offset&quot;:false}" class="sizing-normal" alt="" srcset="https://substackcdn.com/image/fetch/$s_!yJkZ!,w_424,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F93f8d8a0-5fe0-44f7-8334-d3a994a08adc_800x533.png 424w, https://substackcdn.com/image/fetch/$s_!yJkZ!,w_848,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F93f8d8a0-5fe0-44f7-8334-d3a994a08adc_800x533.png 848w, https://substackcdn.com/image/fetch/$s_!yJkZ!,w_1272,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F93f8d8a0-5fe0-44f7-8334-d3a994a08adc_800x533.png 1272w, https://substackcdn.com/image/fetch/$s_!yJkZ!,w_1456,c_limit,f_auto,q_auto:good,fl_progressive:steep/https%3A%2F%2Fsubstack-post-media.s3.amazonaws.com%2Fpublic%2Fimages%2F93f8d8a0-5fe0-44f7-8334-d3a994a08adc_800x533.png 1456w" sizes="100vw" fetchpriority="high"></picture><div></div></div></a><figcaption class="image-caption">http://xkcd.com/399/</figcaption></figure></div><h4>there's an app for&nbsp;that</h4><p>Update 2 (2016): This was a college project Idid back in 2013. Now the app is no more available.</p><p>Update&nbsp;: This app is now available on the app store. Check it out <a href="https://itunes.apple.com/us/app/postparty/id697205626?ls=1&amp;mt=8">here</a>.</p><p>Experience the app <a href="https://app.io/fuQUlM">here</a>.</p><p>Everybody loves parties. And why shouldn&#8217;t one. Parties are fun. They are wild. But real problems starts after the party. There&#8217;s always a person who gets the responsibility of dropping everyone home after the party, no matter how drunk they are. Now it is up to him to decide whom to drop first and then next&nbsp;.&nbsp;.&nbsp;. In what order should he drop all his friends so that he does this in minimum distance or say minimum time. This problem is not just specific to the party guys. Its a general problem that we face everyday. Like, in what order to go shopping&nbsp;,eat food and watch a movie on a same day.</p><p>This problem has a name in mathematics, &#8220;<a href="https://en.wikipedia.org/wiki/Travelling_salesman_problem">Traveling Salesman problem</a>&#8221;. According to this problem, a salesman has to start from a specific point, travel all the cities listed, and then come back to the starting point. And he should do all this in minimum distance. Here the order in which he travels the cities matters the most.This problem is exactly what our guy faces after the party. He has to travel to all the homes of his friends, but should do this in such an order, that saves his some miles of late night traveling.</p><p>We decided to create an app that gives us solution to this day-to-day problem. For that we knew that we need some real world locations and distances between them. So we went out to use the best location service on the planet - &#8220;Google Maps&#8221;. They have the best and easy to use API that we could use. Next we needed a great interface. Now for a great interface,we decided to use Twitter bootstrap. We want this app to be used on mobiles, so we used the 3.0 version which released recently. It is really great, especially if you are developing for the mobile devices.</p><p>Today we are really excited to release a beta version &#8220;PostParty&#8221;. Here is a <a href="https://medium.com/p/f23d6ace540a/goog_2040928513">link</a><a href="https://app.io/fuQUlM"> </a>where you can experience this app right in your browser. Hope you will like this and suggest some more improvements. All critiques are most welcome. Make us push this product to the perfection.</p>]]></content:encoded></item></channel></rss>