<?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:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Kanishk Agrawal on Medium]]></title>
        <description><![CDATA[Stories by Kanishk Agrawal on Medium]]></description>
        <link>https://medium.com/@agrawalkanishk3004?source=rss-e0d4557e59b1------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/2*CkM5GlbENkl0RFrQ5DYQPA.jpeg</url>
            <title>Stories by Kanishk Agrawal on Medium</title>
            <link>https://medium.com/@agrawalkanishk3004?source=rss-e0d4557e59b1------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 15 Nov 2026 04:49:03 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@agrawalkanishk3004/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[I Don’t Write Code Now — And That’s the Point]]></title>
            <link>https://medium.com/@agrawalkanishk3004/i-dont-writecode-now-and-that-s-the-point-0fd916fc0461?source=rss-e0d4557e59b1------2</link>
            <guid isPermaLink="false">https://medium.com/p/0fd916fc0461</guid>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[frontend]]></category>
            <category><![CDATA[code-review]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[vibe-coding]]></category>
            <dc:creator><![CDATA[Kanishk Agrawal]]></dc:creator>
            <pubDate>Sun, 22 Mar 2026 11:35:43 GMT</pubDate>
            <atom:updated>2026-03-22T11:39:45.640Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TY-CL-fPLVPkSl47Nv2_-g.png" /><figcaption>Credits: Gemini</figcaption></figure><p><em>*How AI changed my job from writing code to reviewing it, and why that’s the biggest culture shift I have seen.*</em></p><p>I’m a software engineer at LinkedIn. I build Observe — our unified observability platform that consolidates metrics, alerting, SLOs, tracing, logging, profiling and incident management into a single UI. It’s a React + TypeScript + MobX frontend backed by a Go API, and it’s the kind of complex, high-stakes codebase where a bad merge can blind engineers to production incidents.</p><p>Not long back, hardly few months ago, I spent most of my time writing code. Today, I spend most of it reviewing it. Not because I got lazy — because the code is being written by AI, and my job shifted to something harder: making sure it’s <em>*right*</em>.</p><p>This is what that looks like in practice.</p><p>- -</p><p><strong>## The Loop Changed</strong></p><p>The old loop was: think → write → test → PR → review feedback → iterate.</p><p>The new loop is: think → prompt → review → refine → prompt again → review harder → ship.</p><p>Notice what moved to the center: <strong>**review**</strong>. I went from being the author who occasionally reviews peers’ work, to being a full-time reviewer who occasionally writes a prompt. On most days, I write more review comments than lines of code.</p><p>And here’s the thing nobody tells you: reviewing AI code is <em>*harder*</em> than reviewing human code.</p><p>When a colleague sends a PR, I can pattern-match against their style. I know their tendencies — Eg. John over-abstracts, Jane forgets edge cases, Mark writes beautiful code but skips tests. AI has no personality to pattern-match against. Every PR looks competent, complete, nearly perfect. The code compiles, the tests pass, the variable names are reasonable. But underneath, it might be solving the wrong problem, using the wrong pattern, or introducing a subtle dependency that’ll bite us in three months.</p><p>So I had to get systematic about it.</p><p>- -</p><p><strong>## Teaching the Machine What “Good” Looks Like</strong></p><p>The breakthrough wasn’t just getting better at prompting. It was <strong>**encoding our standards into files the AI reads before every task.**</strong></p><p>We have three layers:</p><p>1. <strong>**Always-on rules**</strong> — files that load into every AI session automatically. Things like “no console.log — use structured telemetry”, “prefer CSS variables over preprocessor variables”, “never bypass pre-commit hooks.”</p><p>2. <strong>**Task-specific skills**</strong> — detailed playbooks for specific workflows. When the AI needs to write a unit test, it reads our testing skill. When it creates a PR, it reads our PR skill. These aren’t vague guidelines — they’re precise, opinionated instructions with good/bad examples.</p><p>3. <strong>**Architecture docs**</strong> — the AI reads our architecture file to understand how the application is structured, where services live, what patterns we use.</p><p>The result? The AI’s first draft is already 80% aligned with our conventions. My review work dropped from “rewrite this” to “adjust this.”</p><p>Let me show you what these look like in practice.</p><p>- -</p><p><strong>## Skill #1: The PR Review Playbook</strong></p><p>We wrote a skill that acts as an automated code reviewer. It knows our testing anti-patterns — things like mocking at the wrong layer, using brittle CSS selectors in E2E tests, or relying on hardcoded waits instead of proper assertions. It knows our backend conventions — where business logic should live, how errors should be structured, what good observability instrumentation looks like.</p><p>Every rule in that skill exists because we shipped a bug or wasted a review cycle. One mocking pattern alone caused three broken PRs before we encoded the fix. Now the AI catches it before I even see the code.</p><p>If you’re repeating yourself to the AI, stop repeating and start encoding. Turn your tribal knowledge into a file the AI reads on every task.</p><p>- -</p><p><strong>## Skill #2: The “Minimum Change” Philosophy</strong></p><p>This is the rule I enforce most during reviews: <strong>**only make changes that are directly requested or clearly necessary.**</strong></p><p>AI <em>*loves*</em> to over-engineer. Ask it to fix a null check, and it’ll refactor the entire component, add error boundaries, create a utility function, and write documentation for a helper nobody asked for. A bug fix doesn’t need surrounding code cleaned up. Three similar lines of code are better than a premature abstraction. Don’t add error handling for scenarios that can’t happen. Don’t create helpers for one-time operations.</p><p>We encoded all of this into our project-level instructions so the AI reads it before every task. The most common review comment I still write is: “Revert this — it’s not what we asked for.” But it went from every PR to maybe one in five.</p><p>Senior engineering isn’t about writing sophisticated code. It’s about knowing when simple code is the right answer.</p><p>- -</p><p><strong>## What I Actually Look For Now</strong></p><p>My review checklist for AI-generated code is different from my checklist for human code:</p><p><strong>**1. Does it reuse what exists?**</strong></p><p>AI has a tendency to create new utilities when perfectly good ones already exist three directories away. I check if there’s an existing function, hook, or component that does the same thing.</p><p><strong>**2. Is it the minimum change?**</strong></p><p>Did it touch files it didn’t need to? Did it add type annotations to code it didn’t change? Did it sneak in “improvements” to neighboring code? Every unnecessary change is a risk surface and a review burden.</p><p><strong>**3. Does it follow the unwritten rules?**</strong></p><p>Every codebase has conventions that aren’t in the docs — store patterns, service layer idioms, CSS conventions. AI gets these right <em>*only if*</em> we’ve encoded them. When it doesn’t, that’s a signal to write a new rule.</p><p><strong>**4. Would a new team member understand this?**</strong></p><p>AI code often has an “uncanny valley” quality — it looks right but feels off. Variable names are reasonable but not what a human would choose. The control flow is correct but not idiomatic. I optimize for readability by someone who’ll maintain this in six months.</p><p><strong>**5. What did it change that I didn’t expect?**</strong></p><p>I always check the diff summary first. If task description asked for a 3-file change and see 12 files modified, something went wrong. Start with the unexpected files.</p><p>- -</p><p><strong>## What I Got Wrong Early</strong></p><p><strong>**Trusting “it compiles” as a quality signal.**</strong> AI code almost always compiles and passes basic tests. That’s table stakes, not quality. The bugs are in the design choices, not the syntax.</p><p><strong>**Not investing in skills early enough.**</strong> For months, I wrote ad-hoc prompts. Every session started from scratch, and I repeated the same corrections. The moment I started encoding rules into files, my review burden dropped by half.</p><p><strong>**Reviewing AI code the same way as human code.**</strong> Human PRs have intent you can read between the lines. AI PRs have no intent — they’re executing a prompt. Review the prompt <em>*and*</em> the output. If the skill is wrong, fixing individual outputs is whack-a-mole.</p><p>- -</p><p><strong>## The Uncomfortable Truth</strong></p><p>Here’s what I’ve come to believe: the hard part of software engineering was never typing the code. It was knowing what to build, how it should work, and whether the result is good enough to ship.</p><p>AI made the typing part nearly free. What it didn’t change — what it <em>*can’t*</em> change — is the judgment layer. Is this the right abstraction? Is this change safe to ship? Will this scale? Will the next engineer understand it?</p><p>That’s what senior engineering is now: taste, judgment, and the discipline to enforce standards at scale. The engineers who thrive aren’t the fastest coders. They’re the fastest <em>*reviewers*</em> — the ones who can look at AI-generated code and, in minutes, decide whether it’s solid or subtly wrong.</p><p>I write less code now. And that’s the most senior thing I’ve ever done.</p><p>- -</p><p><em>*Next up: I’ll write about how to build these “skills” — the machine-readable rules that teach AI agents your team’s standards. Stay tuned.*</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0fd916fc0461" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How should a promotion doc be?]]></title>
            <link>https://medium.com/@agrawalkanishk3004/how-should-a-promotion-doc-be-da996306a86e?source=rss-e0d4557e59b1------2</link>
            <guid isPermaLink="false">https://medium.com/p/da996306a86e</guid>
            <category><![CDATA[jobs]]></category>
            <category><![CDATA[career-advice]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[tech]]></category>
            <category><![CDATA[career-development]]></category>
            <dc:creator><![CDATA[Kanishk Agrawal]]></dc:creator>
            <pubDate>Tue, 27 Jun 2023 14:22:53 GMT</pubDate>
            <atom:updated>2023-06-27T14:51:27.056Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/382/1*N5WV7A_YaUwgCK47Rjhu2A@2x.jpeg" /></figure><p>Hi, it’s been a while.</p><p>Today, I want to talk about how to go about writing a promotion document at a tech company.</p><p>A developer’s life is a full cycle with all types of work, ranging from BAU feature development asks to keep the business running, KTLO/Oncall, critical security tasks, platform maintenance, and even trivial work such as changing the color from red to blue.</p><p>Over a 1–2 year period, it is crucial to get your work recognized. Everyone likes to be rewarded in the form of appreciation, promotion, or increased pay. In practice, it gets complicated as some work has high impact but low visibility, while some work involves just a few lines of code but has a huge impact on the business. It is natural to forget or not mention fuzzy work done over the cycle.</p><p>I’ll discuss the template one can follow to create performance review document and how to go about structuring it.</p><h3>1. Goals agreed for the last cycle</h3><p>You need to align your focus areas for the upcoming year or cycle that you’re aiming for. Agreement needs to happen between you and your manager on the expectations from the current and next role. This way, there would be no surprises at the end of the cycle. Depending on the seniority of the role, goals should have a proper mix of business asks, KTLO, making Oncall process easier, platform, alerting/monitoring, identifying and fixing tech debts, web performance, knowledge sharing with the group, mentorship, library upgrades, etc. These are just some things on top of my mind which I have listed. One need not do everything, and it depends on the role and company. The idea is to have a fine mix.</p><h3>2. Your accomplishments</h3><p>After goals are listed, now focus on what you achieved and how you achieved it. I break this section into two parts.</p><ol><li>Major goals — What was expected and mostly listed above.</li><li>Additional achievements — Raise the bar. These are core-tech bottoms-up projects you picked up.</li></ol><h4>Major goals</h4><p>The following template works well in bullet points for all accomplishments:</p><ul><li>&lt;Task Title&gt; &lt;JIRA Epic/Brief description&gt; &lt;Impact Metrics&gt; &lt;Solutioning Doc (LLD/HLD/test cases if present)&gt;</li></ul><p>This way, in a single line, you can provide all the important information for a project. We tend to skip fuzzy tasks or small items, but you can group them in 1–2 line items and attach JIRAs. Be sure to include them. No work is small; all types of work are required to keep the business running. (It is OK to ask your PM or EM to provide business/product metrics for the work you have shipped.)</p><h4>Additional achievements</h4><p>For example:</p><ul><li>80% reduction in Sentry (Logger for UI) error fixes from 220K/hourly events to ~40K/hourly events. [JIRA ID, Solutioning Doc link]</li><li>Preprod stability: Helped and drove different environment setups across different teams in the org. This ensured 100% dedicated availability for the stage environment.</li></ul><h3>3. How I worked with others</h3><p>Stakeholder management, mentorship, helping and guiding peers through knowledge sharing, onboarding new joiners, code reviews, and design reviews are critical for a senior role.</p><ul><li>Instances of onboarding new PMs to the engineering side of things. Attach KT docs, etc.</li><li>Instances of PR reviews where more than expected time was spent:</li></ul><ol><li>[PR_link1]: Pointing out better quality and modern code that doesn’t do what they are expected to do.</li><li>[PR_link2]: Pushing back on an inbound, low-quality code change coming in from another team.</li><li>[PR_link3]: Giving feedback to John on our coding style and performance. (Note: I later followed up in-person.)</li></ol><ul><li>Mentorship for interns -&gt; SDE1/2s. How they are now independent developers thriving and performing.</li><li>HLD/LLD/Roadmaps for big projects with proper breakdown — &lt;Links&gt;</li></ul><h3>4. Levels and competencies assessment</h3><p>Each level has some expected competencies defined. It could depend on company size, team, manager/HR discretion. Some companies have it documented; if not, you can always discuss this with your manager in a 1–1 meeting. In this section, based on the expected competencies, one needs to list the achievements. Here are some sample sections and examples:</p><h4>Overall</h4><p>I focused a lot on this area and made significant progress, exceeding expectations at my level. I am curious for more feedback and observations.</p><h4>Software engineering</h4><p>Drove and led end-to-end cycles of software engineering with true spirit and efficiency, meeting standard practices and guidelines.</p><h4>Domain Knowledge &amp; Tech Complexity</h4><p>– Expertise in the domain</p><p>– Common solutions</p><p>– Tech debt reductions</p><p>– Contribution to documentation, gaps analysis</p><p>– Web performance improvements</p><h4>Org Building &amp; Collaboration:</h4><p>— Evangelize across teams to improve product and tech efficiency.</p><p>— Mentorship</p><p>— Interviews/Hiring contributions</p><p>— Collaborations, testimonials, and relationships within and outside the team.</p><h4>Execution &amp; Operational Excellence:</h4><p>— Domain expansion</p><p>— Started to add value in scrum ceremonies (demos, sprint planning, daily scrum, backlog grooming)</p><p>— Task breakdowns and Say:Do ratio</p><h4>Results and impact</h4><p>I’ve been prioritizing business results, and the impact shows. All key projects were shipped on time or before.</p><h4>Citizenship</h4><p>I spent a lot of time mentoring and onboarding others. I did not put additional focus on this area external to the company, though.</p><p>That’s all.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=da996306a86e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[One year with Flipkart as UI Engineer]]></title>
            <link>https://medium.com/@agrawalkanishk3004/one-year-with-flipkart-as-ui-engineer-14a05776c899?source=rss-e0d4557e59b1------2</link>
            <guid isPermaLink="false">https://medium.com/p/14a05776c899</guid>
            <category><![CDATA[engineering]]></category>
            <category><![CDATA[promotion]]></category>
            <category><![CDATA[jobs]]></category>
            <category><![CDATA[flipkart]]></category>
            <dc:creator><![CDATA[Kanishk Agrawal]]></dc:creator>
            <pubDate>Fri, 11 Sep 2020 20:34:40 GMT</pubDate>
            <atom:updated>2020-09-11T20:34:40.846Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LJJs6VC4hYe2_Zk1K3oQBw.jpeg" /></figure><p>Today marks one amazing year with Flipkart. I got great news yesterday that I have been promoted at work to UI Engineer II. I want to reflect on the work, journey, learnings and take-aways from the last one year.</p><p>The Big Billion Days 2019 was around the corner when I joined, and the atmosphere was ecstatic. Floor was lit, occupied meetings room, people entering office at 8PM and leaving 5AM, while some coming at 8AM and staying late as well. One could not make out what are the ‘official working hours’.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*Q_EvnYNbglR2I5HWR8KX_w.png" /></figure><p>I could sense and feel for the first time, it takes a lot and lot to pull up the biggest Indian Sale. I was a mere spectator in the war rooms, issues to be taken care of, meetings and dry-runs. Well those 5 days were amazing, and then came a cool off period.</p><p>I was waiting for my first gig and make my hands to go dirty with code! 😁 😎 I joined Marketplace Engineering which handles Seller Platform for Flipkart &amp; 2Gud seller. Seller Listings Management ( SLM ) and Seller Settlements ( SSM ) were the teams I have to work with.</p><p>SLM is responsible for sellers to list products, maintain inventory, pricing from over 800M listings. SSM is responsible for seller payments. Both being transactional systems, it was extremely critical team for the Marketplace team, and that’s what I wanted. 😇 Tech stack is React + Redux mainly. Well you cannot avoid tech debt, and we too had it with some of the legacy code in Blinx ( an in-house framework by Flipkart, later open-sourced — <a href="https://github.com/blinxjs/blinxjs">https://github.com/blinxjs/blinxjs</a> ). I was new to React as in my previous company I worked with Angular. Well, remember my idle time during BBD, that’s when I learned React &amp; Redux. 😛</p><p>I had two experienced peers with me in UI, from whom I did learn about the codebase, KT sessions, deployments, github processes, etc. Well, one shifted to other team and while the other left in 3 months. So, I was the only one left in both the teams. ( Too overwhelming, I know 🤤 ) Was lucky to have a proactive PM with good features to work with for an UI Dev like me. Delivered two long awaiting features in span of 3 sprints. Well, NO production bug was the highlight.</p><p>A college fresher joined in, with no background in UI. With resource dearth in UI, we got him in UI to get started with. I got a chance to mentor him and prepare a roadmap to get started with UI. Well, it reminded me of my college 3rd year, when I started with it. Mentoring is full-time responsibility in starting. Constant pings, resolving doubts that may be too trivial to few, guiding along tests your PATIENCE to the core. Being calm and how to simplify a solution to a beginner is something I would take away as a key learning.</p><p>Later, I was profoundly involved with BAU tasks, released many features to improve seller experiences, and learning curve was exponential… and then kind of stuck.</p><p>I wanted to spend time on tech debts. Remember legacy code I talked about, so I migrated 1/3 to React. It was good experience as to migrate a code from language A → B, it is mandatory to understand A as well. Next up, I checked up <em>package.json</em> with heed of what all packages we import. Then I found <a href="https://styled-components.com/"><em>styled-components</em></a> needs an upgrade. A major one, from v3 to v5! <br>With only UI dev in the team, and my team being responsible for BAU work, bandwidth was an issue and timelines were in a crunch. So, I took it as a moonshot goal and made it like my own (personal) project to finish it. Huge learning, as we moved up to two major versions in a go, going through the release cycles for a library, noting down what/what-not changed, making sure to inculcate and handle the breaking changes. Regression cycles were countless. <em>Change -&gt; Test -&gt; Deploy -&gt; Repeat.</em><br>Make the migrations a smooth ones across a huge piece of code in a go was a challenge I gleefully overcame. Reduction of 13KB in bundle size was the reward except the learnings that I took with me.</p><p>I was made part of one more team — Flipkart Promotions. Here, sellers lists and manages all his offers that s/he wants to take part in which eventually move ahead to upstream systems and finally show up on <a href="http://flipkart.com/">Flipkart.com</a> We had to launch Pre-Order feature, where customer can pre-order an item before the sale begins with assuring lesser price than Sale, guaranteed stock and faster delivery. As this involved over 10 teams across FK, I gained an understanding of how important stakeholder management, execution and collaboration skills are. Had to work with teams that I have never met or known. WFH setup did made it worse and more challenging to deliver this successfully. However, with team support and joint effort, it was a success in Independence Day Sale and we are ready to launch it in full flow for BBD 2020 which is just around the corner.</p><p>Today, 11th September in a monthly MP meeting, Promotions were announced. I was lucky enough that my work was recognised and made it to the next level in a day lesser than a year.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FToI41rwlGeC_gZd2Nd6yg.jpeg" /><figcaption>It did come up as a surprise to me 😛</figcaption></figure><p>Looking forward to make it worth it! Cheers 🥂 .</p><p>Let’s connect at <a href="https://twitter.com/KanishkAgrawal">Twitter</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=14a05776c899" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Do we need to understand JavaScript before using a framework?]]></title>
            <link>https://medium.com/@agrawalkanishk3004/do-we-need-to-understand-javascript-before-using-a-framework-15f8ae9f6c31?source=rss-e0d4557e59b1------2</link>
            <guid isPermaLink="false">https://medium.com/p/15f8ae9f6c31</guid>
            <category><![CDATA[ui]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[front-end-development]]></category>
            <dc:creator><![CDATA[Kanishk Agrawal]]></dc:creator>
            <pubDate>Tue, 10 Sep 2019 11:17:05 GMT</pubDate>
            <atom:updated>2019-09-10T11:17:05.523Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*04-xMZttQpenmR9tvijGsg.jpeg" /></figure><p>Hi, I am Kanishk, a Frontend Engineer. <br>Frontend Development is a lot easier now with evolving frameworks, libraries and just plug n play of modules than some say it was 5–10 years ago. With huge demand in React, it’s not surprising for college graduates or one looking to switch into Frontend Development are trying to master it.</p><p>With speedy world and evolving tech, no company can avoid using frameworks for development. Still, companies test knowledge of plain JS before hiring you.</p><p>In my limited knowledge, companies like MS, Amazon, FK which are known for their solid tech, rarely take into consideration in the stack you worked for if one is applying for beginner, intermediate level. It doesn’t really matter if you worked with Angular and job is for Vue.js developer.</p><p>With any MOOC you take or even in the docs of Angular/Vue/React, it assumes you to be thorough with JavaScript.</p><p>Do you really understand JavaScript?</p><p>For example,</p><ul><li>Angular comes up with built in router library, which makes is so simple to link and navigate between components. Have you considered implementing it on your own? Forget implementing, have you given thought about how does it work? I didn’t, before I was forced to think over it.</li><li>With JSX in React, one can use .map operator to iterate over the payload given it’s an array and just populate the UI. What does .map do internally? How does it magically takes the array and run any operation on it and produce the result. One line, and done.</li><li>With loops in vue.js, one could use v-for in HTML itself. Just like a traditional for loop. It can’t get simpler. Get in response, and your UI is ready to render.</li><li>Even VSCode is written with JavaScript.</li></ul><p>Eventually everything is JavaScript!</p><p>Knowing how things are working behind the hood, would definitely makes one a better developer. One can optimise for performance better. Get into the mode of developing using plain JS to learn and grow. Get back to roots.</p><p>However, question is what triggers you to learn about it?</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=15f8ae9f6c31" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[7 Vanilla JS Must Do Projects Before Appearing For UI Task Round]]></title>
            <link>https://medium.com/@agrawalkanishk3004/7-vanilla-js-must-do-projects-before-appearing-for-ui-task-round-2d31c5605af0?source=rss-e0d4557e59b1------2</link>
            <guid isPermaLink="false">https://medium.com/p/2d31c5605af0</guid>
            <category><![CDATA[ui]]></category>
            <category><![CDATA[vanillajs]]></category>
            <category><![CDATA[interview]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[front-end-development]]></category>
            <dc:creator><![CDATA[Kanishk Agrawal]]></dc:creator>
            <pubDate>Fri, 06 Sep 2019 11:30:56 GMT</pubDate>
            <atom:updated>2020-02-23T09:19:28.433Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*bxEkHw1xewxOFjmGunb-Cw.png" /></figure><p>Alternatively read at my blog: <br><a href="https://kanishkagrawal.netlify.com/vanilla-js-projects/">https://kanishkagrawal.netlify.com/vanilla-js-projects/</a></p><p>An Assignment for an UI Developer is generally the round taken before the actual interview. The candidate is judged on his coding skills, whether he is using best practices, approach to the problem, and completeness of the solution in the given time frame.</p><p>I will discuss 7 projects one can practice to be confident with Vanilla JS. These would make you quite confident before appearing in an interview. Make sure to use Vanilla JS. Use promises, closures, fetch API, MVC architecture, ES6 class based setup.</p><blockquote><strong>1. Todo App</strong></blockquote><p>It can’t get simpler than this. Perfect app to start with. Don’t forget to use localStorage to persist state.<br>Comprehensive Guide: <a href="https://github.com/dwyl/todo-list-javascript-tutorial">https://github.com/dwyl/todo-list-javascript-tutorial</a></p><blockquote><strong>2. Event scheduler ( like Google Calendar )</strong></blockquote><p>Create a calendar interface similar to google calendar. One may be able to change the view from day, week to months. User should be able to add, remove the event.</p><blockquote><strong>3. Tasks management app like JIRA, Trello</strong></blockquote><p>Comprehensive Guide: <a href="https://medium.com/appcoda-tutorials/building-trello-like-ios-app-with-drag-drop-api-alfian-losari-d76534529f0f">https://medium.com/appcoda-tutorials/building-trello-like-ios-app-with-drag-drop-api-alfian-losari-d76534529f0f</a><br>Learn how dragDrop events work: <a href="https://www.youtube.com/watch?v=C22hQKE_32c">https://www.youtube.com/watch?v=C22hQKE_32c</a></p><blockquote><strong>4. Tic Tac Toe game</strong></blockquote><p>Comprehensive Guide ( Youtube ): <a href="https://www.youtube.com/watch?v=P2TcQ3h0ipQ">https://www.youtube.com/watch?v=P2TcQ3h0ipQ</a><br>Comprehensive Guide ( Codepen ): <a href="https://codepen.io/vasanthkay/pen/KVzYzG">https://codepen.io/vasanthkay/pen/KVzYzG</a></p><blockquote><strong>5. Rock, Paper &amp; Scissor game</strong></blockquote><p>Comprehensive Guide ( Youtube ): <a href="https://www.youtube.com/watch?v=jaVNP3nIAv0">https://www.youtube.com/watch?v=jaVNP3nIAv0</a></p><blockquote><strong>6. Image search engine using open GIPHY API</strong></blockquote><p>Problem statement: Using the following API, display the GIFs based on user’s search result.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Z99-Ij5pcN32GpUzYvbMSQ.png" /><figcaption>Build somewhat like this.</figcaption></figure><p><em>API end point: </em><a href="https://developers.giphy.com/branch/master/docs/api/endpoint/"><em>https://developers.giphy.com/branch/master/docs/api/endpoint/</em></a><br>One should implement debounce, pagination, maybe infinite scroll! You’re free to fancy whatever you like. This has lot of scope to learn.</p><blockquote><strong>7. n-th level Commenting Widget like Facebook</strong></blockquote><p>Problem statement: Build a nested comment widget system like the one in Facebook, Twitter. User could reply, like, unlike, delete, edit a comment upto any level.<br>Demo: <a href="https://bootsnipp.com/snippets/ZkexO">https://bootsnipp.com/snippets/ZkexO</a></p><p><strong><em>Ace the UI Tech round: </em></strong><a href="https://bit.ly/2kwXTYS">https://bit.ly/2kwXTYS</a></p><p>Feel free to discuss any of the above problems.<br>Thanks, happy to help!</p><p>Feel free to reach out to me on Twitter or Linkedin.<br><a href="https://twitter.com/KanishkAgrawal">https://twitter.com/KanishkAgrawal</a><br><a href="https://www.linkedin.com/in/agrawalkanishk3004/">https://www.linkedin.com/in/agrawalkanishk3004/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2d31c5605af0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Frontend Engineer Interview — UI Tech Round]]></title>
            <link>https://medium.com/@agrawalkanishk3004/frontend-engineer-interview-ui-tech-round-e3ed0bd02d68?source=rss-e0d4557e59b1------2</link>
            <guid isPermaLink="false">https://medium.com/p/e3ed0bd02d68</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[ui]]></category>
            <category><![CDATA[interview]]></category>
            <category><![CDATA[front-end-development]]></category>
            <dc:creator><![CDATA[Kanishk Agrawal]]></dc:creator>
            <pubDate>Mon, 02 Sep 2019 16:35:33 GMT</pubDate>
            <atom:updated>2021-06-11T13:04:54.777Z</atom:updated>
            <content:encoded><![CDATA[<h3>Ace The MC Round</h3><p>Alternatively read at my blog:</p><p><a href="https://kanishkagrawal.netlify.com/ace-ui-tech-round/">Ace The UI Tech Round</a></p><p>Hi, I am Kanishk, a Frontend Engineer. Sharing my experiences with recent stints interviewing at top product based companies in India. There are innumerable blogs, videos covering in depth with most probable questions. I will attempt to highlight my experience with what the interviewer is looking for and how you can ace it up.<br>Practice apps for UI Task round: <a href="https://bit.ly/2kvmNIl">https://bit.ly/2kvmNIl</a></p><blockquote>UI Task Round:</blockquote><p>Typically an UI assignment which could be a home-takeaway ( 2–3 Days ) or to be done in company premise ( 2 hours ). Companies like Amazon, MS, Flipkart, GoJek Tech and the likes start their interview processes with this round. <br>This is the best time to showcase your skill without any pressure. You can impress an interviewer with just little preparation. I would recommend to refrain using any library/framework, as the person evaluating may not have prior experience with the framework. Some companies explicitly force you to use Vanilla JS only. Even they not, Vanilla JS is the way to go in this.</p><ul><li>Use DOM efficiently.</li><li>Small things can make it large impact.</li><li>Use ES-6, classes in Javascript.</li><li>Prepare a scaffolding before hand. Mostly companies allow you to use your laptop.</li></ul><figure><img alt="Recommended file structure for Vanilla JS" src="https://cdn-images-1.medium.com/max/484/1*Ym7dOKMX_t56UZBxikZrkg.png" /></figure><p>Divide your code in <strong>MVC</strong> structure. <br>index.html would just reference to main.js . model.js should be responsible to get and set data.view.js should render view. It should call controller.js for all the events bound to UI. controller.js should hold the definition of events and should call model to set data, which eventually should re-render the view.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ca4RK5TS3Diy30bE7nURQg.png" /><figcaption>main.js</figcaption></figure><p>In main.js , one could you use -IIFE, <br>DOM events, <br>promises, <br>ES6 import, export, <br>use strict, <br>event capturing, <br>local storage<br>to impress the interviewer with almost zero effort.</p><p>Practice fetch API calls. How to read and manipulate response. Use promises. You do not want to waste your time googling it about. You would be asked to maintain the state of the application typically on refresh. localStorage is the way to go. Make sure you have done it before. How to stringify the API response and parse it to JSON while reading from local storage.</p><p>Wonder how JIRA, Trello works? <br>dragDrop events. I bet not many would know about it. Practice a small app with those events. They are exciting to the first timers. <a href="https://www.youtube.com/watch?v=C22hQKE_32c"><em>https://www.youtube.com/watch?v=C22hQKE_32c</em></a> from Brad Traversy would help to get started.</p><p>ES6 should all over your code. Refrain from using non ES6 syntax. Pitch in map, reduce, for of , for in loops .</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4nc7z2MK-4f3s665WH2C5w.png" /><figcaption>index.html</figcaption></figure><p>This is the index.html of the full fledged application.</p><p>Notice the meta tags. Each have their own meaning. Read about them. You could be asked about that. <br>Why do we need script type=&quot;module&quot; ?<br>Advanced Reading: <a href="https://ponyfoo.com/articles/es6-modules-in-depth">https://ponyfoo.com/articles/es6-modules-in-depth</a></p><p><strong>Use Javascript to build your UI. </strong>This is something is not mandatory, but a good to have thing which shows your confidence in Javascript. Not everyone can effectively manipulate DOM. I would never forget the reaction of my interviewer when I did so, it definitely got me those extra brownie points. It just takes some practice and you’ll be good to go. It is just that we are just too much used to HTML, else almost everything can bee achieved with JS as well. See those &lt;header&gt; and .loaderYou could have CSS for them before hand. <br>And yes, with loader you can have an excuse to show that you know how to use keyframes to leverage animations.</p><p>How will you efficiently construct the DOM tree? How would you make sure while appending children to DOM, you do not reconstruct the DOM? document.createFragment is the way to go. Make sure to use it.<br>Further reading: <a href="https://developer.mozilla.org/en-US/docs/Web/API/Document/createDocumentFragment">https://developer.mozilla.org/en-US/docs/Web/API/Document/createDocumentFragment</a></p><p>Listing few things to take care which are on top of my head.</p><ul><li>Avoid console.logs / debugger in final submission code.</li><li>Make sure you are comfortable using handling click, hover events.</li><li>document.querySelector over document.getElementById . And you should know why.</li><li>Indent your final code. Install Prettier in VSCode.</li><li>Use let, const. Avoid global variables unless required.</li><li>Camelcase for function names. hyphen separated for CSS names.</li></ul><p>Practice building 3–5 apps purely in Vanilla JS and you’ll be good to go. <br>Let me know, if you wish to know about other rounds as well.</p><p>Thanks, happy to help!</p><p>Feel free to reach out to me on Twitter or Linkedin.<br><a href="https://twitter.com/KanishkAgrawal">https://twitter.com/KanishkAgrawal</a><br><a href="https://www.linkedin.com/in/agrawalkanishk3004/">https://www.linkedin.com/in/agrawalkanishk3004/</a></p><figure><a href="https://usejournal.com/?utm_source=medium.com&amp;utm_medium=noteworthy_blog&amp;utm_campaign=tech&amp;utm_content=guest_post_image"><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PYxBP_WV7LI6zc-zdUkNqQ.png" /></a></figure><p>📝 Read this story later in <a href="https://usejournal.com/?utm_source=medium.com&amp;utm_medium=noteworthy_blog&amp;utm_campaign=tech&amp;utm_content=guest_post_read_later_text">Journal</a>.</p><p>👩‍💻 Wake up every Sunday morning to the week’s most noteworthy stories in Tech waiting in your inbox. <a href="https://usejournal.com/newsletter/noteworthy-in-tech/?utm_source=medium.com&amp;utm_medium=noteworthy_blog&amp;utm_campaign=tech&amp;utm_content=guest_post_text">Read the Noteworthy in Tech newsletter</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e3ed0bd02d68" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Hi <portal>, Bye <iframe>]]></title>
            <link>https://medium.com/@agrawalkanishk3004/hi-portal-bye-iframe-5c6f35e8ab31?source=rss-e0d4557e59b1------2</link>
            <guid isPermaLink="false">https://medium.com/p/5c6f35e8ab31</guid>
            <category><![CDATA[front-end-development]]></category>
            <category><![CDATA[google-io-2019]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[web-development]]></category>
            <dc:creator><![CDATA[Kanishk Agrawal]]></dc:creator>
            <pubDate>Sat, 11 May 2019 11:42:10 GMT</pubDate>
            <atom:updated>2019-05-11T11:48:36.058Z</atom:updated>
            <content:encoded><![CDATA[<p>At Google I/O 2019 conference, Google launched portals which seamlessly enables to navigate and load web pages across the app.</p><p>&lt;iframe&gt; have been responsible for embedding pages for us till now, though there are many challenges associated with it mostly related to data sharing or navigating through web pages, cost associated to browser re-rendering the component again. For those who have used &lt;iframe&gt; a blank white screen is commonly seen, that glitch definitely do not enhance UX. Due to security reasons, iframe didn’t allow us to navigate into its content, with portals, one cannot only embed page, can also navigate to to their content.</p><p>&lt;portal&gt; allow users to navigate inside the content they are embedding. Portals are always created as top-level browser context, and can always be embedded into a page just like iframe. They are basically an upgrade over iframe. With portals, one can prefetch the content and create an illusion of smooth navigation when called upon. Portals can also overwrite the existing URL address bar, making it more powerful to be used for navigation.</p><p>Portal can be <em>activated</em>, which causes the top-level browsing context to navigate, replacing its document with the portal. The document receives an event when it is activated. It can use this event to receive data from its <em>predecessor</em> (the document which previously occupied the tab), and even move it into a portal context.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oRWX8Iwa4O8f0DG1Zl5qhA.png" /><figcaption>Source: Google</figcaption></figure><p>Further reading for specs: <a href="https://github.com/WICG/portals">https://github.com/WICG/portals</a></p><p>Thanks!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5c6f35e8ab31" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Airbnb Javascript style guide — Key takeaways]]></title>
            <link>https://medium.com/docon/airbnb-javascript-style-guide-key-takeaways-ffd0370c053?source=rss-e0d4557e59b1------2</link>
            <guid isPermaLink="false">https://medium.com/p/ffd0370c053</guid>
            <category><![CDATA[es6]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[engineering]]></category>
            <category><![CDATA[frontend]]></category>
            <dc:creator><![CDATA[Kanishk Agrawal]]></dc:creator>
            <pubDate>Sat, 04 May 2019 19:49:37 GMT</pubDate>
            <atom:updated>2019-05-04T19:49:37.884Z</atom:updated>
            <content:encoded><![CDATA[<h3>Airbnb Javascript style guide — Key takeaways</h3><h3><strong>What is a style guide?</strong></h3><ul><li>A style guide is a set of standards that outline how code should be written and organized.</li><li>A style guide contains general rules about “how to write” code, e.g. which quotes to use, how many spaces to indent, where to put line breaks, etc. A lot of minor things.</li></ul><h3><strong>Why a style guide is must?</strong></h3><ul><li>Each developer writes code differently. That’s fine, until we are working on our code.</li><li>As count of developers increase 5-&gt;10-&gt;20-&gt;50, things get messy when all are working on common codebase.</li><li>Style guides are created so new developers can get up to speed on a code base quickly, and then write code that other developers can understand quickly and easily!</li></ul><blockquote>“All code in any code-base should look like a single person typed it, no matter how many people contributed.”</blockquote><h3><strong>AIRBNB STYLE GUIDE</strong></h3><p>In the blog, I have only included not-so-common practices for a Javascript developer. This would give you an thorough understand about What and Why in Javascript? <em>For 100% complete guide, one must check out the link at the bottom.</em></p><p><em>Let’s get started.</em></p><blockquote><strong>Expected style in casing for Javascript and CSS:</strong></blockquote><ul><li><strong>CSS: </strong>hyphens</li><li><strong>JS: </strong>camelCase</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DR8Q74hkbvW_ljNRx004fg.png" /><figcaption>A big NO to above style. Be consistent.</figcaption></figure><ul><li>CSS class names should be hyphen separated.</li><li>Either use hexcode or rgb standard for color scheme throughout your application.</li><li>Avoid using <em>px, rem, em</em> at once Choose one. Prefer <em>em.</em></li><li>font-weight: 400 ? What good is it for? Eliminate useless CSS.</li><li>Read about <em>mixins</em> for SASS.</li></ul><blockquote><strong>Strings in HTML vs JS</strong></blockquote><ul><li><strong>Double quotes</strong> in HTML</li><li><strong>Single quotes </strong>in JS</li></ul><blockquote><strong>When using multiple selectors in a rule declaration, give each selector its own line.</strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1UyXMPHxw6fVNmxfCEhCcA.png" /><figcaption>Source: Airbnb style guide</figcaption></figure><blockquote><strong>Object.assign( ) v/s {…}</strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*FmILMYlHmjrwh-Jp" /><figcaption>Source: Airbnb style guide</figcaption></figure><p>First case not only mutates the object, would also lead to unforeseen errors and bugs. Well third wins over second over leaner code and added syntactic sugar.</p><p>Read more about spread operators : <a href="https://bit.ly/2vEsnKq">https://bit.ly/2vEsnKq</a></p><blockquote><strong>Do Not mutate an array</strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*WeGkW8dTiN7XF526" /><figcaption>Source: Airbnb style guide</figcaption></figure><p>No more for loops are required to copy the items of an array. Three dots would do the trick.</p><blockquote><strong>Group your shorthand properties at the beginning of your object declaration.</strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/706/0*zQ6zOlNWoiMP0ZUl" /><figcaption>Source: Airbnb style guide</figcaption></figure><p>Makes it simple to read and make decisions. Makes things simpler in a complex nested object structure.</p><blockquote>Destructuring</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/778/0*EimgG8xYPoIGWAKv" /><figcaption>Source: Airbnb style guide</figcaption></figure><p>Template literals bridges not only HTML and Javascript, also must be used for above case. We do pass an object consisting of <em>n </em>keys to another function (say), destructuring the keys in the function declaration would not only make code less to error prone, would also avoid making temporary unwanted variables(first case). Adds readability , as can be seen in the third case.</p><blockquote><strong>DO NOT break a loooooooooooong string</strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*MjSAmX5PLH6JbrIa" /><figcaption>Source: Airbnb style guide</figcaption></figure><p>Simple reason. Makes code more searchable &amp; easy to work with. First and second case eliminates the possibility of searching the code. Adding <em>/ </em>or <em>+ </em>would put an end to code readability.</p><blockquote><strong>Use template strings for string concatenation</strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/714/0*1AmfiPOc_1S_i5zy" /><figcaption>Source: Airbnb style guide</figcaption></figure><p>Unarguably one of the best ES6 features. <strong>Must STOP </strong>using any of the first three ways.</p><ul><li>Easy to read</li><li>Simple to implement</li><li>Concise syntax</li></ul><blockquote><strong>Always put default parameters last</strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/712/0*eJp_GRsr7qsfPGPf" /><figcaption>Source: Airbnb style guide</figcaption></figure><blockquote><strong>Write concise and leaner arrow functions</strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/928/0*SQHMDJqLc0ysD8sc" /></figure><ul><li>Parenthesis are not required if only single parameter is there in a function call. More than one, parenthesis are must.</li><li><em>return </em>statement can be avoided with <em>curly braces </em>if only one line is present in the function body.</li></ul><blockquote><strong>Wrap in parenthesis if expression spans in multiple lines</strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*PwBIai3DphCV88TC" /><figcaption>Source: Airbnb style guide</figcaption></figure><ul><li>For better visibility where our function starts &amp; ends</li><li>Clear to read</li></ul><blockquote><strong>Object direct access over computed access.</strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/588/0*12Ne2mY0ndcptpUf" /><figcaption>Source: Airbnb style guide</figcaption></figure><p>In my experience,</p><ul><li>Less prone to errors</li><li>Faster</li><li>Know what to expect</li></ul><blockquote><strong>Interesting</strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/466/0*afDL0oO52uKKAca-" /><figcaption>Source: Airbnb style guide</figcaption></figure><ul><li><strong>Shortcuts ONLY for </strong><em>booleans.</em></li><li><strong>Explicit comparisons for </strong><em>Strings &amp; Numbers</em></li></ul><blockquote><strong>No nested ternaries</strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/784/0*3QEv_mxmjf5kJrYm" /><figcaption>Source: Airbnb style guide</figcaption></figure><ul><li>It is <strong>OKAY</strong> to write long control statements.</li><li><strong>AIM</strong> should be to make it readable for future developers instead to write short &amp; difficult to understand code.</li></ul><blockquote><strong>Control statements</strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*QBLA7tYZpL8MrG1p" /><figcaption>Source: Airbnb style guide</figcaption></figure><ul><li><strong>If control statement gets too long, each grouped condition should be put in new line.</strong></li><li>Logical operator <strong>should </strong>begin the new line.<br>- Follows a similar pattern for chaining.<br>- Improves readability, easier to understand logic.</li></ul><blockquote><strong>Comments</strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/660/0*cvmK3BOJVc3U697z" /><figcaption>Source: Airbnb style guide</figcaption></figure><ul><li><strong>Use </strong>/* */<em> </em><strong>for multiline comments instead of </strong>//</li><li>Place single line comments above subject of the comment and start comment with space.</li><li>Use <strong>FIXME </strong>to annotate the problems</li><li>Use <strong>TODO </strong>to annotate the solutions</li></ul><blockquote><strong>Do not quote ‘’ keys in the objects</strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/874/0*jNiTbyvho4VHzb9N" /></figure><p><em>Single quotes </em>in the keys for an object are not required. Hence, should not be used.</p><blockquote><strong>Spaces in brackets || parenthesis</strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/618/0*wzdP1j7nW8bfQdMH" /><figcaption>Source: Airbnb style guide</figcaption></figure><ul><li><strong>Add spaces in Curly brackets</strong></li><li><strong>No space in square brackets and parentheses.</strong></li></ul><h3><strong><em>What could make a better codebase?</em></strong></h3><ul><li>Use spread operators over Object.assign</li><li>Use spread operators to copy the arrays instead of looping through.</li><li>Exploit array operations to the fullest. [ every, some, filter, <strong>reduce, </strong>map<strong> </strong>]</li><li>Avoid return statements for one liners arrow functions</li><li>Acronyms always should be in capitals. ( Eg. HTTP, SMS )</li></ul><p>Did I miss something? Let me know in the comments.</p><p>Thanks.</p><p>Complete guide: <a href="https://github.com/airbnb/javascript">https://github.com/airbnb/javascript</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ffd0370c053" width="1" height="1" alt=""><hr><p><a href="https://medium.com/docon/airbnb-javascript-style-guide-key-takeaways-ffd0370c053">Airbnb Javascript style guide — Key takeaways</a> was originally published in <a href="https://medium.com/docon">Docon</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Three dots in JavaScript : Spread & Rest Operators]]></title>
            <link>https://medium.com/docon/three-dots-in-javascript-spread-rest-operators-5a1018c11a54?source=rss-e0d4557e59b1------2</link>
            <guid isPermaLink="false">https://medium.com/p/5a1018c11a54</guid>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[ecmascript-6]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[es6]]></category>
            <dc:creator><![CDATA[Kanishk Agrawal]]></dc:creator>
            <pubDate>Mon, 22 Oct 2018 20:30:02 GMT</pubDate>
            <atom:updated>2018-10-22T20:30:02.766Z</atom:updated>
            <content:encoded><![CDATA[<h3>Three dots in JavaScript : Spread &amp; Rest Operators</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HulO5WD-QR5yciOpbwhbRg.png" /></figure><pre>function myFunction(x, y, ...data) { <strong>//REST OPERATOR</strong><br>console.log(x); // <em>&quot;a&quot;</em><br>console.log(y); // <em>&quot;b&quot;</em><br>console.log(data); // <em>[&quot;c&quot;,&quot;d&quot;]</em><br>console.log(...data); // <em>&quot;c&quot; &quot;d&quot;</em><br>}</pre><pre>var arr = [&#39;a&#39;,&#39;b&#39;,&#39;c&#39;,&#39;d&#39;];<br>myFunction(... arr); <strong>//SPREAD OPERATOR</strong></pre><p>Now let us try and understand what just happened here! Starting with the formal definition for Rest Parameters &amp; Spread Operators.</p><h4><em>Rest Parameters</em></h4><p>It allows us to pass any number of arguments as an array. It is pretty helpful to write clean and non-repetitive code. <br>As in above example, prefixing ... on data allowed us to pass extraneous variables ( c &amp; d ) to pass an arguments. <strong>Obviously only the ‘last’ parameter can be a ‘rest parameter’</strong>. If you try otherwise in console,</p><pre>function myFunction(x, ...y, data) { <br>console.log(x);<br>}<br>var arr = [&#39;a&#39;,&#39;b&#39;,&#39;c&#39;,&#39;d&#39;];<br>myFunction(... arr); </pre><p>Above would throw the <em>ERROR</em> as <strong><br><em>Uncaught SyntaxError: Rest parameter must be last formal parameter</em></strong></p><h4>Spread Operators</h4><blockquote>According to MDN:<strong><br>Spread syntax</strong> allows an iterable such as an array expression or string to be expanded in places where zero or more arguments (for function calls) or elements (for array literals) are expected, or an object expression to be expanded in places where zero or more key-value pairs (for object literals) are expected</blockquote><p>Simply put, Spread syntax is super useful to expand elements of an array expression or a string. It also makes joining of arrays neat. Let us take an example.</p><pre>const a = [&#39;Hi&#39;];<br>const b = [&#39;How&#39;, &#39;are&#39;, &#39;you&#39;];<br>const c = [a,b];<br>const d = [...a , ...b];<br>const e = [...a, &#39;John&#39;, ...b];</pre><pre>console.log(c); // [[&quot;Hi&quot;], [&quot;How&quot;, &quot;are&quot;, &quot;you&quot;]]<br>console.log(d); // [&quot;Hi&quot;, &quot;How&quot;, &quot;are&quot;, &quot;you&quot;]<br>console.log(e); // &quot;Hi&quot;, &quot;John&quot;, &quot;How&quot;, &quot;are&quot;, &quot;you&quot;]</pre><p>Same can be done to get each character from a string as well.</p><pre>const string = &quot;javascript&quot;;<br>const character = [...string];</pre><pre>console.log(string); // &quot;javascript&quot;<br>console.log(character); //[&quot;j&quot;, &quot;a&quot;, &quot;v&quot;, &quot;a&quot;, &quot;s&quot;, &quot;c&quot;, &quot;r&quot;, &quot;i&quot;, &quot;p&quot;, &quot;t&quot;]</pre><p>With ECMAScript 2015, spread operator makes operations like cloning and merging an object also easy.</p><pre>const obj1 = {a: 1, b: 2};<br>const obj2 = {c: 3, d: 4, e: 5};</pre><pre>const obj3 = {obj1, obj2};<br>const obj4 = {obj1, ...obj2};<br>const obj5 = {...obj1, ...obj2, f: 6}</pre><pre><strong>console.log(obj3);</strong></pre><pre>//  {<br>  obj1: [object Object] {<br>    a: 1,<br>    b: 2<br>  },<br>  obj2: [object Object] {<br>    c: 3,<br>    d: 4,<br>    e: 5<br>  }<br>}<br></pre><pre><strong><em>console.log(obj4); </em></strong></pre><pre><em>// {<br>  c: 3,<br>  d: 4,<br>  e: 5,<br>  obj1: [object Object] {<br>    a: 1,<br>    b: 2<br>  }<br>}</em></pre><pre><strong>console.log(obj5);</strong><br>// {<br>  a: 1,<br>  b: 2,<br>  c: 3,<br>  d: 4,<br>  e: 5,<br>  f: 6<br>}</pre><pre>console.log(obj4); <br>console.log(obj5);</pre><p><strong>Cloning:</strong></p><pre>let obj1 = { a: 1};<br>let obj2 = { ...obj1}; <br>let obj3 = obj1; </pre><pre><strong>console.log(obj2);<br>// </strong>{<br>  a: 1<br>}</pre><pre><strong>console.log(obj3);<br>// </strong>{<br>  a: 1<br>}</pre><pre>obj1.a = 100;</pre><pre><strong>console.log(obj2);<br>// </strong>{<br>  a: 1<br>}</pre><pre><strong>console.log(obj3);<br>// </strong>{<br>  a: 100<br>}</pre><p>I hope it helps, thanks for reading!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5a1018c11a54" width="1" height="1" alt=""><hr><p><a href="https://medium.com/docon/three-dots-in-javascript-spread-rest-operators-5a1018c11a54">Three dots in JavaScript : Spread &amp; Rest Operators</a> was originally published in <a href="https://medium.com/docon">Docon</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Ahead-of-Time (AOT) compilation in Angular]]></title>
            <link>https://medium.com/docon/ahead-of-time-aot-compilation-in-angular-987b1dedacce?source=rss-e0d4557e59b1------2</link>
            <guid isPermaLink="false">https://medium.com/p/987b1dedacce</guid>
            <category><![CDATA[angular]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[typescript]]></category>
            <category><![CDATA[engineering]]></category>
            <category><![CDATA[front-end-development]]></category>
            <dc:creator><![CDATA[Kanishk Agrawal]]></dc:creator>
            <pubDate>Sun, 07 Oct 2018 15:55:29 GMT</pubDate>
            <atom:updated>2018-10-07T15:55:29.269Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Qdngbmuf-C6DKdrN.jpg" /><figcaption>Source: Google images</figcaption></figure><p>Ever happened that your Angular code runs perfectly in your local machine and fails in build for deployment. Well, if yes then this post will help you out to avoid unexpected ERROR while prod build.</p><h4>Angular Compilation</h4><p>Angular offers two types of compilation.</p><p><strong>1. Just in Time (JIT) compilation</strong></p><p>JIT compilation is the default when you run the <em>build-only</em> or the <em>build-and-serve-locally</em> CLI commands.</p><pre>ng serve<br>ng build</pre><p><strong>2. Ahead of Time (AOT) compilation</strong></p><p>For AOT compilation appending<em> - -aot </em>flag is required.</p><pre>ng serve --aot<br>ng build --aot</pre><p><strong>Why Angular needs Compilation?</strong><br>As Angular offers HTML templates and components with it which are not understood by the browsers directly. So , any of the above two type of compilation is required before they can run in a browser.</p><p><strong>What different does AOT do?</strong></p><p>During the build phase and before the browsers runs and downloads the code, the ‘HTML and Typescript’ code compiles into Javascript code. Compiling during build process ensures a faster rendering into the browser.</p><p>Let us see for the same piece of code how JIT and AOT compilation could make a difference.</p><pre>ng serve</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*n1dcxRXqSLXT4nzedNm61Q.png" /></figure><pre>ng serve --aot</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-Jb6--WBa6MDl36Nov4xEQ.png" /></figure><p>Clearly, ahead-of-time compilation could foresee the error failures that may occur ahead of time.</p><p><strong>Why AOT?</strong></p><ul><li>Faster Rendering</li><li>Reduce Angular Payload</li><li>Detect <strong>template errors </strong>earlier</li><li>Less injection attacks chances</li><li>Less Async HTTP requests</li></ul><p>As Angular offers JIT compilation by default, therefore AOT compilation is recommended for above reason before building your code for deployment. AOT compilation performs more build restrictions and code optimisations compared to JIT compilation.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=987b1dedacce" width="1" height="1" alt=""><hr><p><a href="https://medium.com/docon/ahead-of-time-aot-compilation-in-angular-987b1dedacce">Ahead-of-Time (AOT) compilation in Angular</a> was originally published in <a href="https://medium.com/docon">Docon</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>