<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Marco Kühbauch</title>
    <description>The latest articles on DEV Community by Marco Kühbauch (@mkuehb).</description>
    <link>https://dev.to/mkuehb</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F202281%2Fbb0873a5-a145-4b04-8b95-2da906aaa585.JPG</url>
      <title>DEV Community: Marco Kühbauch</title>
      <link>https://dev.to/mkuehb</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/mkuehb"/>
    <language>en</language>
    <item>
      <title>GitHub Copilot is not stealing our jobs</title>
      <dc:creator>Marco Kühbauch</dc:creator>
      <pubDate>Fri, 20 Aug 2021 13:48:57 +0000</pubDate>
      <link>https://dev.to/mkuehb/github-copilot-is-not-stealing-our-jobs-31jd</link>
      <guid>https://dev.to/mkuehb/github-copilot-is-not-stealing-our-jobs-31jd</guid>
      <description>&lt;p&gt;It's not. And never will. You can &lt;strong&gt;relax&lt;/strong&gt; and stop searching for alternative&lt;br&gt;
career ideas. In my opinion Github Copilot is one of the &lt;strong&gt;best things&lt;/strong&gt; that&lt;br&gt;
could happen to us developers in the current state of (web) development.&lt;/p&gt;

&lt;p&gt;In this blog post I will explain why I think this is the case.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What you can learn from this blog post:&lt;/strong&gt;&lt;/p&gt;




&lt;ul&gt;
&lt;li&gt;What is GitHub Copilot&lt;/li&gt;
&lt;li&gt;What can GitHub Copilot do&lt;/li&gt;
&lt;li&gt;Why it's not stealing our developer jobs&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  &lt;a&gt;&lt;/a&gt; What is GitHub Copilot
&lt;/h2&gt;

&lt;p&gt;GitHub Copilot was announced on June 29th 2021 as your &lt;strong&gt;AI pair programmer&lt;/strong&gt;.&lt;br&gt;
You can read the introduction blog pos over here:&lt;br&gt;
&lt;a href="https://github.blog/2021-06-29-introducing-github-copilot-ai-pair-programmer/"&gt;https://github.blog/2021-06-29-introducing-github-copilot-ai-pair-programmer/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It claims to &lt;strong&gt;help you write better code&lt;/strong&gt;.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;GitHub Copilot draws context from the code you’re working on, suggesting whole&lt;br&gt;
lines or entire functions. It helps you quickly discover alternative ways to&lt;br&gt;
solve problems, write tests, and explore new APIs without having to tediously&lt;br&gt;
tailor a search for answers on the internet.&lt;/p&gt;

&lt;p&gt;As you type, it adapts to the way you write code—to help you complete your&lt;br&gt;
work faster.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;As soon as I read the announcement I was hyped. I was tired of writing the same&lt;br&gt;
JavaScript code over and over again. Mapping over arrays, manipulating part of&lt;br&gt;
the data and returning it as some sort of HTML. Sometimes I feel like I'm&lt;br&gt;
&lt;strong&gt;doing nothing else than that&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;I immediately felt like I knew where GitHub Copilot would make my life easier.&lt;br&gt;
Without getting scared that it would do ALL the work.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;a&gt;&lt;/a&gt; What can GitHub Copilot do
&lt;/h2&gt;

&lt;p&gt;As I saw the first few posts coming in from people who where lucky enough to try&lt;br&gt;
it out, I felt supported in my gut feeling, in my assumption in what Github&lt;br&gt;
Copilot could do - and what not.&lt;/p&gt;

&lt;p&gt;People showed how GitHub Copilot knew where they were going when writing a&lt;br&gt;
specific function. It took the &lt;strong&gt;tedious work&lt;/strong&gt; from their shoulders by writing&lt;br&gt;
out the detailed specifics for them. And this was so cool to see.&lt;/p&gt;

&lt;p&gt;I entered my email to join the waiting list and after a few weeks I got the&lt;br&gt;
invitation to the repository and was able to install the Visual studio code&lt;br&gt;
extension.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--_xLb_7ks--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/v1/../images/github-copilot-email-invitation.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--_xLb_7ks--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/v1/../images/github-copilot-email-invitation.PNG" alt="image of email invitation to github copilot"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;My first few tries were pretty basic. I defined a function and GitHub Copilot&lt;br&gt;
knew by the name of this function what logic I wanted to write inside of it.&lt;/p&gt;

&lt;p&gt;I created a new file, imported React and it suggested the skeleton of a whole&lt;br&gt;
functional component.&lt;/p&gt;

&lt;p&gt;I started to use the &lt;a href="http://array.prototype.map"&gt;Array.prototype.map&lt;/a&gt; function&lt;br&gt;
on an Array of data I got from a GraphQL query and it suggested to manipulate&lt;br&gt;
parts of the data and knew how to return it as semantic HTML.&lt;/p&gt;

&lt;p&gt;I'm still at the beginning of using the advantages of GitHub Copilot but I&lt;br&gt;
already miss it here in Notion where I'm writing this blog post as there are no&lt;br&gt;
suggestions.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;But GitHub Copilot is not just auto-completion&lt;/strong&gt;. You can turn &lt;strong&gt;comments into&lt;br&gt;
code&lt;/strong&gt;. You can use it to write repetitive code. It can even write &lt;strong&gt;tests&lt;/strong&gt; for&lt;br&gt;
you. And it can show you how to write a certain part of your code in a different&lt;br&gt;
way.&lt;/p&gt;

&lt;p&gt;I already notice how this makes me &lt;strong&gt;faster and more confident&lt;/strong&gt;. I really feel&lt;br&gt;
like I have a copilot with me all the time, a second pair of eyes, supporting me&lt;br&gt;
and making my code less error-prone.&lt;/p&gt;

&lt;p&gt;This gives me a lot of &lt;strong&gt;confidence when tackling new problems&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Maybe this will eliminate the time spent on searching the internet and&lt;br&gt;
understanding how &lt;code&gt;Array.prototype.reduce&lt;/code&gt; works for the 317th time.&lt;/p&gt;

&lt;p&gt;I also can image that GitHub Copilot will make learning and working with a&lt;br&gt;
language you're not that familiar with a way better experience.&lt;/p&gt;

&lt;p&gt;This are just my first impressions on it. You can checkout the documentation&lt;br&gt;
here: &lt;a href="https://copilot.github.com/"&gt;https://copilot.github.com/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It shows a lot of detailed examples and usecases.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;a&gt;&lt;/a&gt;Why it's not stealing our developer jobs
&lt;/h2&gt;

&lt;p&gt;So when this GitHub Copilot is doing all our work, is it stealing our jobs?&lt;/p&gt;

&lt;p&gt;Do we still need people to program? Do we still need human beings for web and&lt;br&gt;
software development?&lt;/p&gt;



&lt;p&gt;Of course this is a highly philosophical and controversial questions because it&lt;br&gt;
points into the direction of "Can AI take over?".&lt;/p&gt;

&lt;p&gt;I'm no expert in AI at all and in no means can I answer this questions. &lt;strong&gt;But I&lt;br&gt;
know that GitHub Copilot will not steal our jobs&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;I know this could sound naive and maybe in a few years we're all unemployed and&lt;br&gt;
you can tell me: "I told you so". But I strongly believe that this is not the&lt;br&gt;
case.&lt;/p&gt;

&lt;p&gt;My assumption is, that &lt;strong&gt;AIs like GitHub Copilot will help and support us&lt;/strong&gt;.&lt;br&gt;
They will make our lives easer. But this doesn't mean we won't have jobs&lt;br&gt;
anymore.&lt;/p&gt;

&lt;p&gt;This means we have more time to care for the more complex and bigger problems,&lt;br&gt;
we claim to solve with web and software development.&lt;/p&gt;

&lt;p&gt;This means we can solve some tasks faster and have more energy for higher&lt;br&gt;
obstacles.&lt;/p&gt;

&lt;p&gt;In the end a human being is always needed to point something like GitHub Copilot&lt;br&gt;
into a certain direction. We have to tell it what kind of function we want to&lt;br&gt;
write, to solve this problem in a certain way.&lt;/p&gt;

&lt;p&gt;The &lt;strong&gt;creativity&lt;/strong&gt; comes from us, that's one of humans biggest strengths. I know&lt;br&gt;
that AI can become creative too, as we've seen with numerous examples of AI&lt;br&gt;
creating art and music.&lt;/p&gt;

&lt;p&gt;But I strongly believe that the best outcome will always be achieved &lt;strong&gt;when&lt;br&gt;
humans and AI work together&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;We're still at the very beginning and GitHub Copilot will learn more and more&lt;br&gt;
about how we program. I'm very excited how this turns out.&lt;/p&gt;

&lt;p&gt;This blog post was originally published on &lt;a href="https://marcokuehbauch.com/blog/github-copilot/"&gt;marcokuehbauch.com&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Head over there to let me know what you think and share it with others!&lt;/p&gt;

&lt;p&gt;You can also find me on Twitter at &lt;a href="https://twitter.com/Mkuehb"&gt;@mkuehb&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>github</category>
      <category>javascript</category>
      <category>react</category>
    </item>
    <item>
      <title>The most important things I learned from my colleagues working in web development - part 1</title>
      <dc:creator>Marco Kühbauch</dc:creator>
      <pubDate>Wed, 17 Mar 2021 16:26:29 +0000</pubDate>
      <link>https://dev.to/mkuehb/the-most-important-things-i-learned-from-my-colleagues-working-in-web-development-part-1-971</link>
      <guid>https://dev.to/mkuehb/the-most-important-things-i-learned-from-my-colleagues-working-in-web-development-part-1-971</guid>
      <description>&lt;p&gt;I call myself extremely lucky. I had and still have the opportunity to work together with some &lt;strong&gt;extraordinary human beings.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;They helped me and others to &lt;strong&gt;grow&lt;/strong&gt; and get better at what we're doing. Not only in technical matters but also in soft skills.&lt;/p&gt;

&lt;p&gt;This blog post is for me. To always remind me about the most important things I learned from my colleagues working in the web development industry. And maybe you can take away something from it, too.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What you can learn from this blog post:&lt;/strong&gt;&lt;/p&gt;




&lt;ul&gt;
&lt;li&gt;We write code for humans, not machines&lt;/li&gt;
&lt;li&gt;It's always we - not you alone&lt;/li&gt;
&lt;li&gt;Seniority has nothing to do with age&lt;/li&gt;
&lt;li&gt;No finger pointing&lt;/li&gt;
&lt;li&gt;Underpromise - overdeliver&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  &lt;a&gt;&lt;/a&gt; We write code for humans, not machines
&lt;/h3&gt;

&lt;p&gt;Do you know that feeling when you used a cool feature of your favorite programming language? Or refactored a long function? Or turned a long function into a one liner?&lt;/p&gt;

&lt;p&gt;And do you also know the feeling of coming back to this code after a few weeks and &lt;strong&gt;not understanding a single thing&lt;/strong&gt; that is happening there?&lt;/p&gt;

&lt;p&gt;You might have had good intentions– improving the code base. But if you don't put much thought into it and just refactor something because one-line functions are "cool and smart", you're making things &lt;strong&gt;worse&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Imagine how this must feel for your fellow co-workers who didn't even write the code. They need a lot of &lt;strong&gt;mental processing&lt;/strong&gt; to follow along here.&lt;/p&gt;

&lt;p&gt;So always remember: &lt;strong&gt;we write code for humans, not for machines.&lt;/strong&gt; I know in the end it's the machine who compiles and runs the code. But for the most part, code should be &lt;strong&gt;human readable.&lt;/strong&gt; It should be written for humans so other humans can understand, change and improve your code.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;a&gt;&lt;/a&gt; It's always we - not you alone
&lt;/h3&gt;

&lt;p&gt;We are a team. We work together as a team and the code, the products, the features we release are the result of this team work. Nobody is responsible for something alone. Its always a &lt;strong&gt;team effort.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;I know how it feels to implement a whole new feature by yourself and you feel the urge to tell everyone about it. That's just your ego talking.&lt;/p&gt;

&lt;p&gt;Of course you can be proud of yourself. Celebrate yourself, acknowledge what your capable of.&lt;/p&gt;

&lt;p&gt;But don't forget the work of your teammates that also played a major role in it. From the conception of the feature to the design, the code review to the testing. It's always a "we did this together".&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;a&gt;&lt;/a&gt; Seniority has nothing to do with age
&lt;/h3&gt;

&lt;p&gt;When I started working in web development I was often under a certain impression. I thought that after working for a few years in this area you &lt;strong&gt;automatically&lt;/strong&gt; turn into a &lt;strong&gt;senior developer.&lt;/strong&gt; You get this shiny new title, more money and more respect.&lt;/p&gt;

&lt;p&gt;It took me a while until I figured out, that this is &lt;strong&gt;not how it works.&lt;/strong&gt; Just because you're growing older doesn't mean you become a senior. There is so much more to seniority than just age.&lt;/p&gt;

&lt;p&gt;For me personally getting to a senior level means, developing into a specific person. A person who can &lt;strong&gt;teach&lt;/strong&gt;, &lt;strong&gt;motivate&lt;/strong&gt; and get the best out of all their team members. Who has a lot of experience but doesn't brag about it.&lt;/p&gt;

&lt;p&gt;Who can &lt;strong&gt;lead&lt;/strong&gt; others and also &lt;strong&gt;follow&lt;/strong&gt; their advice. Who has a lot of ideas, opinions but also acknowledges others and can admit when they are &lt;strong&gt;wrong&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;It's a person you want to &lt;strong&gt;look up to.&lt;/strong&gt; A person you look forward to &lt;strong&gt;learn&lt;/strong&gt; more from everyday. And became someone like them eventually.&lt;/p&gt;

&lt;p&gt;These are just a few facts and this description only &lt;strong&gt;scratches the surface&lt;/strong&gt;. My good friend Dom wrote a fantastic blog post on this topic:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://islovely.co/posts/how-to-go-from-junior-to-senior-developer"&gt;https://islovely.co/posts/how-to-go-from-junior-to-senior-developer&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;I have one planned too on the senior subject, so make sure to check-in again in a few weeks!&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;a&gt;&lt;/a&gt; No finger pointing
&lt;/h3&gt;

&lt;p&gt;When things go wrong and you know your colleague messed up, it's super easy to point at them and shout "they did this, they are responsible"! Don't be that person. It's &lt;strong&gt;not helpful&lt;/strong&gt; in any way.&lt;/p&gt;

&lt;p&gt;Of course you need to find solutions for problems and figure out everything that lead to a specific outcome. But pointing at someone and blame them is the &lt;strong&gt;wrong way&lt;/strong&gt; to handle it.&lt;/p&gt;

&lt;p&gt;Why? It's the same I already wrote about above in "It's always we - not you alone". We are a team and we are always responsible for things as a team, no matter if it's about success or failure.&lt;/p&gt;

&lt;p&gt;When we know that someone contributed to a problem we can talk to them, help them to improve and tell them what to do next time, so it doesn't happen again.&lt;/p&gt;

&lt;p&gt;Fixing problems always works better without finger pointing.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;a&gt;&lt;/a&gt; Underpromise - overdeliver
&lt;/h3&gt;

&lt;p&gt;When I started as a web developer I was always super proud of the things I did. And I always wanted to show people what kind of cool things I could make.&lt;/p&gt;

&lt;p&gt;This also led to the thing that I could not make &lt;strong&gt;realistic estimates.&lt;/strong&gt; I always wanted to make something super cool and shiny at all costs.&lt;/p&gt;

&lt;p&gt;So if someone suggested to build a specific feature and I loved the idea, I would want to build it without actually thinking about the real effort and time it would take. I just wanted to do it.&lt;/p&gt;

&lt;p&gt;Maybe I already knew from the start that it could take much longer than expected. But I wanted to ignore that fact and make everyone proud.&lt;/p&gt;

&lt;p&gt;Sooner or later I came to the conclusion that this wasn't helpful. If you promise something and can't deliver, you have to break your promise.&lt;/p&gt;

&lt;p&gt;It's way easier and healthier to under promise.&lt;/p&gt;

&lt;p&gt;And if all goes well and you have more time for something than expected you still can over deliver.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;These are the first 5 things I learned from my colleagues working in web development. This is part one of a series, so stay tuned for more!&lt;/strong&gt;&lt;/p&gt;

</description>
      <category>devjournal</category>
      <category>career</category>
      <category>motivation</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Getting started with golang - a beginners introduction to programming in go</title>
      <dc:creator>Marco Kühbauch</dc:creator>
      <pubDate>Fri, 26 Feb 2021 20:00:52 +0000</pubDate>
      <link>https://dev.to/mkuehb/getting-started-with-golang-a-beginners-introduction-to-programming-in-go-1n2h</link>
      <guid>https://dev.to/mkuehb/getting-started-with-golang-a-beginners-introduction-to-programming-in-go-1n2h</guid>
      <description>&lt;h3&gt;
  
  
  How I got to know go
&lt;/h3&gt;

&lt;blockquote&gt;
&lt;p&gt;"Wait, what? What's happening here? Your previous blog posts were all about frontend development, CSS JavaScript, React. Now this..go? What is it? And why are you blogging about it?"&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;If this new content on my blog confuses you a little, I'm sorry! A lot of new things happened to me in the last months and one of them is, that I'm &lt;strong&gt;taking a closer look&lt;/strong&gt; on both (all?) sides of web development. Which includes working with and learning more about &lt;strong&gt;backend technologies&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;My first contact with everything else than frontend was in a project were we worked with &lt;strong&gt;NodeJS/Express&lt;/strong&gt; and &lt;strong&gt;MongoDB&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;This granted me a lof ot knowledge on how all parts of a web application work together. &lt;strong&gt;From the frontend, to API Calls, middlewares, services, raw SQL and to the database&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;In the project I'm working in right now, we're using &lt;strong&gt;go&lt;/strong&gt; in the backend and therefore I'm learning go!&lt;/p&gt;

&lt;p&gt;And to make the most of it I will &lt;strong&gt;document&lt;/strong&gt; everything I learn about go in this blog post. So I have a place to come back to and look at when I forget everything.&lt;/p&gt;

&lt;p&gt;And maybe you can learn something from it too!&lt;/p&gt;

&lt;h2&gt;
  
  
  So...go. What is it?
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;p&gt;Go is an open source programming language that makes it easy to build simple, reliable, and efficient software.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;At least that's what it says about itself on its website. Let's see what wikipeda has to say about go:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Go is a statically typed, compiled programming language designed at Google by Robert Griesemer, Rob Pike, and Ken Thompson. Go is syntactically similar to C, but with memory safety, garbage collection, structural typing, and CSP-style concurrency. The language is often referred to as Golang because of its domain name, &lt;a href="http://golang.org/"&gt;golang.org&lt;/a&gt;, but the proper name is Go.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Ah that tells a bit more about it. Interesting! Now that we are behind the get to know each other phase, let's see what &lt;strong&gt;topics&lt;/strong&gt; I'll cover in this blog post. As the title says it will be an absolute beginner introduction.&lt;/p&gt;

&lt;p&gt;If I'm wrong about something or made mistakes, please let me know!&lt;/p&gt;

&lt;h2&gt;
  
  
  What you can learn from this blog post:
&lt;/h2&gt;




&lt;ul&gt;
&lt;li&gt;packages, import, export&lt;/li&gt;
&lt;li&gt;Variables&lt;/li&gt;
&lt;li&gt;Functions&lt;/li&gt;
&lt;li&gt;Data types&lt;/li&gt;
&lt;li&gt;for&lt;/li&gt;
&lt;li&gt;if, else&lt;/li&gt;
&lt;li&gt;switch&lt;/li&gt;
&lt;li&gt;struct&lt;/li&gt;
&lt;li&gt;arrays&lt;/li&gt;
&lt;li&gt;slices&lt;/li&gt;
&lt;li&gt;range&lt;/li&gt;
&lt;li&gt;map&lt;/li&gt;
&lt;li&gt;method&lt;/li&gt;
&lt;li&gt;pointers&lt;/li&gt;
&lt;li&gt;pointer receivers&lt;/li&gt;
&lt;li&gt;interfaces&lt;/li&gt;
&lt;li&gt;errors&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  &lt;a&gt;&lt;/a&gt;packages, import, export
&lt;/h2&gt;

&lt;p&gt;Every go program is made up of packages. You always have to have a &lt;strong&gt;main package&lt;/strong&gt;, where your app starts. You can &lt;strong&gt;import&lt;/strong&gt; your own packages or one of the hundreds of go packages.&lt;/p&gt;

&lt;p&gt;A name (of a function, struct etc) is &lt;strong&gt;exported&lt;/strong&gt; and therefore can be imported if it begins with a capital letter.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight go"&gt;&lt;code&gt;&lt;span class="k"&gt;package&lt;/span&gt; &lt;span class="n"&gt;main&lt;/span&gt;

&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="s"&gt;"fmt"&lt;/span&gt;
    &lt;span class="s"&gt;"math"&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="c"&gt;// is not exported&lt;/span&gt;
&lt;span class="k"&gt;func&lt;/span&gt; &lt;span class="n"&gt;main&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;PrintStr&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="c"&gt;// can be imported from other packages in your app&lt;/span&gt;
&lt;span class="k"&gt;func&lt;/span&gt; &lt;span class="n"&gt;PrintStr&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;fmt&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Printf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Hello World"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;fmt&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Println&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;math&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Pi&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  &lt;a&gt;&lt;/a&gt; Variables
&lt;/h2&gt;

&lt;p&gt;There are several ways to declare variables in go. The classic &lt;code&gt;var&lt;/code&gt; lets you declare one or more variables at once. The &lt;code&gt;const&lt;/code&gt; lets you declare constant variables. The &lt;code&gt;:=&lt;/code&gt; shorthand lets you declare and initialize a variable at once inside a function.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight go"&gt;&lt;code&gt;&lt;span class="k"&gt;var&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="m"&gt;10&lt;/span&gt;
&lt;span class="k"&gt;const&lt;/span&gt; &lt;span class="m"&gt;1&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="m"&gt;10&lt;/span&gt;

&lt;span class="c"&gt;// shorthand for declaring and initializing a a variable inside a function&lt;/span&gt;
&lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="m"&gt;10&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  &lt;a&gt;&lt;/a&gt; Functions
&lt;/h2&gt;

&lt;p&gt;A function in go can take &lt;strong&gt;zero or more arguments&lt;/strong&gt;. The type of the input parameter comes after the variable name. When the parameters have the same type you can combine the type declaration.&lt;/p&gt;

&lt;p&gt;The input parameters are followed by the return type.&lt;/p&gt;

&lt;p&gt;A function can return any number of results. In go explizit returns are required.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight go"&gt;&lt;code&gt;&lt;span class="k"&gt;func&lt;/span&gt; &lt;span class="n"&gt;multiply&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="n"&gt;multiply&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="m"&gt;3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;6&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  &lt;a&gt;&lt;/a&gt; Data types
&lt;/h2&gt;

&lt;p&gt;Surprise, surprise go has values like boolean, strings and integer. Here's a list of all of them.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight go"&gt;&lt;code&gt;&lt;span class="kt"&gt;bool&lt;/span&gt;

&lt;span class="kt"&gt;string&lt;/span&gt;

&lt;span class="kt"&gt;int&lt;/span&gt;  &lt;span class="kt"&gt;int8&lt;/span&gt;  &lt;span class="kt"&gt;int16&lt;/span&gt;  &lt;span class="kt"&gt;int32&lt;/span&gt;  &lt;span class="kt"&gt;int64&lt;/span&gt;
&lt;span class="kt"&gt;uint&lt;/span&gt; &lt;span class="kt"&gt;uint8&lt;/span&gt; &lt;span class="kt"&gt;uint16&lt;/span&gt; &lt;span class="kt"&gt;uint32&lt;/span&gt; &lt;span class="kt"&gt;uint64&lt;/span&gt; &lt;span class="kt"&gt;uintptr&lt;/span&gt;

&lt;span class="kt"&gt;byte&lt;/span&gt; &lt;span class="c"&gt;// alias for uint8&lt;/span&gt;

&lt;span class="kt"&gt;rune&lt;/span&gt; &lt;span class="c"&gt;// alias for int32&lt;/span&gt;
     &lt;span class="c"&gt;// represents a Unicode code point&lt;/span&gt;

&lt;span class="kt"&gt;float32&lt;/span&gt; &lt;span class="kt"&gt;float64&lt;/span&gt;

&lt;span class="kt"&gt;complex64&lt;/span&gt; &lt;span class="kt"&gt;complex128&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Variables declared without an initial value are given their zero value:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;0&lt;/code&gt; for numeric types,&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;false&lt;/code&gt; for the boolean type, and&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;""&lt;/code&gt; (the empty string) for strings&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  &lt;a&gt;&lt;/a&gt; for
&lt;/h2&gt;

&lt;p&gt;Coming from TypeScript, there is no such thing as the array methods map, reduce or filter in go. The for loop is all you have.&lt;/p&gt;

&lt;p&gt;A for loop consists of the following:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;an &lt;strong&gt;init&lt;/strong&gt; statement; condition expression; &lt;strong&gt;post&lt;/strong&gt; statement&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;There is no need for &lt;strong&gt;parenthesis&lt;/strong&gt; surrounding the three components. The init and post statements are &lt;strong&gt;optional&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;The for loop can also be used as while().&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight go"&gt;&lt;code&gt;&lt;span class="k"&gt;var&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="m"&gt;10&lt;/span&gt;

&lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;++&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  &lt;a&gt;&lt;/a&gt; if, else
&lt;/h2&gt;

&lt;p&gt;If, else is pretty straight forward in go. No parenthesis are needing surrounding the condition.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight go"&gt;&lt;code&gt;&lt;span class="k"&gt;var&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="m"&gt;10&lt;/span&gt;

&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="m"&gt;9&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;fmt&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Println&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  &lt;a&gt;&lt;/a&gt; switch
&lt;/h2&gt;

&lt;p&gt;A switch in go only runs the selected case, not all cases that follow. The default case is &lt;strong&gt;optional&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;The break statement is provided automatically.&lt;/p&gt;

&lt;p&gt;You can combine expressions in the same case by using comma separation.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight go"&gt;&lt;code&gt;&lt;span class="k"&gt;switch&lt;/span&gt; &lt;span class="n"&gt;time&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Now&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Weekday&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;case&lt;/span&gt; &lt;span class="n"&gt;time&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Saturday&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;time&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Sunday&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;
        &lt;span class="n"&gt;fmt&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Println&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"It's the weekend"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;default&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;
        &lt;span class="n"&gt;fmt&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Println&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"It's a weekday"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  &lt;a&gt;&lt;/a&gt; struct
&lt;/h2&gt;

&lt;p&gt;A struct is a typed collection of fields. Structs are &lt;strong&gt;mutable&lt;/strong&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight go"&gt;&lt;code&gt;&lt;span class="k"&gt;type&lt;/span&gt; &lt;span class="n"&gt;server&lt;/span&gt; &lt;span class="k"&gt;struct&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;host&lt;/span&gt;          &lt;span class="kt"&gt;string&lt;/span&gt;
    &lt;span class="n"&gt;port&lt;/span&gt;          &lt;span class="kt"&gt;string&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="n"&gt;server&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="s"&gt;"localhost"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"8080"&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;type&lt;/span&gt; &lt;span class="n"&gt;person&lt;/span&gt; &lt;span class="k"&gt;struct&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;name&lt;/span&gt; &lt;span class="kt"&gt;string&lt;/span&gt;
    &lt;span class="n"&gt;age&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="n"&gt;person&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="s"&gt;"Marco"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;age&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="m"&gt;29&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  &lt;a&gt;&lt;/a&gt; arrays
&lt;/h2&gt;

&lt;p&gt;Arrays are numbered sequences of elements of a specific length.&lt;/p&gt;

&lt;p&gt;The following creates a variable a as an array of 10 integers.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight go"&gt;&lt;code&gt;&lt;span class="k"&gt;var&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="m"&gt;10&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In go arrays can not be resized, because the length is part of the type.&lt;/p&gt;

&lt;p&gt;The built-in &lt;strong&gt;len&lt;/strong&gt; method returns the length of an array.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight go"&gt;&lt;code&gt;&lt;span class="k"&gt;var&lt;/span&gt; &lt;span class="n"&gt;names&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="m"&gt;3&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="kt"&gt;string&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="s"&gt;"Tim"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"Mandy"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"Stefanie"&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="nb"&gt;len&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;names&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="c"&gt;// 2&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  &lt;a&gt;&lt;/a&gt; slices
&lt;/h2&gt;

&lt;p&gt;Unlike arrays, slices have no specified length, so they are dynamically sized. They are build on arrays but are more powerful and therefore more used than arrays in go.&lt;/p&gt;

&lt;p&gt;To create &lt;strong&gt;dynamically&lt;/strong&gt; sized arrays (slices), you can use the &lt;strong&gt;make&lt;/strong&gt; function.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight go"&gt;&lt;code&gt;&lt;span class="c"&gt;// slice of type in with length 5&lt;/span&gt;
&lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="nb"&gt;make&lt;/span&gt;&lt;span class="p"&gt;([]&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;5&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="c"&gt;// slice of type string with length 3&lt;/span&gt;
&lt;span class="n"&gt;s&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="nb"&gt;make&lt;/span&gt;&lt;span class="p"&gt;([]&lt;/span&gt;&lt;span class="kt"&gt;string&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;3&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Slices can also be build by slicing an existing array or slice. In the following example, a slice is formed on the numbers array by specifying two indices, a low and high bound.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight go"&gt;&lt;code&gt;&lt;span class="c"&gt;// array&lt;/span&gt;
&lt;span class="n"&gt;numbers&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="m"&gt;5&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;4&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;5&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="c"&gt;// slice of numbers array&lt;/span&gt;
&lt;span class="n"&gt;specificNumbers&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="n"&gt;names&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;&lt;span class="m"&gt;3&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Its also possible to create &lt;strong&gt;slices of slices.&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight go"&gt;&lt;code&gt;&lt;span class="n"&gt;board&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="p"&gt;[][]&lt;/span&gt;&lt;span class="kt"&gt;string&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="p"&gt;[]&lt;/span&gt;&lt;span class="kt"&gt;string&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="s"&gt;"_"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"_"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"_"&lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;
        &lt;span class="p"&gt;[]&lt;/span&gt;&lt;span class="kt"&gt;string&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="s"&gt;"_"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"_"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"_"&lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;
        &lt;span class="p"&gt;[]&lt;/span&gt;&lt;span class="kt"&gt;string&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="s"&gt;"_"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"_"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"_"&lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To enhance a slice, you can use the &lt;strong&gt;append&lt;/strong&gt; function. This is one example of what makes slices more powerful than arrays. Append returns a slice with one or more new values.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight go"&gt;&lt;code&gt;&lt;span class="k"&gt;var&lt;/span&gt; &lt;span class="n"&gt;s&lt;/span&gt; &lt;span class="p"&gt;[]&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt;

&lt;span class="nb"&gt;append&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;4&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;5&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Slices can also be &lt;strong&gt;copied&lt;/strong&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight go"&gt;&lt;code&gt;&lt;span class="n"&gt;s&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="nb"&gt;make&lt;/span&gt;&lt;span class="p"&gt;([]&lt;/span&gt;&lt;span class="kt"&gt;string&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;5&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"H"&lt;/span&gt;
&lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"e"&lt;/span&gt;
&lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="m"&gt;2&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"l"&lt;/span&gt;
&lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="m"&gt;3&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"l"&lt;/span&gt;
&lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="m"&gt;4&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"o"&lt;/span&gt;

&lt;span class="n"&gt;c&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="nb"&gt;make&lt;/span&gt;&lt;span class="p"&gt;([]&lt;/span&gt;&lt;span class="kt"&gt;string&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;5&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="nb"&gt;copy&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;c&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;








&lt;h2&gt;
  
  
  &lt;a&gt;&lt;/a&gt; map
&lt;/h2&gt;

&lt;p&gt;A map is combination of key value pairs. In other languages it's often called dictionary.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight go"&gt;&lt;code&gt;&lt;span class="c"&gt;// creates an empty map of string - int key - value pairs&lt;/span&gt;
&lt;span class="n"&gt;m&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="nb"&gt;make&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;map&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="kt"&gt;string&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="c"&gt;// sets an the key "age" with the value of 29&lt;/span&gt;
&lt;span class="n"&gt;m&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s"&gt;"age"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="m"&gt;29&lt;/span&gt;

&lt;span class="c"&gt;// deletes an element of a map&lt;/span&gt;
&lt;span class="nb"&gt;delete&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;m&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"age"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  &lt;a&gt;&lt;/a&gt; range
&lt;/h2&gt;

&lt;p&gt;To iterate over a map or a slice you can use &lt;strong&gt;range&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;It returns two values: index and a copy of the element at that index.&lt;/p&gt;

&lt;p&gt;The index or value can be skipped by using &lt;code&gt;_&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight go"&gt;&lt;code&gt;&lt;span class="n"&gt;numbers&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="p"&gt;[]&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;4&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;5&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;num&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="k"&gt;range&lt;/span&gt; &lt;span class="n"&gt;numbers&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;fmt&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Printf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;num&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  &lt;a&gt;&lt;/a&gt; method
&lt;/h2&gt;

&lt;p&gt;A method is a function with a special &lt;strong&gt;receiver argument&lt;/strong&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight go"&gt;&lt;code&gt;&lt;span class="k"&gt;type&lt;/span&gt; &lt;span class="n"&gt;Server&lt;/span&gt; &lt;span class="k"&gt;struct&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;host&lt;/span&gt;          &lt;span class="kt"&gt;string&lt;/span&gt;
    &lt;span class="n"&gt;port&lt;/span&gt;          &lt;span class="kt"&gt;string&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="n"&gt;function&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;s&lt;/span&gt; &lt;span class="n"&gt;Server&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;printServer&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;fmt&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Printf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;See that we pass the Server as s as a &lt;strong&gt;receiver&lt;/strong&gt; argument to the &lt;code&gt;printServer&lt;/code&gt; function before we the function name declaration?&lt;/p&gt;

&lt;p&gt;Everything inside the function body has now &lt;strong&gt;access&lt;/strong&gt; to the members of the struct.&lt;/p&gt;




&lt;h2&gt;
  
  
  &lt;a&gt;&lt;/a&gt; pointers
&lt;/h2&gt;

&lt;p&gt;Pointers hold the &lt;strong&gt;memory address&lt;/strong&gt; of a value.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight go"&gt;&lt;code&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;:=&lt;/span&gt; &lt;span class="m"&gt;42&lt;/span&gt;

&lt;span class="c"&gt;// generate a pointer to i&lt;/span&gt;
&lt;span class="n"&gt;p&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;

&lt;span class="c"&gt;// read i through the pointer p&lt;/span&gt;
&lt;span class="n"&gt;fmt&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Prinln&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;p&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  &lt;a&gt;&lt;/a&gt; pointer receivers
&lt;/h2&gt;

&lt;p&gt;Methods can be declared with pointer receivers.&lt;/p&gt;

&lt;p&gt;The differences between pointer receivers and value receivers are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;pointer receivers can modify the value to which the receiver points&lt;/li&gt;
&lt;li&gt;with pointer receivers you can avoid copying the value on each method call&lt;/li&gt;
&lt;li&gt;sending the value of the variable to the function, but not the variable itself&lt;/li&gt;
&lt;li&gt;the value of the variable isn’t passed to the function, just its location&lt;/li&gt;
&lt;li&gt;pointers are adresses to a particular place in memory
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight go"&gt;&lt;code&gt;&lt;span class="k"&gt;type&lt;/span&gt; &lt;span class="n"&gt;Server&lt;/span&gt; &lt;span class="k"&gt;struct&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;host&lt;/span&gt;          &lt;span class="kt"&gt;string&lt;/span&gt;
    &lt;span class="n"&gt;port&lt;/span&gt;          &lt;span class="kt"&gt;string&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="n"&gt;function&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;s&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;Server&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;printServer&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;fmt&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Printf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Pointers and pointer receivers are little bit more &lt;strong&gt;advanced topic&lt;/strong&gt; but it's good to have heard of them as a beginner.&lt;/p&gt;




&lt;h2&gt;
  
  
  &lt;a&gt;&lt;/a&gt; interfaces
&lt;/h2&gt;

&lt;p&gt;Interfaces are &lt;strong&gt;named collections&lt;/strong&gt; of method signatures. To implement an interface you just need to implement all methods in the interface.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight go"&gt;&lt;code&gt;&lt;span class="k"&gt;type&lt;/span&gt; &lt;span class="k"&gt;interface&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;methodOne&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt;
    &lt;span class="n"&gt;methodTwo&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;func&lt;/span&gt; &lt;span class="n"&gt;methodOne&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="p"&gt;{}&lt;/span&gt;

&lt;span class="k"&gt;func&lt;/span&gt; &lt;span class="n"&gt;methodTwo&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="p"&gt;{}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  &lt;a&gt;&lt;/a&gt; errors
&lt;/h2&gt;

&lt;p&gt;A &lt;strong&gt;nil&lt;/strong&gt; value in the error position indicates that there was no error.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="nx"&gt;err&lt;/span&gt; &lt;span class="o"&gt;!=&lt;/span&gt; &lt;span class="nx"&gt;nil&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="c1"&gt;// log the error&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Calling code should handle errors by &lt;strong&gt;testing&lt;/strong&gt; whether the error equals nil.&lt;/p&gt;

&lt;p&gt;And that is it, these are the &lt;strong&gt;programming with go beginner topics&lt;/strong&gt; I came across the last weeks and months while learning and working with go. I hope you like it!&lt;/p&gt;

&lt;p&gt;Did you know everything already or did you learn something new? Do you have other great examples? Let me know!&lt;/p&gt;

&lt;p&gt;You can send me an &lt;a href="//mailto:marcokuehbauch@gmail.com"&gt;email&lt;/a&gt; or message me on &lt;a href="https://twitter.com/Mkuehb"&gt;Twitter&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Resources:
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://gobyexample.com/"&gt;https://gobyexample.com/&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://blog.golang.org/slices-intro"&gt;https://blog.golang.org/slices-intro&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>beginners</category>
      <category>programming</category>
      <category>go</category>
    </item>
    <item>
      <title>🚀 React performance quick wins 🚀 - 7 easy ways to improve your React performance - part 2</title>
      <dc:creator>Marco Kühbauch</dc:creator>
      <pubDate>Sat, 23 Jan 2021 16:24:51 +0000</pubDate>
      <link>https://dev.to/mkuehb/react-performance-quick-wins-7-easy-ways-to-improve-your-react-performance-part-2-4j3c</link>
      <guid>https://dev.to/mkuehb/react-performance-quick-wins-7-easy-ways-to-improve-your-react-performance-part-2-4j3c</guid>
      <description>&lt;p&gt;In part 1 of this react performance quickwins series, we already learned about:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;
    &lt;a href="https://marcoheine.com/blog/7-easy-ways-to-improve-your-react-performance-part-1/#keys"&gt;Always use a key when mapping (and not index)&lt;/a&gt;
  &lt;/li&gt;
  &lt;li&gt;
   &lt;a href="https://marcoheine.com/blog/7-easy-ways-to-improve-your-react-performance-part-1/#fragments"&gt;Use React.Fragments instead of divs as parent element&lt;/a&gt;
  &lt;/li&gt;
  &lt;a href="https://marcoheinecom/blog/7-easy-ways-to-improve-your-react-performance-part-1/#useState"&gt;One useState hook instead of multiple for connected data&lt;/a&gt;
&lt;/ul&gt;

&lt;p&gt;The second part of this series brings you another &lt;strong&gt;4 great quickwins&lt;/strong&gt; you can apply directly to your code and improve your performance&lt;/p&gt;

&lt;p&gt;This Post is Part 2 of a series.&lt;/p&gt;

&lt;p&gt;Part 1: &lt;a href="https://marcokheine.com/blog/7-easy-ways-to-improve-your-react-performance-part-1"&gt;🚀 React performance quick wins 🚀 - 7 easy ways to improve your React performance - part 1&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What you can learn from Part 2 of this React performance quick wins series:&lt;/strong&gt;&lt;/p&gt;




&lt;ul&gt;
&lt;li&gt;Avoid anonymous functions&lt;/li&gt;
&lt;li&gt;Define objects outside of your component&lt;/li&gt;
&lt;li&gt;React.lazy and React.Suspense&lt;/li&gt;
&lt;li&gt;Virtualized lists&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  &lt;a&gt;&lt;/a&gt;Avoid anonymous functions
&lt;/h2&gt;

&lt;p&gt;It's easy to use an anonymous function when you want to add a quick callback function to a component.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="nx"&gt;React&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;react&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;MyComponent&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;button&lt;/span&gt; &lt;span class="na"&gt;onClick&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Button clicked&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;Click me!&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;button&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="nx"&gt;MyComponent&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;But if you're on the lookout for a quick performance win, that's something you can avoid.&lt;/p&gt;

&lt;p&gt;Anonymous functions aren’t assigned an identifier like const/let/var. This means they &lt;strong&gt;are not persistent&lt;/strong&gt; whenever this functional component gets rendered again. So JavaScript has to &lt;strong&gt;create them again and again&lt;/strong&gt; on every re-render.&lt;/p&gt;

&lt;p&gt;This becomes a problem, if you're rendering a loooot of elements, like a lot of table cells, which all make use of an anonymous function.&lt;/p&gt;

&lt;p&gt;There is an easy way to solve this. You can simply change it to a &lt;strong&gt;named function&lt;/strong&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="nx"&gt;React&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;react&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;MyComponent&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;handleClick&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Button clicked&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="p"&gt;};&lt;/span&gt;

  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;button&lt;/span&gt; &lt;span class="na"&gt;onClick&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;handleClick&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;Click me!&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;button&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;;&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="nx"&gt;MyComponent&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That's it for quickwin number 4: avoid anonymous functions!&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;a&gt;&lt;/a&gt;Define objects outside of your component
&lt;/h2&gt;

&lt;p&gt;Here comes quickwin number 5. Something similar as described above can be applied to objects.&lt;/p&gt;

&lt;p&gt;If you define an object as a object literal and pass it in as props, this object will have to be recreated on every rerender.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="nx"&gt;React&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;react&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;MyComponent&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;div&lt;/span&gt; &lt;span class="na"&gt;style&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;textAlign&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;center&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;fontSize&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;14px&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
      This is the text of my component.
    &lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;div&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="nx"&gt;MyComponent&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Instead define your object outside of the component. Now it is created once on the initial render and not being touched on every rerender.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="nx"&gt;React&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;react&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;DIV_STYLES&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="na"&gt;fontSize&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;14px&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;textAlign&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;center&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;MyComponent&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;div&lt;/span&gt; &lt;span class="na"&gt;style&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;DIV_STYLES&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;This is the text of my component.&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;div&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;;&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="nx"&gt;MyComponent&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Performance quickwin whoop whoop! 🚀&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;a&gt;&lt;/a&gt;React.lazy and React.Suspense
&lt;/h2&gt;

&lt;p&gt;With &lt;code&gt;React.lazy&lt;/code&gt; you can "lazy load" your components. This means your component is only rendered when it is truly needed and not loaded unnecessarily.&lt;/p&gt;

&lt;p&gt;The less you need to load, the better your performance!&lt;/p&gt;

&lt;p&gt;This can easily be combined with React.Suspense for rendering some fallback content.&lt;/p&gt;

&lt;p&gt;I wrote a whole Today-I-learned post about this topic, check it out here: &lt;a href="https://marcokuehbauch.com/today-I-learned/react-suspense-lazy-loading"&gt;Today I learned: React Suspense lazy-loading&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;That's also a great way to improve your react performance without too much effort.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;a&gt;&lt;/a&gt;Virtualized lists
&lt;/h2&gt;

&lt;p&gt;If you've ever worked with long lists or tables with a lot of rows in React you know how much this can impact your performance. You have to render a lot of content, usually a lot of divs.&lt;/p&gt;

&lt;p&gt;We already learned that too much DOM nodes is not a good idea. Also updates and rerenders can be really painful because they take just way too long.&lt;/p&gt;

&lt;p&gt;With virtualized lists only the list items get rendered, that are actually in the viewport. That's pretty cool. But how does this work? Don't worry, you won't have to build this yourself. There are already amazing tools out there which do the job for you.&lt;/p&gt;

&lt;p&gt;Check out &lt;a href="https://github.com/bvaughn/react-virtualized"&gt;react-virtualized&lt;/a&gt; by Brian Vaughn.&lt;/p&gt;

&lt;p&gt;It's pretty easy to use and you don't need to worry about displaying long lists and tables anymore.&lt;/p&gt;

&lt;p&gt;So that's it, these are my &lt;strong&gt;7 easy ways to improve your React performance&lt;/strong&gt;. Did you already know all of them? Do you have any additional tips? Let me know!&lt;/p&gt;

&lt;p&gt;Just send me an &lt;a href="//mailto:marcoheine08@gmail.com"&gt;email&lt;/a&gt; or message me on &lt;a href="https://twitter.com/marcoheine_com"&gt;Twitter&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>react</category>
      <category>performance</category>
      <category>javascript</category>
    </item>
    <item>
      <title>🚀 React performance quick wins 🚀 - 7 easy ways to improve your React performance - part 1</title>
      <dc:creator>Marco Kühbauch</dc:creator>
      <pubDate>Fri, 13 Nov 2020 15:22:40 +0000</pubDate>
      <link>https://dev.to/mkuehb/react-performance-quick-wins-7-easy-ways-to-improve-your-react-performance-part-1-2433</link>
      <guid>https://dev.to/mkuehb/react-performance-quick-wins-7-easy-ways-to-improve-your-react-performance-part-1-2433</guid>
      <description>&lt;p&gt;At the beginning of the year I wrote a blog post about &lt;a href="https://marcokuehbauch.com/blog/react-performance-improvements/"&gt;React performance improvements&lt;/a&gt;. It‘s one of my favourite blog posts I ever wrote. It’s a great example of &lt;strong&gt;documenting everything while you learn it&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;It’s a very in depth analysis. It shows you how to &lt;strong&gt;test and measure&lt;/strong&gt; the performance of your React application and a lot of ways how to improve it.&lt;/p&gt;

&lt;p&gt;In the contrary this blog post has the goal to give you a lot of &lt;strong&gt;quick wins&lt;/strong&gt; for your performance. Things you can change and adjust, without too much effort.&lt;/p&gt;

&lt;p&gt;So you can see it as an &lt;strong&gt;addition&lt;/strong&gt; to my original react performance blog post. The first one builds the foundation. This one adds the cherry on top.&lt;/p&gt;

&lt;p&gt;This post is &lt;strong&gt;part 1&lt;/strong&gt; of a &lt;strong&gt;series&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Part 2: &lt;em&gt;Coming Soon&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What you can learn from this blog post:&lt;/strong&gt;&lt;/p&gt;




&lt;ul&gt;
&lt;li&gt;Always use a key when mapping (and not index)&lt;/li&gt;
&lt;li&gt;Use React.Fragments instead of divs as parent element&lt;/li&gt;
&lt;li&gt;One useState hook instead of multiple for connected data&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  &lt;a&gt;&lt;/a&gt; Always use a key when mapping (and not an index)
&lt;/h2&gt;

&lt;p&gt;When mapping over an array and rendering a list of items, make sure you &lt;strong&gt;always use keys&lt;/strong&gt; for every item.&lt;/p&gt;

&lt;p&gt;Keys help React identify which items have &lt;strong&gt;changed, are added, or are removed&lt;/strong&gt;. Keys should be strings that identify a list item, such as an ID.&lt;/p&gt;

&lt;p&gt;Here is a quick example of the usage of keys. Check the return method of this component. There we use the id of every animal as a key.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="nx"&gt;React&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;react&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;AnimalCard&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;./animal-card&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;animals&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
  &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="na"&gt;id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;dog&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="p"&gt;},&lt;/span&gt;
  &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="na"&gt;id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;cat&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="p"&gt;},&lt;/span&gt;
  &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="na"&gt;id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;unicorn&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="p"&gt;},&lt;/span&gt;
&lt;span class="p"&gt;];&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;Animals&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;animals&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;map&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;animal&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;AnimalCard&lt;/span&gt; &lt;span class="nx"&gt;key&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;animal&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;id&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;animal&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;name&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/AnimalCard&amp;gt;&lt;/span&gt;&lt;span class="err"&gt;;
&lt;/span&gt;  &lt;span class="p"&gt;});&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="nx"&gt;Animals&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you're not using keys, React has to a hard time to figure out which items to update. This can lead to updating every item although only one changed.&lt;/p&gt;

&lt;p&gt;This can be a massive performance impact! 😫&lt;/p&gt;

&lt;p&gt;If you don't have access to unique identifiers, indexes can be used as a last resort. It is &lt;strong&gt;not recommended&lt;/strong&gt; to use them as keys but it's better than not using any keys at all.&lt;/p&gt;

&lt;p&gt;If the order of items changes, the index changes as well so React has to update every item anyway.&lt;/p&gt;

&lt;p&gt;You can learn more about why keys are important in this &lt;a href="https://reactjs.org/docs/reconciliation.html#recursing-on-children"&gt;article about reconciliation&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;So that's it for quickwin number one: &lt;strong&gt;always use a key when mapping!&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;a&gt;&lt;/a&gt; Use React.Fragments instead of divs as JSX parent element
&lt;/h2&gt;

&lt;p&gt;Next up: quickwin number two.&lt;/p&gt;

&lt;p&gt;When you return multiple elements from a component, JSX needs a parent element to wrap them. A quick way to do this, is to put a &lt;code&gt;&amp;lt;div&amp;gt;&lt;/code&gt; around them.&lt;/p&gt;

&lt;p&gt;I admit it, I've done this too, way too many times.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="nx"&gt;React&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;react&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;MyComponent&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;div&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;span&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nx"&gt;Hi&lt;/span&gt;&lt;span class="o"&gt;!&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/span&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;      &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;span&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nx"&gt;Hope&lt;/span&gt; &lt;span class="nx"&gt;you&lt;/span&gt; &lt;span class="nx"&gt;can&lt;/span&gt; &lt;span class="nx"&gt;learn&lt;/span&gt; &lt;span class="nx"&gt;a&lt;/span&gt; &lt;span class="nx"&gt;lot&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="nx"&gt;my&lt;/span&gt; &lt;span class="nx"&gt;blog&lt;/span&gt; &lt;span class="nx"&gt;posts&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/span&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/div&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;  &lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="nx"&gt;MyComponent&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;But the next time you need a JSX wrapping element, think again! You can use a &lt;strong&gt;React.Fragment&lt;/strong&gt; for that!&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="nx"&gt;React&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;react&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;MyComponent&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;React&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;Fragment&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;span&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nx"&gt;Hi&lt;/span&gt;&lt;span class="o"&gt;!&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/span&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;      &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;span&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nx"&gt;Hope&lt;/span&gt; &lt;span class="nx"&gt;you&lt;/span&gt; &lt;span class="nx"&gt;can&lt;/span&gt; &lt;span class="nx"&gt;learn&lt;/span&gt; &lt;span class="nx"&gt;a&lt;/span&gt; &lt;span class="nx"&gt;lot&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="nx"&gt;my&lt;/span&gt; &lt;span class="nx"&gt;blog&lt;/span&gt; &lt;span class="nx"&gt;posts&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/span&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/React.Fragment&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;  &lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="nx"&gt;MyComponent&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And the best thing is, there is even a &lt;strong&gt;short syntax&lt;/strong&gt; for this.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="nx"&gt;React&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;react&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;MyComponent&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="o"&gt;&amp;lt;&amp;gt;&lt;/span&gt;
      &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;span&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nx"&gt;Hi&lt;/span&gt;&lt;span class="o"&gt;!&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/span&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;      &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;span&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nx"&gt;Hope&lt;/span&gt; &lt;span class="nx"&gt;you&lt;/span&gt; &lt;span class="nx"&gt;can&lt;/span&gt; &lt;span class="nx"&gt;learn&lt;/span&gt; &lt;span class="nx"&gt;a&lt;/span&gt; &lt;span class="nx"&gt;lot&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="nx"&gt;my&lt;/span&gt; &lt;span class="nx"&gt;blog&lt;/span&gt; &lt;span class="nx"&gt;posts&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/span&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;  &lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="nx"&gt;MyComponent&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;But wait, why does this boost my performance? Good question! Here's the thing. The more DOM elements your React application has, the &lt;strong&gt;longer&lt;/strong&gt; the render process takes.&lt;/p&gt;

&lt;p&gt;Google's performance tool lighthouse recommends &lt;strong&gt;not more than 1500 DOM nodes&lt;/strong&gt; in total.&lt;/p&gt;

&lt;p&gt;So by removing every unnecessary &lt;code&gt;div&lt;/code&gt;, like the one we've used way too often as a JSX parent element wrapper, we already get closer to that goal. And we can boost our performance!&lt;/p&gt;

&lt;p&gt;You can read more about why you should avoid too many DOM nodes in this article: &lt;a href="https://web.dev/dom-size/"&gt;https://web.dev/dom-size/&lt;/a&gt;&lt;/p&gt;



&lt;h2&gt;
  
  
  &lt;a&gt;&lt;/a&gt; One useState hook instead of multiple for connected data
&lt;/h2&gt;

&lt;p&gt;Another performance quickwin you can achieve easy, is using one &lt;code&gt;useState&lt;/code&gt; hook instead of multiple ones for connected data.&lt;/p&gt;

&lt;p&gt;Imagine a developer built a form with several &lt;code&gt;input&lt;/code&gt; elements. Therefore they added four individual &lt;code&gt;useState&lt;/code&gt; hooks.&lt;/p&gt;

&lt;p&gt;That could look something like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="nx"&gt;React&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;react&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;MyBigForm&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;username&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;setUsername&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;React&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;useState&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;''&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;email&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;setEmail&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;React&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;useState&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;''&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;password&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;setPassword&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;React&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;useState&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;''&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;nickname&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;setNickName&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;React&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;useState&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;''&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;handleUserNameChange&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;event&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;setUsername&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;event&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;target&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;value&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="p"&gt;};&lt;/span&gt;

  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;handleEmailChange&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;event&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;setEmail&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;event&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;target&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;value&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="p"&gt;};&lt;/span&gt;

  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;handlePasswordChange&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;event&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;setPassword&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;event&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;target&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;value&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="p"&gt;};&lt;/span&gt;

  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;handleNicknameChange&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;event&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;setNickName&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;event&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;target&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;value&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="p"&gt;};&lt;/span&gt;

  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;form&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;label&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;Username&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/label&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;      &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;input&lt;/span&gt; &lt;span class="nx"&gt;value&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;username&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="nx"&gt;name&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;username&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="nx"&gt;onChange&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;handleUserNameChange&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="sr"&gt;/&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;
      &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;label&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;Email&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/label&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;      &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;input&lt;/span&gt; &lt;span class="nx"&gt;value&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;email&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="nx"&gt;name&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;email&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="nx"&gt;onChange&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;handleEmailChange&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="sr"&gt;/&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;
      &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;label&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;Password&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/label&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;      &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;input&lt;/span&gt; &lt;span class="nx"&gt;value&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;password&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="nx"&gt;name&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;password&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="nx"&gt;onChange&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;handlePasswordChange&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="sr"&gt;/&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;
      &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;label&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;Nickname&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/label&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;      &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;input&lt;/span&gt; &lt;span class="nx"&gt;value&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;nickname&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="nx"&gt;name&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;nickname&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="nx"&gt;onChange&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;handleNicknameChange&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="sr"&gt;/&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/form&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;  &lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;There is a lot of &lt;code&gt;useState&lt;/code&gt; and &lt;code&gt;onChange&lt;/code&gt; going on here, right? Phew. We can optimize for the better here!&lt;/p&gt;

&lt;p&gt;By &lt;strong&gt;removing&lt;/strong&gt; the individual &lt;code&gt;useState&lt;/code&gt; hooks and implementing a combined one, we're making sure to &lt;strong&gt;reduce&lt;/strong&gt; the size of the component and therefore improve the performance.&lt;/p&gt;

&lt;p&gt;And we can also get rid of all the &lt;code&gt;handleChange&lt;/code&gt; functions, which all seem to do the same.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="nx"&gt;React&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;react&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;MyBigForm&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;formdata&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;setFormdata&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;React&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;useState&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
    &lt;span class="na"&gt;username&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;''&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;email&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;''&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;password&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;''&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;nickname&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;''&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="p"&gt;});&lt;/span&gt;

  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;handleOnChange&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;event&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;setFormdata&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
      &lt;span class="p"&gt;...&lt;/span&gt;&lt;span class="nx"&gt;formData&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;event&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;target&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;name&lt;/span&gt;&lt;span class="p"&gt;]:&lt;/span&gt; &lt;span class="nx"&gt;event&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;target&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;value&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;});&lt;/span&gt;
  &lt;span class="p"&gt;};&lt;/span&gt;

  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;form&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;label&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;Username&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/label&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;      &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;input&lt;/span&gt; &lt;span class="nx"&gt;value&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;username&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="nx"&gt;name&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;username&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="nx"&gt;onChange&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;handleOnChange&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="sr"&gt;/&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;
      &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;label&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;Email&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/label&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;      &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;input&lt;/span&gt; &lt;span class="nx"&gt;value&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;email&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="nx"&gt;name&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;email&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="nx"&gt;onChange&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;handleOnChange&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="sr"&gt;/&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;
      &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;label&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;Password&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/label&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;      &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;input&lt;/span&gt; &lt;span class="nx"&gt;value&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;password&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="nx"&gt;name&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;password&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="nx"&gt;onChange&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;handleOnChange&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="sr"&gt;/&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;
      &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;label&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="na"&gt;Nickname&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/label&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;      &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;input&lt;/span&gt; &lt;span class="nx"&gt;value&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;nickname&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="nx"&gt;name&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;nickname&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="nx"&gt;onChange&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;handleOnChange&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="sr"&gt;/&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/form&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;  &lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Wow a lot less code and a lot more &lt;strong&gt;readable&lt;/strong&gt;, don't you think? It's always a good idea to keep your state in an object, if you're dealing with &lt;strong&gt;connected data&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Don't get me wrong: using and calling multiple &lt;code&gt;useState&lt;/code&gt; hooks is not a bad thing! React has no problem with that.&lt;/p&gt;

&lt;p&gt;But in this example it's also about &lt;strong&gt;removing duplicate code&lt;/strong&gt; and &lt;strong&gt;rethinking&lt;/strong&gt; your components.&lt;/p&gt;

&lt;p&gt;And if JavaScript has to allocate the memory for only one function instead of four, that's also a &lt;strong&gt;performance quickwin&lt;/strong&gt;! And that's what we're here for, right?&lt;/p&gt;

&lt;p&gt;That's it for &lt;strong&gt;part 1&lt;/strong&gt; of this &lt;strong&gt;React performance quickwins series&lt;/strong&gt;! Hope you could already apply some of them and make your React app even faster.&lt;/p&gt;

&lt;p&gt;Let me know if these tips helped or you have other tips, you'd like to share.&lt;/p&gt;

&lt;p&gt;This blog post was originally published on &lt;a href="https://marcokuehbauch.com/blog/7-easy-ways-to-improve-your-react-performance-part-1/"&gt;marcokuehbauch.com&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Head over there to let me know what you think and share it with others!&lt;/p&gt;

&lt;p&gt;You can also find me on Twitter at &lt;a href="https://twitter.com/Mkuehb"&gt;@mkuehb&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>react</category>
      <category>performance</category>
      <category>javascript</category>
    </item>
    <item>
      <title>How to overcome imposter syndrome as a developer</title>
      <dc:creator>Marco Kühbauch</dc:creator>
      <pubDate>Fri, 30 Oct 2020 17:02:13 +0000</pubDate>
      <link>https://dev.to/mkuehb/how-to-overcome-imposter-syndrome-as-a-developer-44k1</link>
      <guid>https://dev.to/mkuehb/how-to-overcome-imposter-syndrome-as-a-developer-44k1</guid>
      <description>&lt;p&gt;I was in a comfortable position at a previous job. I was working as a frontend developer and after two years in this job, I knew my way around. I knew about every feature our product contained. I knew the code. I could tell which component was responsible for what.&lt;/p&gt;

&lt;p&gt;I knew where most of the questions at me where headed before someone finished them asking. This felt like home. This felt like the absolute &lt;strong&gt;comfort zone&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What you can learn from this blog post:&lt;/strong&gt;&lt;/p&gt;




&lt;ul&gt;
&lt;li&gt;What is imposter syndrome&lt;/li&gt;
&lt;li&gt;Why you feel like an imposter&lt;/li&gt;
&lt;li&gt;Why you aren't an imposter&lt;/li&gt;
&lt;li&gt;
Overcoming imposter syndrome

&lt;ul&gt;
&lt;li&gt;Set yourself realistic goals&lt;/li&gt;
&lt;li&gt;Keep track of your accomplishments&lt;/li&gt;
&lt;li&gt;Don't compare yourself to others&lt;/li&gt;
&lt;li&gt;Your teammates and colleagues may feel the same&lt;/li&gt;
&lt;li&gt;Ask for Feedback&lt;/li&gt;
&lt;li&gt;Even the experts in our industry feel this way&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;After switching jobs imposter syndrome hit me hard. At first I felt like a &lt;strong&gt;fraud&lt;/strong&gt;. Everything was new to me. The code, the tools, the workflow, the people, the team. I felt like I had to relearn everything. And like I did not know anything at all.&lt;/p&gt;

&lt;p&gt;I always thought that sooner or later somebody would come to me and say: "You know, we've watched you long enough and now you've been caught. You don't know anything about software developing." &lt;em&gt;handcuffs click.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Did you ask yourself questions like &lt;strong&gt;am I good enough&lt;/strong&gt;? Do you often have thoughts like do I know enough to be a good developer? Can I help make this product better? My skills are way to bad. &lt;strong&gt;I should quit. I know nothing&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;This kind of thoughts are bad and not helpful at all you could say. But still a lot of people have them.&lt;/p&gt;

&lt;p&gt;Chances are you've felt the same at some point in your career. Chances are you will feel like that everytime you start a new job. This all sounds very negative. But the good news is: &lt;strong&gt;you are not alone&lt;/strong&gt;!&lt;/p&gt;

&lt;p&gt;A colleague of mine once told me that they should take two weeks off to learn a specific technology. Because they feel like they "know nothing about it". And they are developers, I &lt;strong&gt;learn the most of&lt;/strong&gt; and look up to. In my eyes they know their stuff pretty well.&lt;/p&gt;

&lt;p&gt;If anything of this above sounds familiar to you, let me tell you about the imposter syndrome.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;a&gt;&lt;/a&gt; &lt;strong&gt;What is imposter syndrome?&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://en.wikipedia.org/wiki/Impostor_syndrome"&gt;Wikipedia&lt;/a&gt; gives a very good definition of imposter syndrome:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;Impostor syndrome (also known as impostor phenomenon, impostorism, fraud syndrome or the impostor experience) is a psychological pattern in which an individual doubts their accomplishments or talents and has a persistent internalized fear of being exposed as a "fraud".&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;If this sounds familiar to you, chances are you also feel like you &lt;strong&gt;do not deserve&lt;/strong&gt; certain things. You think your achievements are not you own and your success is attributed to &lt;strong&gt;luck&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;For some people it gets even worse. Often &lt;strong&gt;anxiety, stress or depression&lt;/strong&gt; go along side with imposter syndrome.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;a&gt;&lt;/a&gt; &lt;strong&gt;Why you feel like an imposter&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;So the questions is why do we feel this way? What &lt;strong&gt;causes&lt;/strong&gt; imposter syndrome? It does not sound like something that could benefit our work, our life or anything between. It sounds harmful and could also hold as back.&lt;/p&gt;

&lt;p&gt;A lot of developers are &lt;strong&gt;self taught&lt;/strong&gt;. Often they suffer from imposter syndrome because they do not have a CS degree. And this is still required by a lot of companies. Thus they think, they are not "real" developers, if they haven't learned their stuff at a university.&lt;/p&gt;

&lt;p&gt;Another reason why we feel this way is that the web industry is one of the &lt;strong&gt;fastest changing industries&lt;/strong&gt;. Every week or so this new technology gets popular. A new JavaScript framework will replace the most popular one right now and you need to know about it and have learned about it yesterday. Which is obviously not possible.&lt;/p&gt;

&lt;p&gt;So we get the feeling we need no know everything but we can't. And we don't accept the obvious reasons, we think we as developers, as humans are the problem.&lt;/p&gt;

&lt;p&gt;There is always something new to learn in this industry. This is on the one hand a really nice thing and motivates me but but it's hard to stay on top.&lt;/p&gt;

&lt;p&gt;Every programming task you do at work is like a small challenge. If you succeed everything is fine. But if you don't find a solution right away you question yourself. You &lt;strong&gt;question your knowledge&lt;/strong&gt; and if you've even &lt;strong&gt;capable&lt;/strong&gt; of this job.&lt;/p&gt;

&lt;p&gt;We compare ourselves to others. This new kid just joined the company and already build this super complex feature. Because they are programming since they are 12 years old. I will never be as good as them. Sounds familiar?&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;a&gt;&lt;/a&gt; &lt;strong&gt;Why you aren't an imposter&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Let's take a quick break and a deep breath.&lt;/p&gt;

&lt;p&gt;Let me tell you that you took the first step. We analyzed the problem and we saw the situation for what it really is. There are a lot of ways to grow out of it and change. From here on the positive takes over.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;You are not an imposter&lt;/strong&gt; because you do not need a CS degree to be a good developer. It can help in some ways but the knowledge to be a good developer is not only trapped inside a CS degree.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;You are not an imposter&lt;/strong&gt; because take a look. See how far you've come. What you've achieved in your past, all you've done. Even if you're a beginner remember all the things you've learned so far, even the smallest.&lt;/p&gt;

&lt;p&gt;My incredibly talented girlfriend draw this beautiful picture about this topic.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--qzVdpt0D--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/gsycd81i0xxfdckzze6w.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--qzVdpt0D--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/gsycd81i0xxfdckzze6w.png" alt="Look how far you've come artwork"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.instagram.com"&gt;@findingthelittlethings_&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I take a look at it as often as I can because it's always a &lt;strong&gt;good reminder&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;You are not an imposter&lt;/strong&gt; because you've got the job right? You convinced someone to hire you as a developer. That's a big achievement you can't fake.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;You are not an imposter&lt;/strong&gt; because remember this one little crazy bug you solved which seemed like "a hell no we will never solve this bug at all". But you did.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;You are not an imposter&lt;/strong&gt; because you don't know everything. And that's totally fine. &lt;strong&gt;You can't know everything&lt;/strong&gt;. And even if you could, that would be really boring, right? One of the greatest things in life is that there is always something new to learn.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;a&gt;&lt;/a&gt; &lt;strong&gt;Overcoming imposter syndrome&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Now as we have set the clear picture why you are not an imposter, here are more tips on how to deal with imposter syndrome and eventually &lt;strong&gt;overcome&lt;/strong&gt; it.&lt;/p&gt;



&lt;h3&gt;
  
  
  &lt;a&gt;&lt;/a&gt; Set yourself realistic goals
&lt;/h3&gt;

&lt;p&gt;Set yourself some realistic goals! Telling yourself that in three weeks you will know the entire codebase by heart is an impossible goal. Rather set up smaller goals which are &lt;strong&gt;clear&lt;/strong&gt; and &lt;strong&gt;measurable&lt;/strong&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;a&gt;&lt;/a&gt; Keep track of your accomplishments
&lt;/h3&gt;

&lt;p&gt;Write down everything you achieved. Even the smallest things. Everytime you struggle, you doubt yourself, take a look at that list. Be proud of what you've learned and achieved. This helps a lot.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;a&gt;&lt;/a&gt; Don't compare yourself to others
&lt;/h3&gt;

&lt;p&gt;Comparing yourself to others is never a good idea. It always leaves you feel bad about yourself. You don't know the history of others, how they learn and how they think. Everyone is different and has their own strengths and weaknesses.&lt;/p&gt;

&lt;p&gt;The next time you compare yourself to the new team member, who already seems to know everything - stop right there. Be happy for the new colleague because they settled so quickly.&lt;/p&gt;

&lt;p&gt;Than &lt;strong&gt;compare yourself to you&lt;/strong&gt; from last week or last month. There are definitely things you've learned, features you built and bugs you crushed.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;a&gt;&lt;/a&gt; Your teammates and colleagues may feel the same
&lt;/h3&gt;

&lt;p&gt;Talk to your colleagues about it. Chances are they feel exactly they same as you do. Help to build a culture in your company where it's easy and desired to share knowledge. Where you help each other and not knowing everything is considered normal. Do more pair programming and knowledge sharing sessions.&lt;/p&gt;

&lt;p&gt;Learn to be brave and answer questions with: "I don't know an answer to your question right away. I need to think about it first." I know this seems very hard, but in the end everyone benefits from that.&lt;/p&gt;

&lt;p&gt;Finally be aware of the fact that the work and achievements as a team is, what counts.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;a&gt;&lt;/a&gt; Ask for Feedback
&lt;/h3&gt;

&lt;p&gt;If you're feeling like an imposter remember that the only person you get feedback from right now is yourself. To stop this cycle and get a more realistic view of what is really happening, don't hesitate to ask your teammates and colleagues for feedback! They can give you valuable answers on how you're really doing and where you can improve.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;a&gt;&lt;/a&gt; Even the experts in our industry feel this way
&lt;/h3&gt;

&lt;p&gt;When I came across &lt;a href="https://davidwalsh.name/impostor-syndrome"&gt;this blog post&lt;/a&gt; by David Walsh, I was astonished. He writes a lot of blog posts about the JavaScript ecosystems. He worked for Mozilla for over 8 years. Developers go to his blog to get help, read his tutorials and learn stuff. And even he feels this way. This shows a whole new perspective. Take your time and head over there to read this. I'll wait here.&lt;/p&gt;

&lt;p&gt;And than you'll see that you're absolutely not alone feeling like this. You're fine.&lt;/p&gt;

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

&lt;p&gt;Dealing with imposter syndrome can be hard and your are not alone in this. The first step is to realize that you suffer from it. From there on you can grow into a more healthy relationship with yourself. There are a lot of tools you can use to cope and deal with imposter syndrome.&lt;/p&gt;

&lt;p&gt;I hope I could explain this topic a little better and you can use my tips to overcome imposter syndrome.&lt;/p&gt;

&lt;p&gt;Did you ever suffer from imposter syndrome? Do you know friends who feel that way? Make sure to send them this blog post and let me know what you think about this topic.&lt;/p&gt;

&lt;p&gt;This blog post was originally published on &lt;a href="//marcokuehbauch.com"&gt;marcokuehbauch.com&lt;/a&gt;&lt;br&gt;
Head over there to let me know what you think and share it with others!&lt;/p&gt;

&lt;p&gt;You can also find me on Twitter at &lt;a href="https://twitter.com/Mkuehb"&gt;@mkuehb&lt;/a&gt;&lt;/p&gt;

</description>
      <category>career</category>
      <category>firstyearincode</category>
      <category>impostersyndrome</category>
    </item>
    <item>
      <title>React Performance Improvements</title>
      <dc:creator>Marco Kühbauch</dc:creator>
      <pubDate>Wed, 28 Oct 2020 10:47:00 +0000</pubDate>
      <link>https://dev.to/mkuehb/react-performance-improvements-3i62</link>
      <guid>https://dev.to/mkuehb/react-performance-improvements-3i62</guid>
      <description>&lt;p&gt;In this blog post I'm going to introduce several tipps and tricks to boost the &lt;strong&gt;performance&lt;/strong&gt; of a React application.&lt;/p&gt;

&lt;p&gt;I learned a ton while improving the performance of a large and complex web application recently and wanted to share everything so others don't have to search all over the internet for this useful and important information.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What you can learn from this blog post:&lt;/strong&gt;&lt;/p&gt;




&lt;ul&gt;
&lt;li&gt;
Where to start

&lt;ul&gt;
&lt;li&gt;Chrome DevTools Lighthouse Audit&lt;/li&gt;
&lt;li&gt;webpagetest&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

The Biggest Problems

&lt;ul&gt;
&lt;li&gt;Time to Interactive (TTI)&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

And how to solve them

&lt;ul&gt;
&lt;li&gt;Removing DOM nodes&lt;/li&gt;
&lt;li&gt;lazy-loading images&lt;/li&gt;
&lt;li&gt;code-coverage&lt;/li&gt;
&lt;li&gt;code-splitting&lt;/li&gt;
&lt;li&gt;React Profiler&lt;/li&gt;
&lt;li&gt;Chrome Performance Analyzer&lt;/li&gt;
&lt;li&gt;Bundle-Analyzer&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;Conclusion&lt;/li&gt;

&lt;li&gt;Sources&lt;/li&gt;

&lt;/ul&gt;




&lt;h2&gt;
  
  
  &lt;a&gt;&lt;/a&gt; Where to start
&lt;/h2&gt;

&lt;p&gt;If you notice that your React App is &lt;strong&gt;slow&lt;/strong&gt; or takes a long time to load, you have a few options to verify that and get an insight into where the biggest problems are.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;a&gt;&lt;/a&gt; Chrome DevTools Lighthouse Audit
&lt;/h3&gt;

&lt;p&gt;First of all you can measure your performance score with the &lt;strong&gt;Chrome Lighthouse Audit&lt;/strong&gt; which is available in the Chrome DevTools.&lt;/p&gt;

&lt;p&gt;You can choose between measuring the performance on mobile or desktop. If you just want to get your performance score, you can check off the other audits, like Progressive Web App or SEO.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F3vwqdgpqib4uwnffk99k.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F3vwqdgpqib4uwnffk99k.jpeg" alt="a screenshot of the chrome lighthouse audit settings"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You should also activate &lt;strong&gt;throtteling&lt;/strong&gt;, because not everyone is on the newest MacBook Pro with 64GB of RAM and i9 processor while browsing on a 5G network. I usually use Applied Slow 4G, 4x CPU Slowdown.&lt;/p&gt;

&lt;p&gt;After the audit is finished, you get a nice &lt;strong&gt;overview&lt;/strong&gt; over the scores, the metrics and how they are calculated. You also get opportunities and diagnostics which can tell you why your app is slow and how to solve common problems.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;a&gt;&lt;/a&gt; webpagetest
&lt;/h3&gt;

&lt;p&gt;Another tool to verify the perfomance of your React application is &lt;a href="//webpagetest.org"&gt;webpagetest.org&lt;/a&gt;. After you enter a URL and start the test, it returns a test result and grades specific parts of your application. It is also pretty useful in finding problems and ways to improve the performance.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;a&gt;&lt;/a&gt; The Biggest Problems
&lt;/h2&gt;

&lt;h3&gt;
  
  
  &lt;a&gt;&lt;/a&gt; Time to Interactive (TTI)
&lt;/h3&gt;

&lt;p&gt;In case of React applications where a lot of JavaScript is involved, often the &lt;strong&gt;time to interactive&lt;/strong&gt; identifies itself as the biggest problem. TTI means how long it takes a page to become &lt;strong&gt;interactive&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;The TTI gets slowed down by a few things. The ones which are directly related to a lot of JavaScript code and therefore React are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;too much main-thread work&lt;/li&gt;
&lt;li&gt;an excessive DOM size&lt;/li&gt;
&lt;li&gt;too much JavaScript execution time&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;To summarize this: When a user navigates to your page and can not click around for a few seconds, because your JavaScript is not fully parsed, compiled and executed, this is &lt;strong&gt;bad&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Especially when you are using server side rendering where the user already can see your page but not interact with it yet.&lt;/p&gt;

&lt;p&gt;This all happens because your browser has to execute too much JavaScript at once, because certain scripts are blocking, because you just want to do too much at once in your code.&lt;/p&gt;

&lt;p&gt;Uff. This sounds a little exausting. We need solutions. Let's tackle the problems one by one.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;a&gt;&lt;/a&gt; And how to solve them
&lt;/h2&gt;

&lt;h3&gt;
  
  
  &lt;a&gt;&lt;/a&gt; Removing DOM Nodes
&lt;/h3&gt;

&lt;p&gt;Perhaps the easiest step to improve the performance of your react application is to &lt;strong&gt;reduce&lt;/strong&gt; the amout of DOM Nodes. If you hide a lot of your components with CSS, check if you can render them &lt;strong&gt;conditionally&lt;/strong&gt; instead.&lt;/p&gt;

&lt;p&gt;This decreases the size of the DOM which means less components need to be rendered, which means less JavaScript needs to be executed.&lt;/p&gt;

&lt;p&gt;This will especially be helpful, when you have a long list of items, render all of them, but show only the first 5 initially. Robin Wieruch has a &lt;a href="https://www.robinwieruch.de/conditional-rendering-react." rel="noopener noreferrer"&gt;great article&lt;/a&gt; on conditional rendering in React.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;a&gt;&lt;/a&gt; lazy-loading images
&lt;/h3&gt;

&lt;p&gt;If you load twenty images initially, which are located at the bottom of your page, meaning the user can't see them at first glance, this is a lot of wasted time and potential.&lt;/p&gt;

&lt;p&gt;Instead you can detect when the user gets closer to the images and then render them. Because that's the point where you actually need them. The npm package &lt;a href="https://www.npmjs.com/package/react-lazyload" rel="noopener noreferrer"&gt;react-lazyload&lt;/a&gt; makes this surpringsingly easy.&lt;/p&gt;

&lt;p&gt;This results in executing less JavaScript code but it also solves another very common problem: too many &lt;strong&gt;http requests&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;So its a good idea in general to only render and show the code the user needs to interact with your React app initially, instead of just rendering everything.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;a&gt;&lt;/a&gt; code-coverage
&lt;/h3&gt;

&lt;p&gt;Chrome offers the opportunity to detect &lt;strong&gt;unused&lt;/strong&gt; code in your application.&lt;/p&gt;

&lt;p&gt;The code coverage tab is located in the Chrome DevTools. You can find it in the command menu when you type &lt;em&gt;coverage&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;It can track a whole reload of your application and is still tracking and updating the code coverage when you're interacting with your application.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fvsomyfvkzwbrjsueffys.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fvsomyfvkzwbrjsueffys.jpeg" alt="a screenshot of the chrome coverage tool"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This is another super easy quick win, which can help you to improve your performance by removing &lt;strong&gt;unused code&lt;/strong&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;a&gt;&lt;/a&gt; code-splitting
&lt;/h3&gt;

&lt;p&gt;In a large and complex react application code-splitting is possibly one of the best ways to improve your performance.&lt;/p&gt;

&lt;p&gt;The idea of code-splitting is to split your code in ways it is needed in your application and therefore render only the code which is needed for the &lt;strong&gt;current UI&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Imagine having a Landingpage and a page where you show some articles, let's call it blog. Does the blog need to download and execute code which is only needed on the Landingpage? No!&lt;/p&gt;

&lt;p&gt;So you can use clever tools, who are capable of detecting where your code is actually needed and split it up. That's code-splitting.&lt;/p&gt;

&lt;p&gt;One of these clever tools is &lt;strong&gt;React.lazy&lt;/strong&gt;. You can read and learn more about it in the &lt;a href="https://reactjs.org/docs/code-splitting.html#reactlazy" rel="noopener noreferrer"&gt;React docs code splitting section&lt;/a&gt;. Please note that React.lazy is not available for server-side-rendering. Code-splitting in a server rendered app can be achieved with &lt;a href="https://loadable-components.com/docs/server-side-rendering/" rel="noopener noreferrer"&gt;Loadable Components&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;a&gt;&lt;/a&gt; React Profiler
&lt;/h3&gt;

&lt;p&gt;The &lt;a href="https://reactjs.org/blog/2018/09/10/introducing-the-react-profiler.html" rel="noopener noreferrer"&gt;React Profiler&lt;/a&gt; is another useful tool to gain more insight about what your React app is doing and why. It is part of the React Browser Plugin and can be located in the DevTools.&lt;/p&gt;

&lt;p&gt;When you &lt;strong&gt;profile&lt;/strong&gt; your app it collects timing information about each component that is rendered. It also shows how long a specific component took to render, if it needed to be updated and so on.&lt;/p&gt;

&lt;p&gt;So you can either see if a component took way to long to render or identify unecessary rerenders. Both are ways which can help you to identify performance bottlenecks.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;a&gt;&lt;/a&gt; Chrome Performance Analyzer
&lt;/h3&gt;

&lt;p&gt;Another way to collect information about your performance is the Chrome Performance Analyzer. It's also located in the Chrome DevTools and lets you record the load performance of your app. This is the place where you analyze your loading time in to the deepest. It just has so many options.&lt;/p&gt;

&lt;p&gt;Take your time to read through the &lt;a href="https://developers.google.com/web/tools/chrome-devtools/evaluate-performance/reference" rel="noopener noreferrer"&gt;documentation of this performance evaluation tool&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;It makes sense to spent more time to fully understand what this tool is capable of. It can totally help you boost your performance because it shows you everything that's happening with your JavaScript.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;a&gt;&lt;/a&gt; Bundle-Analyzer
&lt;/h3&gt;

&lt;p&gt;The &lt;a href="https://www.npmjs.com/package/webpack-bundle-analyzer" rel="noopener noreferrer"&gt;Webpack Bundle Analyzer&lt;/a&gt; is a npm package which "visualizes the size of webpack output files with an interactive zoomable treemap". To use this package your application has to use webpack for the bundling of course.&lt;/p&gt;

&lt;p&gt;This Analyzer is such a great tool. It shows you exactly what files you give out to your users, how big they are and also which files should absolutely not be in your bundle.&lt;/p&gt;

&lt;p&gt;In case of the large and complex web app I was working on, by using this analyzer we realized that some packages where depending on the whole &lt;code&gt;lodash&lt;/code&gt; library which is a lot to include in to your bundle if you actually just need one functionality of it.&lt;/p&gt;

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

&lt;p&gt;All these steps are great and helpful ways to find out why your React application is slow and how to change that. You don't have to implement all of them, maybe already one of them will help you speed up things. &lt;/p&gt;

&lt;p&gt;I hope you could learn something here and if you know more ways to boost the performance let me know!&lt;/p&gt;

&lt;p&gt;This blog post was &lt;strong&gt;originally published&lt;/strong&gt; on &lt;a href="https://marcokuehbauch.com/blog/react-performance-improvements/" rel="noopener noreferrer"&gt;marcokuehbauch.com&lt;/a&gt;&lt;br&gt;
Head over there to let me know what you think and share it with others!&lt;/p&gt;

&lt;p&gt;You can also find me on Twitter at &lt;a href="https://twitter.com/Mkuehb" rel="noopener noreferrer"&gt;@mkuehb&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;a&gt;&lt;/a&gt; Sources:
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://developers.google.com/web/tools/lighthouse" rel="noopener noreferrer"&gt;https://developers.google.com/web/tools/lighthouse&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://developers.google.com/web/tools/lighthouse/audits/time-to-interactive" rel="noopener noreferrer"&gt;https://developers.google.com/web/tools/lighthouse/audits/time-to-interactive&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.robinwieruch.de/conditional-rendering-react" rel="noopener noreferrer"&gt;https://www.robinwieruch.de/conditional-rendering-react&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.npmjs.com/package/react-lazyload" rel="noopener noreferrer"&gt;https://www.npmjs.com/package/react-lazyload&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://reactjs.org/docs/code-splitting.html" rel="noopener noreferrer"&gt;https://reactjs.org/docs/code-splitting.html&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.freecodecamp.org/news/taming-performance-in-todays-web-app-with-lighthouse-webpack-and-react-loadable-components-b2d3fa04e0ab/" rel="noopener noreferrer"&gt;https://www.freecodecamp.org/news/taming-performance-in-todays-web-app-with-lighthouse-webpack-and-react-loadable-components-b2d3fa04e0ab/&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://reactjs.org/docs/optimizing-performance.html" rel="noopener noreferrer"&gt;https://reactjs.org/docs/optimizing-performance.html&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>react</category>
      <category>performance</category>
      <category>javascript</category>
    </item>
  </channel>
</rss>
