<?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"><channel><title><![CDATA[Explore with Aadi]]></title><description><![CDATA[Explore with Aadi]]></description><link>https://blog.exploreraadi.com</link><generator>RSS for Node</generator><lastBuildDate>Sun, 15 Nov 2026 03:26:44 GMT</lastBuildDate><atom:link href="https://blog.exploreraadi.com/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[Uploading images the right way]]></title><description><![CDATA[Images are an important part of any web application so writing a clean upload logic is very important. Let's create a custom react hook to handle that.]]></description><link>https://blog.exploreraadi.com/uploading-images-the-right-way</link><guid isPermaLink="true">https://blog.exploreraadi.com/uploading-images-the-right-way</guid><category><![CDATA[Web Development]]></category><category><![CDATA[ReactHooks]]></category><category><![CDATA[React]]></category><category><![CDATA[images]]></category><category><![CDATA[Beginner Developers]]></category><dc:creator><![CDATA[Aditya Raj]]></dc:creator><pubDate>Wed, 07 Dec 2022 04:39:25 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1670387280040/6ZV9FMor5.jpg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Images have always been an important part of any web application but I have always written messy logic for uploading images. In my first job, we were using React Class components and I remember creating a big upload function, a few states for handling loading, errors, etc., and a ton of if-else conditions for the rendering part. I am sure you must have written or seen something like it too. But then React hooks were released and I have finally found an abstraction after a few iterations that works well and doesn’t look half bad.</p>
<p>We will create a useUploadImage hook. It is important to only keep relevant logic inside the hook and leave all other decisions to the component calling it like what to do after a successful or failed upload so that our hook stays reusable. We will then create a uploadImage method inside the hook. This method has four parameters - the file to upload, the API endpoint you’re uploading to, a callback function to execute after a successful upload, and an optional callback to execute if any error occurs.</p>
<p>Now when making any POST request, one needs to encode the body of the requested data. For uploading files, API endpoints use “multipart/form-data” encoding. So let’s go ahead and create a new <code>FormData</code> object and append the file along with any other information that your API endpoint asks for (I have taken cloudinary as an example). I am assigning <code>any</code> as response and error type just for the sake of this example.</p>
<pre><code class="lang-typescript"><span class="hljs-keyword">export</span> <span class="hljs-keyword">const</span> useUploadImage = <span class="hljs-function">() =&gt;</span> {
 <span class="hljs-keyword">const</span> uploadImage = ({
    file,
    uploadURL,
    onUploadComplete,
    onUploadError,
  }: {
    file: File;
    uploadURL: <span class="hljs-built_in">string</span>;
    onUploadComplete: <span class="hljs-function">(<span class="hljs-params">response: <span class="hljs-built_in">any</span></span>) =&gt;</span> <span class="hljs-built_in">void</span>;
    onUploadError?: <span class="hljs-function">(<span class="hljs-params">error: <span class="hljs-built_in">any</span></span>) =&gt;</span> <span class="hljs-built_in">void</span>;
  }) =&gt; {
    <span class="hljs-keyword">const</span> formData = <span class="hljs-keyword">new</span> FormData();
    formData.append(<span class="hljs-string">"file"</span>, file);

    <span class="hljs-comment">// Example: When using cloudinary,</span>
    formData.append(<span class="hljs-string">"api_key"</span>, <span class="hljs-string">"1234"</span>);
    formData.append(<span class="hljs-string">"timestamp"</span>, <span class="hljs-string">"1315060510"</span>);
    formData.append(<span class="hljs-string">"folder"</span>, <span class="hljs-string">"demo"</span>);
    formData.append(<span class="hljs-string">"signature"</span>, <span class="hljs-string">"bfd09f95f331f558cbd1320e67aa8d488770583e"</span>);
  }
}
</code></pre>
<p>Moving on, we will now create a uploadRef object using the useRef hook because it gives us a mutable object with a .current property that can be manipulated easily without worrying about unexpected re-renders, unlike states.</p>
<p>For creating the upload request, We will be using the good old XHR so that we can get the upload progress quickly in real time and use it to show those pretty progress bars in the UI. To achieve that, we will add an event listener on its upload object to listen for the progress event and then set it in a state to easily expose it out of the event listener.</p>
<pre><code class="lang-typescript"><span class="hljs-keyword">import</span> { useRef, useState } <span class="hljs-keyword">from</span> <span class="hljs-string">"react"</span>;

<span class="hljs-keyword">export</span> <span class="hljs-keyword">const</span> useUploadImage = <span class="hljs-function">() =&gt;</span> {
  <span class="hljs-keyword">const</span> [uploadProgress, setUploadProgress] = useState(<span class="hljs-number">0</span>);
  <span class="hljs-keyword">const</span> uploadRef = useRef&lt;XMLHttpRequest | <span class="hljs-literal">null</span>&gt;(<span class="hljs-literal">null</span>);

  <span class="hljs-keyword">const</span> uploadImage = ({
    file,
    uploadURL,
    onUploadComplete,
    onUploadError,
  }: {
    file: File;
    uploadURL: <span class="hljs-built_in">string</span>;
    onUploadComplete: <span class="hljs-function">(<span class="hljs-params">response: <span class="hljs-built_in">any</span></span>) =&gt;</span> <span class="hljs-built_in">void</span>;
    onUploadError?: <span class="hljs-function">(<span class="hljs-params">error: <span class="hljs-built_in">any</span></span>) =&gt;</span> <span class="hljs-built_in">void</span>;
  }) =&gt; {
    <span class="hljs-keyword">const</span> formData = <span class="hljs-keyword">new</span> FormData();
    formData.append(<span class="hljs-string">"file"</span>, file);

    uploadRef.current = <span class="hljs-keyword">new</span> XMLHttpRequest();
    uploadRef.current.open(<span class="hljs-string">"PUT"</span>, uploadURL);
    uploadRef.current.upload.addEventListener(
      <span class="hljs-string">"progress"</span>,
      <span class="hljs-function">(<span class="hljs-params">{ loaded, total }</span>) =&gt;</span> {
        setUploadProgress((loaded * <span class="hljs-number">100</span>) / total);
      },
    );
  }
}
</code></pre>
<p>Finally, we will initiate the request and then attach an async function to the onload event of XHR to handle the upload response object and execute the onUploadComplete callback that we have defined as one of the parameters. Let's also attach a function to the onerror event to deal with any errors during upload and execute the onUploadError callback inside it. We will also return the method we created along with the uploadProgress state.</p>
<pre><code class="lang-typescript"><span class="hljs-keyword">import</span> { useRef, useState } <span class="hljs-keyword">from</span> <span class="hljs-string">"react"</span>;

<span class="hljs-keyword">export</span> <span class="hljs-keyword">const</span> useUploadImage = <span class="hljs-function">() =&gt;</span> {
  <span class="hljs-keyword">const</span> [uploadProgress, setUploadProgress] = useState(<span class="hljs-number">0</span>);
  <span class="hljs-keyword">const</span> uploadRef = useRef&lt;XMLHttpRequest | <span class="hljs-literal">null</span>&gt;(<span class="hljs-literal">null</span>);

  <span class="hljs-keyword">const</span> uploadImage = ({
    file,
    uploadURL,
    onUploadComplete,
    onUploadError,
  }: {
    file: File;
    uploadURL: <span class="hljs-built_in">string</span>;
    onUploadComplete: <span class="hljs-function">(<span class="hljs-params">response: <span class="hljs-built_in">any</span></span>) =&gt;</span> <span class="hljs-built_in">void</span>;
    onUploadError?: <span class="hljs-function">(<span class="hljs-params">error: <span class="hljs-built_in">any</span></span>) =&gt;</span> <span class="hljs-built_in">void</span>;
  }) =&gt; {
    <span class="hljs-keyword">const</span> formData = <span class="hljs-keyword">new</span> FormData();
    formData.append(<span class="hljs-string">"file"</span>, file);

    uploadRef.current = <span class="hljs-keyword">new</span> XMLHttpRequest();
    uploadRef.current.open(<span class="hljs-string">"PUT"</span>, uploadURL);
    uploadRef.current.upload.addEventListener(
      <span class="hljs-string">"progress"</span>,
      <span class="hljs-function">(<span class="hljs-params">{ loaded, total }</span>) =&gt;</span> {
        setUploadProgress((loaded * <span class="hljs-number">100</span>) / total);
      },
    );    
    uploadRef.current.send(formData);

    uploadRef.current.onload = <span class="hljs-keyword">async</span> () =&gt; {
      <span class="hljs-keyword">const</span> response = uploadRef.current?.response;
      <span class="hljs-keyword">if</span> (response) {
        <span class="hljs-keyword">const</span> jsonResponse = <span class="hljs-built_in">JSON</span>.parse(response);
        uploadRef.current = <span class="hljs-literal">null</span>;
        onUploadComplete(jsonResponse.data || jsonResponse);
      }
    };
    uploadRef.current.onerror = <span class="hljs-keyword">async</span> () =&gt; {
      <span class="hljs-keyword">const</span> error = uploadRef.current?.response;
      <span class="hljs-keyword">if</span> (onUploadError) {
        onUploadError(error);
      }
    };
  }

  <span class="hljs-keyword">return</span> {
    uploadImage,
    uploadProgress
  }
}
</code></pre>
<p>This looks pretty good but there are still some edge cases left that we need to cover. Firstly, what if the component calling this hook unmounts in the middle of the upload? We should abort the request in that case or it might lead to issues like a memory leak or something else, right?<br />Also, it would be better to wrap our function in a useCallback hook to cache our function between re-renders.<br />So the final code would look like this:</p>
<pre><code class="lang-typescript"><span class="hljs-keyword">import</span> { useRef, useState, useEffect } <span class="hljs-keyword">from</span> <span class="hljs-string">"react"</span>;

<span class="hljs-keyword">export</span> <span class="hljs-keyword">const</span> useUploadImage = <span class="hljs-function">() =&gt;</span> {
  <span class="hljs-keyword">const</span> [uploadProgress, setUploadProgress] = useState(<span class="hljs-number">0</span>);
  <span class="hljs-keyword">const</span> uploadRef = useRef&lt;XMLHttpRequest | <span class="hljs-literal">null</span>&gt;(<span class="hljs-literal">null</span>);

  useEffect(<span class="hljs-function">() =&gt;</span> {
    <span class="hljs-keyword">return</span> <span class="hljs-function">() =&gt;</span> {
      <span class="hljs-keyword">if</span> (uploadRef.current) {
        uploadRef.current.abort();
      }
    };
  }, []);

  <span class="hljs-keyword">const</span> uploadImage = useCallback(
    <span class="hljs-keyword">async</span> ({
      file,
      uploadURL,
      onUploadComplete,
      onUploadError,
    }: {
      file: File;
      uploadURL: <span class="hljs-built_in">string</span>;
      onUploadComplete: <span class="hljs-function">(<span class="hljs-params">response: <span class="hljs-built_in">any</span></span>) =&gt;</span> <span class="hljs-built_in">void</span>;
      onUploadError?: <span class="hljs-function">(<span class="hljs-params">error: <span class="hljs-built_in">any</span></span>) =&gt;</span> <span class="hljs-built_in">void</span>;
    }) =&gt; {
      <span class="hljs-keyword">const</span> formData = <span class="hljs-keyword">new</span> FormData();
      formData.append(<span class="hljs-string">"file"</span>, file);

      uploadRef.current = <span class="hljs-keyword">new</span> XMLHttpRequest();
      uploadRef.current.open(<span class="hljs-string">"PUT"</span>, uploadURL);
      uploadRef.current.upload.addEventListener(
        <span class="hljs-string">"progress"</span>,
        <span class="hljs-function">(<span class="hljs-params">{ loaded, total }</span>) =&gt;</span> {
          setUploadProgress((loaded * <span class="hljs-number">100</span>) / total);
        },
      );
      uploadRef.current.send(formData);

      uploadRef.current.onload = <span class="hljs-keyword">async</span> () =&gt; {
        <span class="hljs-keyword">const</span> response = uploadRef.current?.response;
        <span class="hljs-keyword">if</span> (response) {
          <span class="hljs-keyword">const</span> jsonResponse = <span class="hljs-built_in">JSON</span>.parse(response);
          uploadRef.current = <span class="hljs-literal">null</span>;
          onUploadComplete(jsonResponse.data || jsonResponse);
        }
      };
      uploadRef.current.onerror = <span class="hljs-keyword">async</span> () =&gt; {
        <span class="hljs-keyword">const</span> error = uploadRef.current?.response;
        <span class="hljs-keyword">if</span> (onUploadError) {
          onUploadError(error);
        }
      };
    },
    [],
  );

  <span class="hljs-keyword">return</span> {
    uploadImage,
    uploadProgress
  }
}
</code></pre>
<p>This hook can be extended to also support video uploads, let me know if you want me to make a part 2 with that. I hope you found this helpful, would love to hear your thoughts and suggestions in the comments. Have a bug-free day.</p>
]]></content:encoded></item><item><title><![CDATA[Demystifying useRef hook.]]></title><description><![CDATA[Learn about ref attributes and React useRef hook in detail.]]></description><link>https://blog.exploreraadi.com/demystifying-useref-hook</link><guid isPermaLink="true">https://blog.exploreraadi.com/demystifying-useref-hook</guid><category><![CDATA[React]]></category><category><![CDATA[HTML5]]></category><category><![CDATA[JavaScript]]></category><dc:creator><![CDATA[Aditya Raj]]></dc:creator><pubDate>Wed, 13 Apr 2022 05:19:56 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/unsplash/f2LYxnmnKxI/upload/v1649779664866/fB3JVHTGe.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Before diving into useRef() hook, we should first understand what refs are. As per the definition from ReactJS official docs</p>
<blockquote>
<p>Refs provide a way to access DOM nodes or React elements created in the render method.</p>
</blockquote>
<p>Let’s look at what react docs meant by “a way to access DOM nodes”.</p>
<p>Assume we have an input tag and we pass a variable named inputRef to its ref attribute  <code>&lt;input ref={inputRef} /&gt;</code>. The purpose of this attribute is to make the input element selectable so that we can access its values, change styles, add animations, etc. This might seem familiar with the HTML id attribute because ids give us access to DOM nodes too. So, how are refs different then?
Well, the difference arises when we want to reuse the same component multiple times with different prop values as I have shown below:
<img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1648991934057/3ArPMLeFM.png" alt="idExample.png" /></p>
<p>I have used <code>id</code> to change the style property here but when you run this code, you will see that the input border color for all three<code>&lt;Demo/&gt;</code> components changes to blue because that is what I have passed as a prop in the last declaration. But if we were to use ref here then all the three components will render different border colors as received in their props because ref exists only in the scope of that component. This unique ability of refs to access and manipulate DOM nodes without messing with the entire DOM tree is what sets it apart from the HTML id attributes.</p>
<p>Now let’s take a look at that inputRef variable we passed earlier.
Do we define any variable and pass it to the ref just like that? No, because that will just get reset when the component will re-render.
This is where the hook useRef() comes into the picture.
Calling this react hook returns a mutable object with a <code>.current</code> property which is initialized with whatever argument we passed as its initial value.</p>
<p>When we pass this object as ref to a DOM node as we did with our input element then React will set its <code>.current</code> property to the corresponding node.</p>
<p>There are a bunch of things you can do after targeting a node once the DOM loads like adding some animation or other styles. It comes in handy when using third-party DOM libraries in your code.
<img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1648992005948/tEmjZuYdi.png" alt="domRef.png" /></p>
<p>Now let’s look at another popular use case of this hook. The mutable object that useRef() returns persists through the entire lifetime of the component which means no matter how many times the component re-renders due to state changes, the <code>.current</code> property value won’t change (unless we explicitly do it).
This makes it perfect to store any value which we want to persist through re-renders and can also be used for if/else conditions without being worried about it being affected by state changes. Here is an example:</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1648992681009/8nzCTXCGr.png" alt="valueRef.png" /></p>
<p>Hope this small article helped you clear some of the doubts you had with ref attributes and the useRef() hook.</p>
]]></content:encoded></item><item><title><![CDATA[Lessons from my first software engineering job.]]></title><description><![CDATA[My name is Aditya and I am a College dropout currently building the future of commerce at Plaza with some really smart and driven people. I got my first…]]></description><link>https://blog.exploreraadi.com/lessons-from-my-first-software-engineering-job</link><guid isPermaLink="true">https://blog.exploreraadi.com/lessons-from-my-first-software-engineering-job</guid><category><![CDATA[jobs]]></category><category><![CDATA[newbie]]></category><category><![CDATA[Startups]]></category><category><![CDATA[Learning Journey]]></category><dc:creator><![CDATA[Aditya Raj]]></dc:creator><pubDate>Thu, 19 Aug 2021 04:03:09 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1629345324444/wYeYuxip3.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>My name is Aditya and I am a College dropout currently building the future of commerce at Plaza with some really smart and driven people.
I got my first job amidst the pandemic in 2020. <a target="_blank" href="https://blog.exploreraadi.com/developer-journey-of-a-failure-student">Link to my full story</a>. </p>
<p>Now moving on, I will share some rules that I developed during my first job to accelerate my growth. I will also share some of the screw-ups that I did which led me to develop these rules.</p>
<h3 id="rule-1-minimize-the-work-of-your-seniors">Rule #1: Minimize the work of your seniors</h3>
<p>I decided to follow my tech lead around on each of his tasks. Whenever he had a bug or a small feature for which he needed to do some digging, I used to take that up and ask him to continue with more important tasks. This constant need to save his time made me better at googling and coming up with solutions faster, which was exactly what I wanted.</p>
<h3 id="rule-2-learn-from-others-code">Rule #2: Learn from others code</h3>
<p>Every morning, I'd go through each of the JIRA tickets and then the PRs raised and understand the code. If there were too many, I'd go through the rest of them in the evening. This helped me understand the mistakes I was making in my code (since everyone else was more experienced than me) and also helped me understand the entire flow of the app in a much better way. Later on, I became so good that often I could guess the exact piece of code that caused a particular bug among 30+ components and many sub-components.</p>
<h3 id="rule-3-a-framework-to-save-time">Rule #3: A framework to save time</h3>
<p>My tech lead gave me this very good framework. He asked me to reach out to him if I was working on a bug and couldn't fix it in &lt; 2 hours or working on a feature and couldn't figure out how to go about it within an hour. Since it was a startup, we couldn't afford to lose any more time than that but even in such a constrained environment, he gave me enough freedom to tinker on my own and come up with solutions faster.</p>
<h3 id="rule-4-have-your-own-north-star">Rule #4: Have your own north star</h3>
<p>The team and especially my tech lead started relying more on me and let me wrap up many of the small features by myself end-to-end hence I had to come up with this rule so that I don't screw up the chances I was given. I had to start thinking about the overall app and how my changes would affect the end-user experience instead of just worrying about the code quality. As a Front-end Developer, I made the UX my north star instead of obsessing over best practices because making the correct trade-offs would've been very difficult if I didn't. Yes, I was still writing quality code (because any PR with a below A-rating would fail) but that was not my top priority.</p>
<p>These were the four rules that I developed with the help of my seniors and after a lot of trials and error.
One day while resolving code conflicts, I almost reverted the code for an entire feature pushed by my senior but somehow survived.
On some days, I'd even push the console log and debugger in my PRs and my tech lead would just laugh at these silly mistakes.
I still remember when I got my first feature request after ~2 months of hard-ass effort and I just went ahead and copy-pasted most of the code for that feature from google without understanding it much and somehow it worked but I was lucky to have a kind and helpful tech lead who helped me get better and never got angry even once despite me blowing up the code left and right many times. There is a lesson too in this story that if you are early in your career then look for companies that have helpful seniors instead of just a fat package (luckily enough, most companies with good devs have good packages but not always).</p>
<p>Hope you got something out of this article, may your day be bug-free :)</p>
]]></content:encoded></item><item><title><![CDATA[How to land Interviews at good startups?]]></title><description><![CDATA[I am Aditya, a Frontend developer currently building the future of e-commerce at Plaza. In 2019, I dropped out of college and dived into web development…]]></description><link>https://blog.exploreraadi.com/how-to-land-interviews-at-good-startups</link><guid isPermaLink="true">https://blog.exploreraadi.com/how-to-land-interviews-at-good-startups</guid><category><![CDATA[interview]]></category><category><![CDATA[Startups]]></category><category><![CDATA[Career]]></category><category><![CDATA[jobs]]></category><dc:creator><![CDATA[Aditya Raj]]></dc:creator><pubDate>Wed, 30 Jun 2021 04:42:53 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1624979461914/YAsa2A4D7.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>I am Aditya, a Frontend developer currently building the future of e-commerce at <a target="_blank" href="https://angel.co/company/plaza_tech">Plaza</a>. In 2019, I dropped out of college and dived into web development. Since then, I have landed multiple high-paying job offers at amazing startups. You can read my full journey <a target="_blank" href="https://blog.exploreraadi.com/developer-journey-of-a-failure-student">here</a>.</p>
<p>In this article, I will share a few ways that have helped me in landing good opportunities in tech and might help you:</p>
<ol>
<li><p><strong>Stop the resume game -</strong> 
I learned this from <a target="_blank" href="https://twitter.com/tanaypratap">Tanay</a> and <a target="_blank" href="https://twitter.com/VarunMayya">Varun</a> and it has been proven a very effective piece of advice for me. Resumes are becoming outdated nowadays because they don't showcase your skills properly especially when you're applying for the role of a designer or a developer. Instead, build a good portfolio website. Put all your projects, designs, case studies, etc in there. Also, start a blog and share everything you learn. It is a very good way to prove that you know how to articulate your thoughts well and can impress recruiters.</p>
</li>
<li><p><strong>Pick the right startup -</strong> This is a very important point that most people miss especially freshers. You will be spending a majority of your time working there so don't pick a startup you won't enjoy working at. But then the question arises, how to pick the right startup?
Here are a couple of things I would do to make a better choice.</p>
<ul>
<li><em>Doing a background check on founders:</em> What kind of industries have they worked in before? Are they serial entrepreneurs? How long have they been in the industry in which they launched their product? Remember, these are just some of the questions that I personally ask because I believe that a founder-market-fit is as important as a product-market-fit i.e. a founder who understands a particular market well enough is more likely to launch a successful product/service in that market.</li>
<li><em>Do a check on the startup:</em> What industry is that startup in? What is the problem they are trying to solve? Are they backed by good investors or are bootstrapped and making profits already? Are you interested enough in their product? Answering these questions is important because if you're not interested in the industry they are in and the problem they are trying to solve then you won't be able to give your 100% while working there and it will slow down your growth. Startups are the Disneyland of learning but they demand hard work.</li>
<li><em>Clarity of responsibilities:</em> What will you be exactly working on? Do you have seniors on your team or will you be calling all the shots? Are your roles limited to development only or will you be helping out the design team once in a while too (just an example)? Ask these questions to the recruiter because I believe If a startup can't provide clarity around your roles then that means they are not clear about them themselves and you might end up in a mess. Maybe they don't have experienced seniors or a proper chain of command at all. whatever the case, this is a red flag for me. </li>
</ul>
</li>
<li><p><strong>Try to stand out while applying -</strong> I have seen a lot of freshers who just go through a job portal, upload their resume, and start hitting apply to every single opening they come upon as if it was some kind of lottery instead of a job application. 
Instead, do everything mentioned in point 2 above and then think about how you can stand out while applying. If the other candidates are applying through job portals, you can try sending cold emails or Twitter DMs to the founders. If the others are doing that then you can create a 2-min video resume and then apply. If the others are doing that also then you can prepare a small presentation indicating the flaws in their products or in-depth market analysis or anything that shows you've put efforts into your research and then reach out.
And don't worry about screwing up or anything. Trust me, founders like such quirky ideas.</p>
</li>
<li><p><strong>Use Twitter well -</strong> I cannot stretch enough the importance of a good Twitter presence. I landed my first job through Twitter and that was totally unintentional. I used to document my journey, share whatever I learn either through tweets or threads and that's it. Being a good developer is no good if you are not visible to the recruiters and trust me, almost all of them are on Twitter. So put all your excuses aside and build a good profile there. Share your learnings, projects, blogs, etc there and see the magic happening.</p>
</li>
<li><p><strong>Check Crunchbase and other platforms for recently funded startups -</strong> This is advice that I picked up from a tweet and I have seen working for many people but never got to try personally so take it or ignore it. The idea is when a startup gets funding, they are more likely to hire new people, and a majority of the time, the openings will be for either of these three roles: Marketer, Developer or Designer (just an observation, might not be a fact) but there is always a delay between raising funding and posting for job openings. This delay is your window. Reach out to the founders with your offering and explain to them how you can be an asset for their company, how you've been tracking them for a while and your interest in their product/service. This not only increases your chances of getting hired (if they were actually looking to hire for that role you're offering) but also goes on to show your interest in the startup and trust me, founders love that in a potential hire.</p>
</li>
</ol>
<p>On the topic of landing Interviews, I'd just share how I landed my current job at Plaza because it's an interesting story.
I have been following Soaib for a while since I came upon his profile while searching the Internet to follow some good Indian VCs. Around March, when I started looking out for a new job, I got to know about his new startup and immediately applied but didn't hear back for two weeks. I thought they might not have found me suitable for the role so I moved on to apply at other places.
Fast forward to April, I was about to enter the final round of Interviews at smallcase when I received their email. I cleared the Interviews, talked to the team at Plaza, loved their product, and politely turned down one of my favorite companies to join here. Just two months in and still don't see a single reason to regret that decision.</p>
<p>I hope you loved the blog and here are some related links that you will find helpful.
<a target="_blank" href="https://reply.io/cold-email-whitepaper/">Cold email guide by Abhinav and Lee</a>.</p>
<p><a target="_blank" href="https://blog.exploreraadi.com/the-proper-way-to-ask-for-help-in-tech">An article on how to approach people in tech with some helpful tips</a>.</p>
]]></content:encoded></item><item><title><![CDATA[Developer Journey of a Failure Student]]></title><description><![CDATA[In 2018, when I passed out of high school, I did what most Indian high school grads from the science stream do. I took a year off to prepare for the JEE…]]></description><link>https://blog.exploreraadi.com/developer-journey-of-a-failure-student</link><guid isPermaLink="true">https://blog.exploreraadi.com/developer-journey-of-a-failure-student</guid><category><![CDATA[Learning Journey]]></category><category><![CDATA[Beginner Developers]]></category><category><![CDATA[webdev]]></category><dc:creator><![CDATA[Aditya Raj]]></dc:creator><pubDate>Sun, 13 Jun 2021 06:24:51 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1623564399306/Tx1ax1Qun.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>In 2018, when I passed out of high school, I did what most Indian high school grads from the science stream do. I took a year off to prepare for the JEE exam that can get me into an IIT.
But something strange happened in that one year. Along with preparations, I started experimenting with different skills on the side. I tried digital marketing, some sales, UI/UX design and Web development.
As a result, I failed to crack the JEE and went through a rough month of anxiety, self-doubt, disappointment, everything else that society forces you to feel when you fail at something you were not supposed to (according to them).</p>
<p>However, I continued to venture into different things. I then got in touch with  <a target="_blank" href="https://twitter.com/VarunMayya">Varun Mayya</a>  (CEO at Scenes by Avalon) who then introduced me to another gentleman,  <a target="_blank" href="https://twitter.com/tanaypratap">Tanay Pratap</a>  (Senior Engineer at Microsoft) and both of them helped me see my career with a fresh pair of glasses. I was convinced that a college degree wasn't a necessity to do great things in life or make big sums of money, especially for those who can write code - thanks to the Internet. Tanay also helped me narrow down my focus to Front-end development because of the increasing demand for front-end developers and relatively low entry barrier.</p>
<p>At around the same time, I was admitted to XYZ College in Bangalore. I still remember the day when I was returning to Patna with the college admission letter in my hand. Seeing so many zeroes on the letter made me cry on the inside however my father didn't flinch even after knowing that the fee was more than half of his annual income. In that 48-hour train journey, I started running multiple scenarios in my head with all the data I had gathered thanks to my research and Tanay and imagined the worst thing that could happen if I dropped out and realized the worst-case didn't scare me enough so I dropped out. But then came the next phase - convincing parents.</p>
<p>I took the straightforward approach and asked my father to give me one year's worth of expenses to stay in Bangalore and if I hadn't figured out what I wanted to pursue and failed to show any result by the end of that year, I had promised to return and do/study whatever they wanted me to. For the next 4 months, I hardly stepped outside of my small room. NO, I didn't write code for 12 hours a day. I watched web series and wasted quite a lot of time too but rarely skipped coding. I stayed consistent with my efforts whether it was 2 hours a day or 10. (Thanks to Tanay's job challenge).</p>
<p>After building a couple of okay-ish(so-so/mediocre) projects, I started looking for freelance gigs. Tried Upwork, freelancer and some personal connections too. Finally, I did get a few gigs and completed them(mostly unpaid or paying peanuts).
Five months down the line, I realized how hard it is to work alone. I wanted to work with smart and kind people from whom I can learn. Around that same time, I was very active on Twitter and shared every little thing I learned or doubts I had. Fortunately, I caught the eye of a senior developer,  <a target="_blank" href="https://twitter.com/theHumbleBeing">Ishwar Rimal</a>, whom I approached for some help in one of my projects. He was and is by far the kindest, patient and hardworking person I've ever met and I still remember his lines when he hired me, "I like your energy, we could use someone like you on our team and don't worry about your skills, You'll get better with time."</p>
<p>Ten months since that conversation with my father, I finally had a job (a very narrow escape). Ishwar became the mentor I probably didn't deserve and helped me gain that boost I needed early on in my career. Fast forward to April 2021, I had two offer letters, each paying 15 LPA and a senior developer ready to create a new opening for a front-end role on his team for me.
It has been almost 2 years now since I took the biggest decision of my life and today I make more in a year than the entire 4-year fee of that college combined.</p>
<p>Was it scary? Yes.
Did I get help from a lot of people? Yes.
Did I work hard? Not like Elon but Yes.
Did I get lucky at multiple phases? Absolutely Yes.
Does this take courage? Lot more than you think.</p>
<p>My point of sharing this journey is not to encourage anyone to drop out or anything but to just remind you that before jumping on any career bandwagon, try to assess your decision from all possible angles. Take the help of people who've done well in those aspects of life and please gather some courage to be ready to go against the norm. Even lady luck helps those who have the courage to at least try. 
Trust me, there is a big difference between how you assume things will end up and how they actually end up in life.</p>
]]></content:encoded></item><item><title><![CDATA[How to create a React library to publish on npm ?]]></title><description><![CDATA[In this article, I will go through the entire process of creating a reusable component and publishing it on npm for other developers to use. This article…]]></description><link>https://blog.exploreraadi.com/how-to-create-a-react-library-to-publish-on-npm</link><guid isPermaLink="true">https://blog.exploreraadi.com/how-to-create-a-react-library-to-publish-on-npm</guid><category><![CDATA[library]]></category><category><![CDATA[npm]]></category><category><![CDATA[package]]></category><category><![CDATA[React]]></category><category><![CDATA[Node.js]]></category><dc:creator><![CDATA[Aditya Raj]]></dc:creator><pubDate>Sun, 21 Feb 2021 13:58:41 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1613910150438/Mth5qnVL3.webp" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>In this article, I will go through the entire process of creating a reusable component and publishing it on npm for other developers to use.</p>
<p>This article assumes that you already have a component to publish but if you don't then just create a simple button component or something to test your understanding once you finish reading this. I have tried to keep this article easy to follow for beginners with less technical jargons to help you quickly launch your package so let's get started.</p>
<p>Firstly, <strong>what is a reusable component?</strong>
I will use an interesting analogy to make sure you never have to look up for its definition again.</p>
<blockquote>
<p>Imagine a pond of water with a caretaker whose only job is to help people catch fishes easily from the pond or dump their wastes into it. A reusable component is just like that pond and the caretaker is our props, the fishes coming out of the pond or the waste going into it is the data that we pass or fetch using props. That's it.</p>
</blockquote>
<p>Now I will take you through the steps involved in this whole process. These are the steps that I created for myself while planning for the project and I urge everyone working on their projects to first think about the whole process and break it down into small steps because that will help you measure your progress as well as boost your morale as you move forward. I consider programming as no less than a battlefield and it is very easy to drop your weapons and surrender here when things get rough, especially when you are a beginner. That's why having checkpoints in your path is important. Let's move onto the steps now:</p>
<h3 id="creating-the-component">Creating the component:</h3>
<p>The first part is to actually write the code for the component and test it out. My first npm package was a simple drag and drop component and since it was not a lot of work as I just needed few event listeners to listen for drag and drop event and then callbacks to handle those events, I went ahead to write a sample code with <a target="_blank" href="https://codesandbox.io/">codesandbox</a>. It is a great tool if you want to avoid the hassle of creating react boilerplates just to create and test a simple component. But if you want to use your code editor from the beginning then I would need you to first create a react boilerplate then a folder named "component" in the src directory and put your component code in it. Then clean your parent component (the app.js file in src) and import the component you created. Check if it is working as expected.</p>
<h3 id="passing-data">Passing data:</h3>
<p>The next step was to think about how I would receive some data from the user. I am sure you already know how to do that. Yes, I am talking about props but we don't simply use that here as we do normally in our projects. We first import a package called <a target="_blank" href="https://www.npmjs.com/package/prop-types">prop-types</a> to declare the types of props that will be passed in  our component. Here is how I used it in my component to give you an idea. </p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1613891674401/yQbfeJNeO.png" alt="Code-snippet" /></p>
<p>If you are familiar with typescript then you might already understand what I did here. Typechecking your props like this makes sure that only the data-type you declared can be passed as props else will throw an error in the developer's console.
This is helpful because suppose you built a big and complex library but those who are using it in their projects don't know the data-type they are supposed to pass as props and hence might pass the wrong ones making your library to behave unexpectedly while they won't know what they did wrong (Example- Your library expected a string as props but received an object instead). Here's a great <a target="_blank" href="https://medium.com/@stevenpaulino1/typechecking-with-react-proptypes-6c8f46d78b8a#:~:text=Props%20are%20vital%20for%20passing,behave%20as%20expected%20or%20effectively.">article</a> if you're interested to learn more about prop-types.</p>
<h3 id="fetching-data">Fetching data:</h3>
<p>Now comes the third part which is fetching data from the library i.e. returning some data to the user. In my drag and drop files, I had to return the dropped files and believe me, despite being so simple, it took me a while to realize because I thought there might be some other magic trick to do that but there wasn't. I just had to pass a callback as props to my component the way we normally do anywhere in react which will carry the data back to the parent. simple, right? So if you scroll back to the code in the image above, you'll see that I am receiving a callback as a prop named <em>getFiles</em> for the same. One more thing, that <em>isRequired</em> at the end in our propTypes is added to indicate that without passing that prop, our component won't work as expected. There are other props that are passed as optional in which case, you don't need to add <em>isRequired</em> in the end when declaring their types.</p>
<h3 id="publishing-the-component">Publishing the component:</h3>
<p>The last step is to actually minify the code to publish but since I had little idea about webpack or anything, I followed <a target="_blank" href="https://medium.com/groftware/how-to-publish-your-react-component-on-npm-9cf48d91944d">this article</a> by Chan. It gives you a boilerplate with all the fine tuning already done to the files to publish on npm. Just replace the src files with yours, change the project name in package.json and webpack, create a build and publish it. Volla! easy peasy. I know you might be wondering, "But this is like a shortcut, where are the detailed steps for publishing?" and you are right but my friend if you're publishing a package or building any new kind of project for the first time then your primary goal should be just completing it as soon as you can. Remember I earlier mentioned that programming is no less than a battlefield and in a battlefield, winning with minimum casualties is the primary goal. And that was our motive too in this article, to complete and publish our library without dying i.e. losing motivation in the middle. You can always go and dive deep into publishing a package or what goes under the hood when npm publishes our package? how does webpack work? etc. But for now, this is enough.</p>
<p>And if you continued this far then here is a bonus. In the image I shared above, you will see I imported something called <em>useDropy</em> but what is that? They are called <strong>custom hooks</strong> in React (give yourselves a pat on your back if you already knew). Let me explain what this is with a simple example. Take any of your component files and instead of returning the JSX at the end, return some value like you do in a normal JavaScript function and that's it, that has now become a custom hook which can be imported anywhere in your project to fetch that data being returned. In react's language, </p>
<blockquote>
<p>Building your own Hooks lets you extract component logic into reusable functions.</p>
</blockquote>
<p>That can save you from the pain of prop-drilling and will help you keep your code clean. You can read more about them <a target="_blank" href="https://reactjs.org/docs/hooks-custom.html">here.</a> 
To checkout my first drag and drop library that I published on npm, <a target="_blank" href="https://www.npmjs.com/package/dropy">click here</a>.
I hope you liked the article, wish you all the best.</p>
]]></content:encoded></item><item><title><![CDATA[What are the easiest ways to deploy web apps as a beginner ?]]></title><description><![CDATA[Did you recently start learning web development and made your first or second web app but are now confused about how and where would you deploy it? Then…]]></description><link>https://blog.exploreraadi.com/what-are-the-easiest-ways-to-deploy-web-apps-as-a-beginner</link><guid isPermaLink="true">https://blog.exploreraadi.com/what-are-the-easiest-ways-to-deploy-web-apps-as-a-beginner</guid><category><![CDATA[hosting]]></category><category><![CDATA[Beginner Developers]]></category><category><![CDATA[tips]]></category><dc:creator><![CDATA[Aditya Raj]]></dc:creator><pubDate>Sun, 20 Dec 2020 06:43:04 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1608446541254/RxgbVBq9K.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Did you recently start learning web development and made your first or second web app but are now confused about how and where would you deploy it?
Then this article is for you.</p>
<p>I have tried to keep this extremely short to let you know just enough to get started quickly as I too understand the excitement of hosting your first few projects on the web.
Though there are tons of options out there ( both free and paid ) still we will be mainly looking at the two most popular and free ones:</p>
<ol>
<li><p>Heroku – It is a platform that lets developers deploy, manage, scale web apps. It provides its own CLI which lets you use your terminal to track changes or deploy your code directly to Heroku after logging in. They provide a detailed and step by step guide for beginners as soon as you sign up and set up your account.
But if you still want to read their documentation in detail then click here</p>
</li>
<li><p>Vercel – Vercel is also a platform to deploy and manage your web apps but the front-end part only. Though the steps are very easy. You just need to connect your Github account with Vercel and then choose the repository which has the project you wish to deploy. Once added, it will also keep track of any changes you’ll do in your master branch and will keep re-deploying the app with those changes. Just visit Vercel and follow the steps.</p>
</li>
</ol>
<p>After looking at the options, let us look at their use cases.
I use Heroku to launch my node apps or any other backend I build and Vercel for my static sites or front-end of my apps.
Now, if you’re looking to deploy a Fullstack app you might ask, “Why to deploy the front-end and backend separately? Why not host everything in one place ?”</p>
<p>The answer is simple. In a Fullstack app (where you are using some framework for your front-end), you need to run two commands, one for your front-end like npm start in case of React and one for your backend like node index.js but platforms like Heroku can not run both of these commands simultaneously on the same host whenever you visit your app's link. Hence we deploy our backend seperately and use that link to connect it to our frontend (you can use fetch functions or axios for that).</p>
<p>Though this was a very brief article still I hope that I cleared the most basic stuffs required to deploy your app without confusing you much.
Wish you all the very best, Happy Coding.</p>
]]></content:encoded></item><item><title><![CDATA[The proper way to ask for help in tech.]]></title><description><![CDATA["I didn’t hear back from him. Just because they are good at something doesn’t mean they should be arrogant, right?" No, they shouldn’t and maybe they…]]></description><link>https://blog.exploreraadi.com/the-proper-way-to-ask-for-help-in-tech</link><guid isPermaLink="true">https://blog.exploreraadi.com/the-proper-way-to-ask-for-help-in-tech</guid><category><![CDATA[Beginner Developers]]></category><category><![CDATA[tech ]]></category><category><![CDATA[tips]]></category><dc:creator><![CDATA[Aditya Raj]]></dc:creator><pubDate>Sat, 19 Dec 2020 10:57:59 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1608375383922/T9X0G6lpH.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>"I didn’t hear back from him. Just because they are good at something doesn’t mean they should be arrogant, right?"
No, they shouldn’t and maybe they aren’t. Hear me out first.</p>
<p>We, the beginners who are just starting out on our journey in the field of Information Technology tend to be impatient and naïve initially (specially the teenagers). We get fascinated by this industry and its potential but we often don’t know from where to start or are simply lost. So, tell me what do you do when you get lost on a path? You ask for help from those who’ve walked down that road before you, right? This is where the real problem begins.</p>
<p>We don’t have the slightest idea about how to approach a professional to ask queries or for suggestions and feedback. No one talks about this issue and there are barely any good articles on that but the real question is, can there be a proper guide on how to approach someone or be more social?</p>
<p>Well in my opinion, there can’t be. Because we humans, by nature, are social. Teaching us the same is like teaching a fish how to swim. We don’t need that but the noise of social media around, has actually made us less social, dulled our senses and made us forget the core value of being a human being. We like to be empathetic in front of our mobile screens but not in reality. We don’t value time, neither ours nor others or else these things would’ve been much simpler.</p>
<p>Just think about it.
You are reaching out to someone for help who is really good at what they do which means two things:</p>
<p>They’ll be humble but busy. So just introduce yourself formally, tailor your questions well, be honest and respectful of their time and have some patience for the reply and woosh! You’re done. Was it hard? No. But we still don’t do it. Why? I answered that above.</p>
<p>Sorry if it was too much but I just wanted to explain the problems to you well before sharing some ways to fix them and if you read it till here then I won’t disappoint you now. These are some basic mistakes that I’ve seen beginners make and how to avoid them to increase your odds of getting a response. Here we go:</p>
<ol>
<li><p>Don’t start with greetings or wait for a reply to ask your queries: This point needed to be at the top as I see most of the professionals being annoyed by the “Hi” and “Hello” messages or smaller chunks of messages with no clear question or subject. Please don’t do that. Do you really think they have the time for a chit chat with you? No.
So just get to the subject of message and no, they won’t find it rude but would be happy instead that you valued their time.</p>
</li>
<li><p>Do your research and structure your question well: A half-baked message won’t get you a reply making you angry at the end and see them as arrogant (as I mentioned in the start). Trust me they are not arrogant (at least most of them aren’t). They just have a limited amount of time so make sure you have done some research and structured your message well to better your odds. This also shows that you’re serious about what you are asking and not texting them on a whim.
A line by Eminem wraps up this point very well,
"You only got one shot, do not miss the chance to blow"</p>
</li>
<li><p>Be patient: As I stated before that as beginners, we are impatient but sometimes it might happen that you won’t hear back from them for days and there can be multiple reasons for that. They either missed it as they receive 100s or 1000s of such messages everyday or they marked it for later or maybe something else. Be a bit empathetic, try to understand their reasons as well and reach out again after some days or tag them in your post asking for help if you follow them. (Most of them are pretty active on twitter.)</p>
</li>
<li><p>Be grateful and form connections: Don’t be mean and have an exit as soon as you got the help you needed or else it may damage their motivation to help your peers. Thank them properly and execute their advice. Reach out to them again shortly and show your progress. Trust me, they’d be more than happy to see that and it might register your name in their head and that is the best thing you can do because these people are certainly worth sharing a good bond with.</p>
</li>
</ol>
<p>Here’s an example on reaching out for help with open-source:</p>
<p>“Needed help with Open-source.
Aditya from this side. I’ve been learning web development for few months now and have also built decent projects with react.js and finally decided to contribute to the open-source to level up my skills or land a good job but the huge codebase overwhelms me and no amount of YouTube tutorials really focuses on the extreme beginner stuffs so reaching out to you as I’ve been following you for a while and have seen you posting about your open-source contributions. Would really appreciate your guidance and suggestions.”</p>
<p>I included the subject at the top because the first two lines of your message are what they see before even opening it (wise move, right?) and all of this in one single message. No smaller chunks, no extra cheesy stuffs, nothing.</p>
<p>Now a personal opinion before dropping the curtains:
Always help others with those handful of things you learned. You don’t need to be perfect or solve their problem completely but even a small help with the right intention goes a long way and who knows you might get a 100x return on that because "law of karma" exists, doesn't it?</p>
]]></content:encoded></item></channel></rss>