<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Zeke Hernandez</title>
    <description>The latest articles on Forem by Zeke Hernandez (@zeke).</description>
    <link>https://forem.com/zeke</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%2F19827%2Fd5756e85-9cc4-4bc6-bd1f-6526d3f6fd0b.jpg</url>
      <title>Forem: Zeke Hernandez</title>
      <link>https://forem.com/zeke</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/zeke"/>
    <language>en</language>
    <item>
      <title>Little React Things: Cleaning up dependencies</title>
      <dc:creator>Zeke Hernandez</dc:creator>
      <pubDate>Tue, 24 Jan 2023 15:17:05 +0000</pubDate>
      <link>https://forem.com/zeke/little-react-things-cleaning-up-dependencies-4fg1</link>
      <guid>https://forem.com/zeke/little-react-things-cleaning-up-dependencies-4fg1</guid>
      <description>&lt;p&gt;&lt;em&gt;Little React Things is a series of short, React-focused posts where I share some things I've learned over the past few years of developing with React. I hope you find them helpful. These posts might be most helpful for those who have at least a little experience with React already.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Let's kick this short one off with a little thing you may or may not know, but you definitely should know. The &lt;code&gt;setState&lt;/code&gt; function identity does not change on rerenders. What this means is that you can (and should) omit &lt;code&gt;setState&lt;/code&gt;s from the dependency lists of &lt;code&gt;useEffect&lt;/code&gt; and &lt;code&gt;useCallback&lt;/code&gt;. This behavior is noted in the &lt;a href="https://reactjs.org/docs/hooks-reference.html#usestate" rel="noopener noreferrer"&gt;official React docs&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;On to the main topic. For this post I'm gonna roll with the tried and true Todo List example. We have a list of &lt;code&gt;TodoItem&lt;/code&gt;s and let's say we can have a bunch of them. Since there can be so many of them we wrap each &lt;code&gt;TodoItem&lt;/code&gt; with &lt;code&gt;memo&lt;/code&gt; so that each one only rerenders when its own props change.&lt;/p&gt;

&lt;p&gt;Furthermore, each todo item can be cloned, so each &lt;code&gt;TodoItem&lt;/code&gt; has a callback, &lt;code&gt;onClone&lt;/code&gt;. And we have a little helper function &lt;code&gt;cloneTodo&lt;/code&gt; that makes such a clone of an existing todo item. The cloned todo is appended to the &lt;code&gt;todos&lt;/code&gt; state in &lt;code&gt;handleClone&lt;/code&gt; (if you want to know why I wrapped &lt;code&gt;handleClone&lt;/code&gt; with &lt;code&gt;useCallback&lt;/code&gt; take a look at &lt;a href="https://dmitripavlutin.com/react-usecallback/" rel="noopener noreferrer"&gt;Your Guide to React.useCallback()&lt;/a&gt;).&lt;/p&gt;

&lt;p&gt;Here's our React 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="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;TodoList&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="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;todos&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;setTodos&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;useState&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;handleClone&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;useCallback&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;todo&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="nf"&gt;setTodos&lt;/span&gt;&lt;span class="p"&gt;([...&lt;/span&gt;&lt;span class="nx"&gt;todos&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nf"&gt;cloneTodo&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;todo&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="nx"&gt;todos&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="p"&gt;&amp;gt;&lt;/span&gt;
            &lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;todos&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;map&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;todo&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
                &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;TodoItem&lt;/span&gt; &lt;span class="na"&gt;key&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;todo&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;id&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt; &lt;span class="na"&gt;todo&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;todo&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt; &lt;span class="na"&gt;onClone&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;handleClone&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt; &lt;span class="p"&gt;/&amp;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;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;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Pretty reasonable right? Ship it! &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;...a few minutes later...&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Uh oh, users have started reporting that their todo lists are really slow, particularly when cloning todo items. What happened? We wrapped our &lt;code&gt;TodoItem&lt;/code&gt;s with &lt;code&gt;memo&lt;/code&gt;, so why are they all rendering? Well, one of the props of &lt;code&gt;TodoItem&lt;/code&gt; is &lt;code&gt;onClone&lt;/code&gt; and we used &lt;code&gt;useCallback&lt;/code&gt; for that. And... oh, one of the dependencies of &lt;code&gt;handleClone&lt;/code&gt; is &lt;code&gt;todos&lt;/code&gt;. And that &lt;code&gt;todos&lt;/code&gt; state changes everytime we clone a todo (because we add a new todo to the array). So cloning a todo rerenders &lt;em&gt;all&lt;/em&gt; the todos. Not great.&lt;/p&gt;

&lt;p&gt;Let's make a small change to &lt;code&gt;handleClone&lt;/code&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="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;handleClone&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;useCallback&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;todo&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="nf"&gt;setTodos&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;currentTodos&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;currentTodos&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nf"&gt;cloneTodo&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;todo&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;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;As I mentioned at the beginning, &lt;code&gt;setTodos&lt;/code&gt; does not need to be added to the dependency list. So now this new version of &lt;code&gt;handleClone&lt;/code&gt; doesn't have any dependencies and its identity remains stable throughout the lifetime of the component! Now whenever we clone a todo, that new todo is added to the list without rerendering the already existing ones.&lt;/p&gt;

&lt;p&gt;If you want to see these examples live, check them out here:&lt;/p&gt;

&lt;p&gt;&lt;iframe src="https://codesandbox.io/embed/cleaning-up-dependencies-0jcxuc"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

</description>
      <category>react</category>
      <category>javascript</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Little React Things: Less reacting, more deriving</title>
      <dc:creator>Zeke Hernandez</dc:creator>
      <pubDate>Tue, 17 Jan 2023 14:51:33 +0000</pubDate>
      <link>https://forem.com/zeke/less-reacting-more-deriving-556h</link>
      <guid>https://forem.com/zeke/less-reacting-more-deriving-556h</guid>
      <description>&lt;p&gt;&lt;em&gt;Little React Things is a series of short, React-focused posts where I share some things I've learned over the past few years of developing with React. I hope you find them helpful. These posts might be most helpful for those who have at least a little experience with React already.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Back when React Hooks first came out, the &lt;code&gt;useEffect&lt;/code&gt; was introduced and many like myself were like "great, a utility to react to things changing and keeping things in sync". And that is partially true, but it's not as simple as that. The new React docs that are under construction are more explicit about how and how not to use &lt;code&gt;useEffect&lt;/code&gt; in the &lt;a href="https://beta.reactjs.org/learn/escape-hatches#you-might-not-need-an-effect"&gt;You Might Not Need an Effect&lt;/a&gt;. &lt;/p&gt;

&lt;p&gt;Even with the guidance from the new docs, these &lt;code&gt;useEffect&lt;/code&gt;s still tend to pop up in the wild. They can be more than just unnecessary, and actually problems that should be fixed.&lt;/p&gt;

&lt;h2&gt;
  
  
  A hasty reaction
&lt;/h2&gt;

&lt;p&gt;Let's say we have an app where a user can buy clothes, but instead of picking out each individual article of clothing, they can pick a bunch of articles of clothing that they like and set a price. Then the application shows the user a bunch of outfits that fit the chosen parameters.&lt;/p&gt;

&lt;p&gt;The parent component of the app is where the user can pick the different pieces of clothing from the main list. Then there is a child component, &lt;code&gt;OutfitList&lt;/code&gt; that lists all the outfits that fit the parameters.  This list of outfits is generated by a very cool helper function called &lt;code&gt;createOutfits&lt;/code&gt;; it's not an outrageously expensive function, but we definitely don't want to call it each time the &lt;code&gt;OutfitList&lt;/code&gt; is rendered (this kind of function would not be done in the browser typically, but this is a React post, so here we are).&lt;/p&gt;

&lt;p&gt;Let's take a look at a way we could create this &lt;code&gt;OutfitList&lt;/code&gt; 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="kd"&gt;function&lt;/span&gt; &lt;span class="nx"&gt;OutfitList&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="nx"&gt;clothingItems&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;maxPrice&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="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;outfits&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;setOutfits&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;useState&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="nx"&gt;useEffect&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;createdOutfits&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;createOutfits&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;clothingItems&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;maxPrice&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="nx"&gt;setOutfits&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;createdOutfits&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="nx"&gt;clothingItems&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;maxPrice&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="p"&gt;&amp;gt;&lt;/span&gt;
            &lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;outfits&lt;/span&gt; &lt;span class="p"&gt;?&lt;/span&gt; &lt;span class="nx"&gt;outfits&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;outfit&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
                &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;Outfit&lt;/span&gt; &lt;span class="na"&gt;key&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;outfit&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;id&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt; &lt;span class="na"&gt;outfit&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;outfit&lt;/span&gt;&lt;span class="si"&gt;}&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="kc"&gt;null&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;
        &lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;div&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
    &lt;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;It's great right? We have a &lt;code&gt;useEffect&lt;/code&gt; set up to react to changes in the clothing item list or price limit and recreates the list of outfits and updates the &lt;code&gt;outfits&lt;/code&gt; state. We only call the &lt;code&gt;createOutfits&lt;/code&gt; function when we need to and we keep &lt;code&gt;outfits&lt;/code&gt; in sync. All good? Well, there are a couple of issues with this solution. &lt;/p&gt;

&lt;h3&gt;
  
  
  Reactions are usually not a good idea
&lt;/h3&gt;

&lt;p&gt;Hold up, but it's called "React", what do you mean reactions aren't a good idea? Well, the reacting that we do want is reacting to user actions primarily and also asynchronous events. Code that synchronously reacts to your own code, on the other hand, is not desirable.&lt;/p&gt;

&lt;p&gt;When the &lt;code&gt;OutfitList&lt;/code&gt; first renders, even if &lt;code&gt;clothingItems&lt;/code&gt; is already populated &lt;code&gt;outfits&lt;/code&gt; will still be &lt;code&gt;null&lt;/code&gt;. This is because &lt;code&gt;useEffect&lt;/code&gt; runs after the render. So, for the first render we have populated &lt;code&gt;clothingItems&lt;/code&gt; and &lt;code&gt;null&lt;/code&gt; &lt;code&gt;outfits&lt;/code&gt;. The state is out of sync for that first render which is no good. Our components then need to be made in such a way to account for these discrepancies. For example, we need to add a check to see if &lt;code&gt;outfits&lt;/code&gt; is &lt;code&gt;null&lt;/code&gt; as shown in the code above.&lt;/p&gt;

&lt;p&gt;Furthermore, in the last post, I gave the guidance to not call the &lt;a href=""&gt;function that is a React application&lt;/a&gt; more than you need to, and here the &lt;code&gt;useEffect&lt;/code&gt; is calling that function immediately after it is first called. So instead of one render, we will always have at least two renders each time either &lt;code&gt;outfits&lt;/code&gt; or &lt;code&gt;maxPrice&lt;/code&gt; changes.&lt;/p&gt;

&lt;h3&gt;
  
  
  State should be the source of truth
&lt;/h3&gt;

&lt;p&gt;For our &lt;code&gt;OutfitList&lt;/code&gt; component, let's assume that &lt;code&gt;clothingItems&lt;/code&gt; and &lt;code&gt;maxPrice&lt;/code&gt; are state in the parent component. Given that, we have three states: &lt;code&gt;clothingItems&lt;/code&gt;, &lt;code&gt;maxPrice&lt;/code&gt; and &lt;code&gt;outfits&lt;/code&gt;. But are those three states actually representing different things? I would argue no. &lt;code&gt;outfits&lt;/code&gt; is just a derivation of &lt;code&gt;clothingItems&lt;/code&gt; and &lt;code&gt;maxPrice&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;This isn't good, state should be a source of truth. But here we have &lt;code&gt;clothingItems&lt;/code&gt;, &lt;code&gt;maxPrice&lt;/code&gt;, and &lt;code&gt;outfits&lt;/code&gt; as state, so which is the source of truth? From the user's perspective, I would probably say it's &lt;code&gt;clothingItems&lt;/code&gt; and &lt;code&gt;maxPrice&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Why is this important? Well, what if down the road a developer is going to add a feature where the user can add a new outfit to the outfit list. The correct way to do this would be suggest some outfits that include a piece that weren't in the &lt;code&gt;clothingItems&lt;/code&gt; list or that was a slightly higher price than &lt;code&gt;maxPrice&lt;/code&gt; and then if the user picks one of those outfits, adjust those states accordingly. But this developer could see some state called &lt;code&gt;outfits&lt;/code&gt; and simply just append a new outfit to that list. Uh oh, now we're really out of sync. We have a list of outfits that could &lt;em&gt;not&lt;/em&gt; be created from our set of &lt;code&gt;clothingItems&lt;/code&gt; or that is a higher price than the price limit. This example is a little contrived, but I hope you get the point at least.&lt;/p&gt;

&lt;h2&gt;
  
  
  Deriving forward
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nx"&gt;OutfitList&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="nx"&gt;clothingItems&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;maxPrice&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;outfits&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;useMemo&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;createOutfits&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;clothingItems&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;maxPrice&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="nx"&gt;clothingItems&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;maxPrice&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="p"&gt;&amp;gt;&lt;/span&gt;
            &lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;outfits&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;outfit&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
                &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;Outfit&lt;/span&gt; &lt;span class="na"&gt;key&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;outfit&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;id&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt; &lt;span class="na"&gt;outfit&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;outfit&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt; &lt;span class="p"&gt;/&amp;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;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;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here we are being explicit that &lt;code&gt;outfits&lt;/code&gt; are derived from &lt;code&gt;clothingItems&lt;/code&gt; and &lt;code&gt;maxPrice&lt;/code&gt;. On the first render, &lt;code&gt;outfits&lt;/code&gt; will have a value (given that &lt;code&gt;clothingItems&lt;/code&gt; and &lt;code&gt;maxPrice&lt;/code&gt; have values of course), we aren't immediately re-rendering after the first render, and we are still only calling &lt;code&gt;createOutfits&lt;/code&gt; when &lt;code&gt;clothingItems&lt;/code&gt; or &lt;code&gt;maxPrice&lt;/code&gt; changes thanks to &lt;code&gt;useMemo&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;So there you have it, with one technique we followed all three guidelines from the last post, we reduced the number of function calls (renders), simplified the parameters (state), and used memoization. Until next time!&lt;/p&gt;

</description>
      <category>react</category>
      <category>javascript</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Little React Things: React applications are functions</title>
      <dc:creator>Zeke Hernandez</dc:creator>
      <pubDate>Thu, 05 Jan 2023 14:27:58 +0000</pubDate>
      <link>https://forem.com/zeke/react-applications-are-functions-2193</link>
      <guid>https://forem.com/zeke/react-applications-are-functions-2193</guid>
      <description>&lt;p&gt;&lt;em&gt;Little React Things is a series of short, React-focused posts where I share some things I've learned over the past few years of developing with React. I hope you find them helpful. These posts might be most helpful for those who have at least a little experience with React already.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;This is the first post of the Little React Things series and lays the foundation for the posts to follow. Consequently, it will probably be the longest post of the series, so hang in there!&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  React applications are functions
&lt;/h2&gt;

&lt;p&gt;What are React applications? A React application is a React component that is often made up of smaller React components. What is a React component? It's a function. Then according to the transitive property, a React application is a function. Hooray logic.&lt;/p&gt;

&lt;p&gt;Many of you have seen this notation &lt;code&gt;f(x) = y&lt;/code&gt; where &lt;code&gt;f&lt;/code&gt; is a function, &lt;code&gt;x&lt;/code&gt; the input, and &lt;code&gt;y&lt;/code&gt; the output. A React application is the &lt;code&gt;f&lt;/code&gt; in that equation, &lt;code&gt;x&lt;/code&gt; is your React state, and &lt;code&gt;y&lt;/code&gt; is the resulting user interface.&lt;/p&gt;

&lt;p&gt;Just a note, when I say "React state", I'm talking about &lt;em&gt;all&lt;/em&gt; the React state in your application, from all your uses of &lt;code&gt;useState&lt;/code&gt;, &lt;code&gt;useReducer&lt;/code&gt;, or your favorite state management library (or your least favorite).&lt;/p&gt;

&lt;p&gt;If we were to take a closer look at the body of such a function &lt;code&gt;f&lt;/code&gt;, it might look something like:&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="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;f&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;x&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="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;div&lt;/span&gt; &lt;span class="na"&gt;id&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s"&gt;"my-react-application"&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
            &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;h1&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;Hello, &lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;x&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;name&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;h1&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
            &lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nf"&gt;f1&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;x&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;
            &lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nf"&gt;f2&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;x&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;
            &lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nf"&gt;f3&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;x&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;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;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;where &lt;code&gt;f1&lt;/code&gt;, &lt;code&gt;f2&lt;/code&gt;, and &lt;code&gt;f3&lt;/code&gt; are various React children components (with bodies that can also look like the code above) of this component. &lt;/p&gt;

&lt;h3&gt;
  
  
  When is the function called?
&lt;/h3&gt;

&lt;p&gt;The React function is called whenever &lt;code&gt;x&lt;/code&gt; changes. Whenever the React state changes, the function is "called" and a new UI is returned. Now, technically, if a piece of state is only scoped to a child component (like let's say &lt;code&gt;f1&lt;/code&gt; in the code above), React is aware enough to call just that sub-function and not the whole thing. &lt;/p&gt;

&lt;h3&gt;
  
  
  Does &lt;code&gt;f(x)&lt;/code&gt; always return the same &lt;code&gt;y&lt;/code&gt;?
&lt;/h3&gt;

&lt;p&gt;In other words, are React applications "pure functions"? No, they are not. They can be! But often are not. Though state changes are the only thing to cause the function to be called, there are other things outside React state that affect the resulting UI. The resulting UI could be affected by the browser window size, the current time, or even just a random number generator. &lt;/p&gt;

&lt;h2&gt;
  
  
  Implications
&lt;/h2&gt;

&lt;p&gt;If React applications are functions, then it follows that guidance for writing good functions applies to writing good React applications (more logic!).&lt;/p&gt;

&lt;h3&gt;
  
  
  Call the function as few times as possible
&lt;/h3&gt;

&lt;p&gt;Calling the same function over and over and over again obviously can cause performance issues in any kind of system. Furthermore, the more you call the function, the more opportunities you are creating for that function to fail.&lt;/p&gt;

&lt;h3&gt;
  
  
  Keep the parameters simple
&lt;/h3&gt;

&lt;p&gt;Let's say you have a function, &lt;code&gt;numberStuff(x: number)&lt;/code&gt;. You'll want to make sure you write your function in such a way that it works gracefully with whatever number the user passes in. They could pass in a positive number, a negative number, or even zero.&lt;/p&gt;

&lt;p&gt;Now let's say you have another function, &lt;code&gt;moreNumberStuff(x: number, y:number)&lt;/code&gt;. With two parameters, you need to be even more careful how you write this function. This function needs to work gracefully if &lt;code&gt;x&lt;/code&gt; is positive and &lt;code&gt;y&lt;/code&gt; is negative, if they're both positive, if one is zero, or if they're both zero. You've potentially increased the complexity just by adding another parameter. &lt;/p&gt;

&lt;p&gt;The same applies to your React state, the more complex your React state, the more complex your React components need to be in order to render a reasonable UI given all the potential permutations.&lt;/p&gt;

&lt;h3&gt;
  
  
  Use memoization
&lt;/h3&gt;

&lt;p&gt;From &lt;a href="https://en.wikipedia.org/wiki/Memoization" rel="noopener noreferrer"&gt;Wikipedia&lt;/a&gt;:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;In computing, memoization or memoisation is an optimization technique used primarily to speed up computer programs by storing the results of expensive function calls and returning the cached result when the same inputs occur again.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;React has a built in higher order component for performing this technique, &lt;a href="https://reactjs.org/docs/react-api.html#reactmemo" rel="noopener noreferrer"&gt;&lt;code&gt;memo&lt;/code&gt;&lt;/a&gt;. Memoization like any technique is not a silver bullet. Like anything in software development, there are tradeoffs. When and how to use &lt;code&gt;memo&lt;/code&gt; could be a post on its own, in fact it often is. One that I recommend is &lt;a href="https://dmitripavlutin.com/use-react-memo-wisely/" rel="noopener noreferrer"&gt;Use React.memo() wisely (dmitripavlutin.com)&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;I hope to provide practical React tips to apply these guidelines in the following posts of this series. So, stay tuned!&lt;/p&gt;

</description>
      <category>react</category>
      <category>javascript</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Handy tips for software support</title>
      <dc:creator>Zeke Hernandez</dc:creator>
      <pubDate>Mon, 23 Apr 2018 13:36:55 +0000</pubDate>
      <link>https://forem.com/zeke/handy-tips-for-software-support-2iap</link>
      <guid>https://forem.com/zeke/handy-tips-for-software-support-2iap</guid>
      <description>&lt;p&gt;&lt;em&gt;This post was first published on my blog, &lt;a href="https://zekehernandez.com/posts/handy-tips-for-software-support/" rel="noopener noreferrer"&gt;here&lt;/a&gt;&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;One thing I did not realize when I started my career as a software engineer was how much time would be spent investigating issues and fixing bugs. At my current company, my teammates and I take turns being the point-person for production issues and support tickets; it's not my favorite shift, but it needs to be done.&lt;/p&gt;

&lt;p&gt;Being responsible for several issues and bugs can be quite overwhelming, especially if you bounce between several support tickets multiple times a day. Over the past few years, I've adopted several practices that I've found helpful, and maybe they can help you too!&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Be organized
&lt;/h2&gt;

&lt;p&gt;It sounds obvious, but organization can drastically improve your efficiency as a programmer. When returning to work on a ticket in the morning or after a weekend or after working on something else, we want to spend less time asking "what was this all about again?" or "how far along was I in this?" and more time fixing the problem. Here's how I like to stay organized. &lt;/p&gt;

&lt;h3&gt;
  
  
  Folder
&lt;/h3&gt;

&lt;p&gt;I like to have a folder that contains a folder for each ticket I'm dealing with that shift. Each folder is labeled with the ticket number and a brief description (usually the title of the ticket). In each folder, I keep any data files that I may have copied from one of our file servers. If I have taken any notes that don't need to be shared on the ticket itself, I'll keep those here too. Lastly, I keep a SQL file here (more on that later).&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%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fm3tsfwcjp7uy95hkak7g.png" 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%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fm3tsfwcjp7uy95hkak7g.png" alt="Folder Screenshot"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;An extra note about files: if you are investigating a data issue and you have a set of files that have good data and some that have bad, clearly label them GOOD and BAD. It sounds obvious, but I've only just started doing this, and it really helps. The less you have to access the hard-drive that is your long term memory, the faster you work. More significantly, there's nothing worse than scrutinizing a file thinking it's a bad file when, in fact, it is not.&lt;/p&gt;

&lt;h3&gt;
  
  
  Bookmarks
&lt;/h3&gt;

&lt;p&gt;Similar to our filesystem folder, it is good to have a clearly labeled bookmark folder that has bookmarks to any and all pages relevant to the ticket. Links to reading material, Stack Overflow questions, and documentation are all valuable items to preserve. If you are working on a web application, bookmarks to the pages of issue are very handy as well.&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%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fcu4wrhcapdgynshvq5hb.png" 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%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fcu4wrhcapdgynshvq5hb.png" alt="Bookmark Screenshot"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  SQL
&lt;/h3&gt;

&lt;p&gt;Lastly, I like to have a SQL file that contains any queries that I use in my investigation of the ticket. Personally, this has been the most helpful practice of all. When jumping back and forth between tickets, I found that I was having to recreate certain queries each time to catch up to where I was before. This is an absolute waste of time. If you have any queries that aren't obvious in their function, slap a comment on them; you may remember what they do now, but you might not after a long weekend.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Be humble
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Ask for help
&lt;/h3&gt;

&lt;p&gt;You want to find an optimal balance between asking for help and figuring it out yourself. In my experience, that balance is found in asking for help more often than not. What I mean by "asking for help" is not asking someone to solve your problems, but rather to point you in the right direction. If you are afraid that you are bothering your teammates, remember, it's better to spend 15 minutes of both of your time figuring something out than you banging your head against that problem for an hour. If your teammates have been in the game for awhile, I'm sure they understand this. &lt;/p&gt;

&lt;p&gt;Your fellow engineers aren't the only people who can help you in fixing issues. If the issue was reported by technical support or customer representative; make sure to chat with them about anything ambiguous or unclear in the ticket. Avoid wasting time solving the wrong problems.&lt;/p&gt;

&lt;h3&gt;
  
  
  Don't be arrogant, just don't
&lt;/h3&gt;

&lt;p&gt;If a client is reporting behavior in your application as a bug or issue, and tech support sends it up to you, but it turns out the application is working as intended, or the issue is due to customer error; be gracious in your response.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Don't&lt;/strong&gt; make the tech support person or client feel dumb for not realizing this.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Do&lt;/strong&gt; use this as an opportunity to reevaluate your application to see if there are ways to prevent this issue from happening again.&lt;/li&gt;
&lt;li&gt;Seriously, be kind. It goes a long way.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  3. Be helpful
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Work with your support team
&lt;/h3&gt;

&lt;p&gt;If you aren't interfacing with customers directly, someone else is, and they are probably the person who reported the ticket. Be conscious of the pressure this position can bring. Be quick in your first response to a ticket; if there's any information you can give immediately, provide that as soon as you can. Also, keep them posted on any updates; you don't want your customers to feel like you aren't working on their issue. Furthermore, if there is a tech support / customer support manager, talk to him or her to see if they have a priority list of which issues should be addressed first. It can be tempting to work on issues that appeal to you, but that is not helpful for your team. Trust your support teams to accurately gauge the feelings of the customer.&lt;/p&gt;

&lt;h3&gt;
  
  
  Lend a hand to your fellow engineers
&lt;/h3&gt;

&lt;p&gt;In larger engineer teams, it's hard to know the ins and outs of every software component. When you are done investigating and resolving an issue, document it. If you found yourself debugging an poorly documented system, fix that! Don't let the next developer have to go through the same thing as you. You can both document this in a permanent place where your teammates can easily find it, but also I'd encourage just sending a message to your teammates saying something along the lines of "Hey all, I just was investigating &lt;em&gt;x&lt;/em&gt; and found out &lt;em&gt;y&lt;/em&gt; and &lt;em&gt;z&lt;/em&gt;, let me know if you'd like to hear more about it."&lt;/p&gt;

&lt;p&gt;Okay, that's all I got. I hope you find at least some of this helpful. If you have any additional tips to share, please do below. Now go put out those fires!&lt;/p&gt;

</description>
      <category>support</category>
      <category>productivity</category>
      <category>organization</category>
    </item>
    <item>
      <title>How's your Omnibox game?</title>
      <dc:creator>Zeke Hernandez</dc:creator>
      <pubDate>Mon, 08 Jan 2018 00:00:00 +0000</pubDate>
      <link>https://forem.com/zeke/hows-your-omnibox-game-1gp1</link>
      <guid>https://forem.com/zeke/hows-your-omnibox-game-1gp1</guid>
      <description>&lt;p&gt;&lt;em&gt;This post was first published on my blog, &lt;a href="https://zekehernandez.com/posts/your-omnibox-game/" rel="noopener noreferrer"&gt;here&lt;/a&gt;&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;If you are developer in 2018 chances are, if you are on your computer, you have a web browser open. And according to &lt;a href="http://gs.statcounter.com/browser-market-share/desktop/worldwide" rel="noopener noreferrer"&gt;this&lt;/a&gt;, there's over a 60% chance that it's Chrome. If so, this is for you.&lt;/p&gt;

&lt;p&gt;By now, many of you know that you can set up custom search engines to use in Chrome's Omnibox, they're super handy. If you know how to set one up, skip down a paragraph; if not, here's how: &lt;br&gt;
In Chrome, go to &lt;em&gt;Settings &amp;gt; Manage search engines&lt;/em&gt;. Here you can define custom search engines that have three properties: a name, an alias, and a URL. For example, I have a custom search engine called Wikipedia, with an alias &lt;em&gt;wiki&lt;/em&gt;, and &lt;em&gt;&lt;a href="http://en.wikipedia.org/w/index.php?title=Special:Search&amp;amp;search=%s" rel="noopener noreferrer"&gt;http://en.wikipedia.org/w/index.php?title=Special:Search&amp;amp;search=%s&lt;/a&gt;&lt;/em&gt; as the URL. The &lt;em&gt;%s&lt;/em&gt; will be replaced by the search string. If I want to search Wikipedia, all I have to do is, in the Omnibox, type &lt;em&gt;wiki&lt;/em&gt; (space or tab) and then the search string (whatever I want to search for), and bam, it is searched.&lt;/p&gt;

&lt;p&gt;Now, being able to search websites easily through the Omnibox is well and good, but let's try thinking outside of the (Omni)box. I will share with you some of my favorite custom search engines, and why they are great (or at least neat).&lt;/p&gt;

&lt;p&gt;In order from neat to necessary:&lt;/p&gt;

&lt;h3&gt;
  
  
  5. Translate (for me, English to Spanish)
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;URL&lt;/strong&gt;: &lt;a href="https://translate.google.com/?source=osdd#en/es/%s" rel="noopener noreferrer"&gt;https://translate.google.com/?source=osdd#en/es/%s&lt;/a&gt;&lt;br&gt;
Where &lt;em&gt;en&lt;/em&gt; is the "from" language, and &lt;em&gt;es&lt;/em&gt; is the "to" language. I would rank this higher if I used it more, but still, handy in a pinch! I'm sure you could do the same with another translating service.&lt;/p&gt;

&lt;h3&gt;
  
  
  4. Thesaurus/Dictionary
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Thesaurus URL&lt;/strong&gt;: &lt;a href="http://www.thesaurus.com/browse/%s?s=t" rel="noopener noreferrer"&gt;http://www.thesaurus.com/browse/%s?s=t&lt;/a&gt;&lt;br&gt;
&lt;strong&gt;Dictionary URL&lt;/strong&gt;: &lt;a href="https://www.merriam-webster.com/dictionary/%s" rel="noopener noreferrer"&gt;https://www.merriam-webster.com/dictionary/%s&lt;/a&gt;&lt;br&gt;
Obviously, use whatever dictionary website you want. Once I set up the thesaurus search engine, I find that I use it a surprising amount! And now I write illustriously.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Work related things
&lt;/h3&gt;

&lt;p&gt;I use a lot Atlassian products, like Jira and Confluence, and I've set up a custom search engine for Confluence, and one search engine for each Jira board I'm interested in. If you or your company has some sort of intranet site or wiki or online documentation, a custom search engine works like a charm.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Maps
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;URL&lt;/strong&gt;: &lt;a href="https://www.google.com/maps/search/%s" rel="noopener noreferrer"&gt;https://www.google.com/maps/search/%s&lt;/a&gt;&lt;br&gt;
I use &lt;em&gt;maps&lt;/em&gt; as the alias, so I can type "maps Chipotle" and will immediately be shown the nearest Chipotles, which is cool, but we can take it a step further. I can also type "maps here to Chipotle" and I will be given directions to the nearest Chipotle. Technology at it's finest. Furthermore, if you have your home or work location set with Google Maps, you can type things like "maps work to Chipotle" and be given directions for that.&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Gifs
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Google URL&lt;/strong&gt;: &lt;a href="https://www.google.com/search?q=%s&amp;amp;tbm=isch&amp;amp;tbs=itp:animated" rel="noopener noreferrer"&gt;https://www.google.com/search?q=%s&amp;amp;tbm=isch&amp;amp;tbs=itp:animated&lt;/a&gt;&lt;br&gt;
&lt;strong&gt;Giphy URL&lt;/strong&gt;: &lt;a href="https://giphy.com/search/%s" rel="noopener noreferrer"&gt;https://giphy.com/search/%s&lt;/a&gt;&lt;br&gt;
You want to be the fastest gif in the West? This is how. Call me old-fashioned, but I prefer Google's animated image search over Giphy, especially at work. I mean, the last thing I want is a bunch of flashing colors and images on my screen to draw attention to the fact that I'm looking for a gif.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Honorable Mentions&lt;/strong&gt;&lt;br&gt;
Amazon, YouTube, Google Calendar, Bible Gateway, Spotify&lt;/p&gt;

&lt;p&gt;Happy searching in a customized way!&lt;/p&gt;

&lt;p&gt;Also, let me know if you have any custom search engines that you like!&lt;/p&gt;

</description>
      <category>productivity</category>
    </item>
    <item>
      <title>A fresh coat of paint</title>
      <dc:creator>Zeke Hernandez</dc:creator>
      <pubDate>Sun, 12 Nov 2017 00:00:00 +0000</pubDate>
      <link>https://forem.com/zeke/fresh-coat-of-paint-cb3</link>
      <guid>https://forem.com/zeke/fresh-coat-of-paint-cb3</guid>
      <description>&lt;p&gt;My wife and I recently painted several rooms in our house. The old colors were from the previous owners and we wanted to make the house more our own. It really is surprising how much a new wall color can change the overall vibe of a room. It's quite refreshing and brings a new life to the space.&lt;/p&gt;

&lt;p&gt;Similarly, I have now been working at my current company for a little more than four months; and up until recently, had been using the default fonts and colors for Visual Studio. But a couple weeks ago I switched from a light theme to a dark theme, hand selected a few colors for major text editor elements (like keywords, comments, and literals), and switched the font to Inconsolata.&lt;/p&gt;

&lt;p&gt;All these changes are very superficial, but they helped usher in a new energy when coding. Furthermore, it encouraged me to treat my code as an art: visually pleasing, easy to read and understand, and structurally consistent.&lt;/p&gt;

&lt;p&gt;If you feel like your maybe in a rut with coding, try shaking things up a little. Small changes can help add some excitement from what can easily become a daily grind.&lt;/p&gt;

</description>
      <category>workspace</category>
    </item>
    <item>
      <title>Introducing Creative Owlet</title>
      <dc:creator>Zeke Hernandez</dc:creator>
      <pubDate>Fri, 10 Nov 2017 18:22:00 +0000</pubDate>
      <link>https://forem.com/zeke/introducing-creative-owlet-efm</link>
      <guid>https://forem.com/zeke/introducing-creative-owlet-efm</guid>
      <description>&lt;p&gt;Hey all, so there's this part of my brain that is constantly trying to come up with interesting/unique mechanics for video games. I've tried my hand at implementing these ideas in Unity and whatnot, but I just don't have the resources to allocate to see them through. So if any of you are indie game developers and need some inspiration, check out my blog &lt;a href="http://creativeowlet.com"&gt;Creative Owlet&lt;/a&gt; for some inspiration.&lt;/p&gt;

&lt;p&gt;I'm not saying that these are all amazing, full fledged game pitches, but maybe they could serve as a jumping point for some great games.&lt;/p&gt;

</description>
      <category>gamedev</category>
      <category>indie</category>
    </item>
    <item>
      <title>Memoization in the wild</title>
      <dc:creator>Zeke Hernandez</dc:creator>
      <pubDate>Wed, 07 Jun 2017 23:18:32 +0000</pubDate>
      <link>https://forem.com/zeke/memoization-in-the-wild</link>
      <guid>https://forem.com/zeke/memoization-in-the-wild</guid>
      <description>

</description>
      <category>dynamicprogramming</category>
      <category>finance</category>
    </item>
    <item>
      <title>Hi, I'm Zeke</title>
      <dc:creator>Zeke Hernandez</dc:creator>
      <pubDate>Wed, 07 Jun 2017 19:04:07 +0000</pubDate>
      <link>https://forem.com/zeke/hi-im-zeke</link>
      <guid>https://forem.com/zeke/hi-im-zeke</guid>
      <description>&lt;p&gt;I have been coding for about six years now, four of those professionally. &lt;br&gt;
Just moved to the Twin Cities, and had my first child. Working remotely for an investment firm in Chicagoland.&lt;/p&gt;

&lt;p&gt;I mostly program in Delphi and Java, but I am currently learning more about Angular 2, and front-end development in general.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;pictured above is one of the many, many lakes in Minnesota&lt;/em&gt;&lt;/p&gt;

</description>
      <category>introduction</category>
    </item>
  </channel>
</rss>
