<?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: Jerry</title>
    <description>The latest articles on DEV Community by Jerry (@jareechang).</description>
    <link>https://dev.to/jareechang</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%2F92814%2F8c49b2e5-4065-4b05-9f58-7d0213225421.jpg</url>
      <title>DEV Community: Jerry</title>
      <link>https://dev.to/jareechang</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/jareechang"/>
    <language>en</language>
    <item>
      <title>Only 34% of developers got this JS concept right 😱❗️❗️</title>
      <dc:creator>Jerry</dc:creator>
      <pubDate>Wed, 29 Mar 2023 06:17:33 +0000</pubDate>
      <link>https://dev.to/jareechang/only-34-of-developers-got-this-js-concept-right-1ok8</link>
      <guid>https://dev.to/jareechang/only-34-of-developers-got-this-js-concept-right-1ok8</guid>
      <description>&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--mM2KPTzK--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/imdzwsikwbyaempon5jb.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--mM2KPTzK--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/imdzwsikwbyaempon5jb.png" alt="Image JS Concept poll" width="880" height="880"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The question in that poll may &lt;em&gt;seem&lt;/em&gt; simple but in reality, there is a few things going on.&lt;/p&gt;

&lt;p&gt;If you are wondering the answer to that question is &lt;code&gt;steak&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Let’s break that down.&lt;/p&gt;

&lt;h3&gt;
  
  
  Pass By Reference
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--UWeUBVuO--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fpbu4y70l1u4k80qmn14.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--UWeUBVuO--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fpbu4y70l1u4k80qmn14.png" alt="Image Javascript Pass By Reference illustration" width="880" height="880"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Objects within Javascript are pass by reference by default.&lt;/p&gt;

&lt;p&gt;What that means is variable definition and assignment are linked to the object as a reference.&lt;/p&gt;

&lt;p&gt;So, any changes to that object means... &lt;strong&gt;You are changing the original object&lt;/strong&gt; ❗️&lt;/p&gt;

&lt;p&gt;The reason this is not ideal is because you are mutating the value of an object for all the code using that object.&lt;/p&gt;

&lt;p&gt;And that can lead to really hard to debug bugs.&lt;/p&gt;

&lt;p&gt;So, what can you do about it ?&lt;/p&gt;

&lt;p&gt;Well, that’s where cloning comes in.&lt;/p&gt;

&lt;p&gt;Let‘s see how that works.&lt;/p&gt;

&lt;h3&gt;
  
  
  Object Cloning
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--RHgJibEi--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/h6rviq6t27gcjuz59lo3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--RHgJibEi--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/h6rviq6t27gcjuz59lo3.png" alt="Image Object Cloning illustration" width="880" height="880"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;One way to combat against this issue is through cloning of the object when re-assigning or when you are changing it.&lt;/p&gt;

&lt;p&gt;When you clone an object, you are essentially creating a new copy of it.&lt;/p&gt;

&lt;p&gt;So, that variable no longer references the original, it now references the new copy.&lt;/p&gt;

&lt;p&gt;This way when you make changes to that object, it doesn’t affect the original object.&lt;/p&gt;

&lt;p&gt;So, how do you do this in Javascript ?&lt;/p&gt;

&lt;p&gt;Let’s look at some techniques you can use to achieve this.&lt;/p&gt;

&lt;h3&gt;
  
  
  Object Cloning techniques (Javascript)
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--61MGIA99--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gzx4v91cge5dchige280.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--61MGIA99--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gzx4v91cge5dchige280.png" alt="Image Javascript Object Cloning Techniques" width="880" height="880"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Here are 3 methods for cloning objects:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Object.assign&lt;/strong&gt; - creates a shallow copy of the object&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Spread operator&lt;/strong&gt; - creates a shallow copy of the object&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;structuredClone&lt;/strong&gt; - creates a deep copy of the object&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The difference between shallow and deep is that deep will copy all the nested objects within the object. Shallow will not do this.&lt;/p&gt;

&lt;p&gt;And there you have it!&lt;/p&gt;

&lt;p&gt;Remember be careful when mutating or changing references to objects.&lt;/p&gt;

&lt;p&gt;It can leads to nasty bugs!&lt;/p&gt;

&lt;p&gt;If you learned something new or enjoyed this article, be sure to give it a like or share with someone you know!&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>beginners</category>
      <category>webdev</category>
      <category>programming</category>
    </item>
    <item>
      <title>Typescript: 5 Resources To Become A Pro</title>
      <dc:creator>Jerry</dc:creator>
      <pubDate>Sun, 26 Mar 2023 03:51:38 +0000</pubDate>
      <link>https://dev.to/jareechang/typescript-5-resources-to-become-a-pro-385n</link>
      <guid>https://dev.to/jareechang/typescript-5-resources-to-become-a-pro-385n</guid>
      <description>&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--iqSVrTdF--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/462ydnn5a27epsepwqdw.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--iqSVrTdF--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/462ydnn5a27epsepwqdw.jpg" alt="Image Five by Johnny Caspari" width="768" height="1152"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Photo by &lt;a href="https://unsplash.com/@jonnysplsh"&gt;Johnny Caspari&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  1. Learn TypeScript in 5 minutes
&lt;/h2&gt;

&lt;p&gt;Don’t have hours to look through documentations ? &lt;/p&gt;

&lt;p&gt;Check this quick guide that will get you up to speed on Typescript!&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Link&lt;/strong&gt; 👉 &lt;a href="https://www.freecodecamp.org/news/learn-typescript-in-5-minutes-13eda868daeb/"&gt;Learn TypeScript in 5 minutes&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Learn TypeScript – The Ultimate Beginners Guide
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://www.freecodecamp.org/news/learn-typescript-beginners-guide/"&gt;Learn TypeScript – The Ultimate Beginners Guide&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Typescript handbook
&lt;/h2&gt;

&lt;p&gt;A lot of references, and comprehensive guide to the language (syntax, features and best practices).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Link&lt;/strong&gt; 👉 &lt;a href="https://www.typescriptlang.org/docs/handbook/intro.html"&gt;Typescript handbook&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  4. TypeScript Deep Dive
&lt;/h2&gt;

&lt;p&gt;A very comprehensive deep dive into Typescript with practical examples.&lt;/p&gt;

&lt;p&gt;Tips, Tricks, best practices and more.&lt;/p&gt;

&lt;p&gt;Be sure to check it out!&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Link&lt;/strong&gt; 👉 &lt;a href="https://basarat.gitbook.io/typescript/"&gt;TypeScript Deep Dive&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  5. React + Typescript cheatsheet
&lt;/h2&gt;

&lt;p&gt;A lot of great information about using Typescript.&lt;/p&gt;

&lt;p&gt;It’s a very comprehensive cheatsheet with a lot of example.&lt;/p&gt;

&lt;p&gt;I refer to it a lot.&lt;/p&gt;

&lt;p&gt;It’s a must have in your bookmark! (Especially if you use React)&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Link&lt;/strong&gt; 👉 &lt;a href="https://github.com/typescript-cheatsheets/react"&gt;React + Typescript cheatsheet&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;That’s all.&lt;/p&gt;

&lt;p&gt;Be sure to bookmark this, and if you found this article helpful, please share it with someone you know!&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Thinking in React (Visualized)</title>
      <dc:creator>Jerry</dc:creator>
      <pubDate>Fri, 17 Mar 2023 04:44:28 +0000</pubDate>
      <link>https://dev.to/jareechang/thinking-in-react-visualized-g4p</link>
      <guid>https://dev.to/jareechang/thinking-in-react-visualized-g4p</guid>
      <description>&lt;p&gt;When working with React.js, one of the most important thing you need to do is to shift your thinking.&lt;/p&gt;

&lt;p&gt;It introduces a new mental model for developers to think and approach developing User interfaces (UI) in an easy and understandable way.&lt;/p&gt;

&lt;p&gt;You declare how your HTML should look and act without worrying about the details.&lt;/p&gt;

&lt;p&gt;React.js handles all the details of the HTML like rendering, updating and removing elements from the HTML DOM for you.&lt;/p&gt;

&lt;p&gt;The documentation describes this as “Thinking in React”.&lt;/p&gt;

&lt;p&gt;Yeah... but what does that actually mean ?&lt;/p&gt;

&lt;p&gt;Let’s dive into the process with an example!&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Isolate the User Interface into independent components
&lt;/h3&gt;

&lt;p&gt;When we look at an User Interface (UI), we need to think about the “components” or the parts that make up the whole.&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%2Fuploads%2Farticles%2Fl2n3ynft5z5rx45gyrv5.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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fl2n3ynft5z5rx45gyrv5.png" alt="Image Isolate the User Interface into independent components"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In this example, this LinkedIn Page Card will likely be composed of:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;Card&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Button&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Image&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;All of the individual components add up to the whole of the User Interface (UI). &lt;/p&gt;

&lt;h3&gt;
  
  
  2. Create an hierarchical data relationship
&lt;/h3&gt;

&lt;p&gt;Now that we have our individual components, we now need to think about how they relate to each other.&lt;/p&gt;

&lt;p&gt;In addition, how will the “data flow” through out these components.&lt;/p&gt;

&lt;p&gt;In this example, &lt;code&gt;Card&lt;/code&gt; will be the parent, and the data will flow downwards (pass via props) to the children (&lt;code&gt;Button&lt;/code&gt;, &lt;code&gt;Image&lt;/code&gt;).&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%2Fuploads%2Farticles%2Feh7p64gx37jj7i17cdtl.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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Feh7p64gx37jj7i17cdtl.png" alt="Image Create an hierarchical data relationship"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Think about where the state should live
&lt;/h3&gt;

&lt;p&gt;Within React.js, each components can have their own state (using &lt;code&gt;useState&lt;/code&gt;).&lt;/p&gt;

&lt;p&gt;The question comes down to: &lt;strong&gt;Where should we put the state ?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Looking at the “Follow” button, we may need an external API which means we may need some loading state while that gets processed.&lt;/p&gt;

&lt;p&gt;So, in this case, the state is better kept within the &lt;code&gt;Card&lt;/code&gt; component.&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%2Fuploads%2Farticles%2Fmzy7shjfeo4sa0gwl85n.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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmzy7shjfeo4sa0gwl85n.png" alt="Image Think about where the state should live"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  4. Write the Code
&lt;/h3&gt;

&lt;p&gt;Once you are finished with designing the components, state and data flow.&lt;/p&gt;

&lt;p&gt;It’s time to actually code it out!&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Here is what the scaffold may look like:&lt;/strong&gt;&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%2Fuploads%2Farticles%2Fmthtutuj5x1g6j9pvg6a.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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmthtutuj5x1g6j9pvg6a.png" alt="Image Write the react code"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And... That’s it!&lt;/p&gt;

&lt;p&gt;Did you learned something new ?&lt;/p&gt;

&lt;p&gt;Be sure to give it a reaction then share it with someone who think will enjoy this post! ❤️&lt;/p&gt;




&lt;p&gt;Hey, I am also on LinkedIn - &lt;a href="https://www.linkedin.com/in/ijerrychang/" rel="noopener noreferrer"&gt;https://www.linkedin.com/in/ijerrychang/&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;I am always looking to connect with like minded techies 🤓 - just send me an invite!  &lt;/p&gt;

</description>
      <category>javascript</category>
      <category>typescript</category>
      <category>beginners</category>
      <category>webdev</category>
    </item>
    <item>
      <title>The Science Behind Expert Decision Making</title>
      <dc:creator>Jerry</dc:creator>
      <pubDate>Sat, 11 Mar 2023 21:06:29 +0000</pubDate>
      <link>https://dev.to/jareechang/the-science-behind-expert-decision-making-23mj</link>
      <guid>https://dev.to/jareechang/the-science-behind-expert-decision-making-23mj</guid>
      <description>&lt;p&gt;The recognition-primed decision (RPD) model was introduced by Dr. Gary Klein.&lt;/p&gt;

&lt;p&gt;It’s a model for understanding how these experts are able to instantaneously come up with answers or solutions in highly complex situations.&lt;/p&gt;

&lt;p&gt;These results are from research that studied firefighters, and later on military operations have shifted their training to applied similar models into their training on decision making.&lt;/p&gt;

&lt;p&gt;There are four distinct phases of this expert intuition process.&lt;/p&gt;

&lt;p&gt;Let’s go through the process!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--G7xruPnm--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/abmbo6nevgh2tl66pusp.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--G7xruPnm--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/abmbo6nevgh2tl66pusp.png" alt="Image Expert decision making process" width="880" height="880"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;1️⃣ 𝗖𝘂𝗲 - A pattern is recognized in a situation (System 1)&lt;/p&gt;

&lt;p&gt;2️⃣ 𝗜𝗻𝗳𝗼𝗿𝗺𝗮𝘁𝗶𝗼𝗻 (𝗠𝗲𝗺𝗼𝗿𝘆) - The pattern is matched with a piece of information in the associative memory (System 1)&lt;/p&gt;

&lt;p&gt;3️⃣ 𝗔𝗻𝗮𝗹𝘆𝘀𝗶𝘀 - Analysis takes place to determine if it makes sense or if it will work (System 2)&lt;/p&gt;

&lt;p&gt;4️⃣ 𝗗𝗲𝗰𝗶𝘀𝗶𝗼𝗻 - A decision is proposed or made (Assuming it passes phase 3)&lt;/p&gt;

&lt;h3&gt;
  
  
  💡 System 1 vs System 2
&lt;/h3&gt;

&lt;p&gt;You may have noticed I labeled the steps with either System 1 or 2.&lt;/p&gt;

&lt;p&gt;These two systems were introduced by Dr. Daniel Kahneman in his book “Thinking fast and slow” to better understand how humans think.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;System 1&lt;/strong&gt; - intuitive thinking or “fast thinking”&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;System 2&lt;/strong&gt; - analysis or “slow thinking”&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This means that step 1 and 2 in the RPD process are the works of system 1.&lt;/p&gt;

&lt;p&gt;This is why these experts are unable to trace the steps of how they arrived at a solution or answer because this process happens automatically.&lt;/p&gt;

&lt;p&gt;It is their intuitive thinking that allows them to not only recognize the pattern but retrieve the correct information.&lt;/p&gt;

&lt;p&gt;You can probably tell why this is important for individuals like firefighters and military personnels because these individuals tend to operate in highly complex, fast paced and time sensitive environments.&lt;/p&gt;

&lt;h3&gt;
  
  
  How can I apply this to my learning ?
&lt;/h3&gt;

&lt;p&gt;Even though this says “expert decision making”, this process is the same for everyone.&lt;/p&gt;

&lt;p&gt;When you are learning, you can improve stages 1 and 2 in the decision making process in order to make it easier to recall information.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--vZd1Sag1--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/nwi6gk986hpqhtw1an91.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--vZd1Sag1--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/nwi6gk986hpqhtw1an91.png" alt="Image Improving the cue and retrieval process while learning" width="880" height="880"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Specifically, these are &lt;strong&gt;the cue (stage 1)&lt;/strong&gt; and &lt;strong&gt;information retrieval (stage 2)&lt;/strong&gt; phase of the decision making process.&lt;/p&gt;

&lt;p&gt;And how you improve these two phases will be different for everyone.&lt;/p&gt;

&lt;p&gt;What that means in practice can be exposing your brain to multiple sources of information (videos, images, audio and writing) when learning.&lt;/p&gt;

&lt;p&gt;This will improve your brain’s ability to recognize patterns in programming or anything else you are learning about.&lt;/p&gt;

&lt;p&gt;Again, you don’t have to measure this or see if it works. &lt;/p&gt;

&lt;p&gt;Just make sure you are exposing yourself to multiple sources of information to enhance the cue process, and let your brain do all the heavy lifting!&lt;/p&gt;

&lt;p&gt;And that’s Dr. Gary Klein’s model for understanding expert intuition.&lt;/p&gt;

&lt;p&gt;Next up we’ll contrast this with another model by Dr. Paul Meehl.&lt;/p&gt;

&lt;p&gt;It uses the same RPD process described above but we’ll take a look at why it doesn’t work in some scenarios for some experts (ie Stock pickers and political scientists ).&lt;/p&gt;

&lt;p&gt;That’s all for now.&lt;/p&gt;

&lt;p&gt;If you learned something or enjoyed this post then be sure to share it with someone who you think would benefit from it!&lt;/p&gt;

&lt;p&gt;Be sure to follow me to stay up-to-date 👉 &lt;a class="mentioned-user" href="https://dev.to/jareechang"&gt;@jareechang&lt;/a&gt;&lt;/p&gt;

</description>
      <category>learning</category>
      <category>career</category>
      <category>beginners</category>
      <category>motivation</category>
    </item>
    <item>
      <title>Understanding Identity Access Management (An analogy)</title>
      <dc:creator>Jerry</dc:creator>
      <pubDate>Sat, 11 Mar 2023 20:43:37 +0000</pubDate>
      <link>https://dev.to/jareechang/understanding-identity-access-management-an-analogy-2png</link>
      <guid>https://dev.to/jareechang/understanding-identity-access-management-an-analogy-2png</guid>
      <description>&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--nvLMCupf--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/utck1ooej4racdahn6r8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--nvLMCupf--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/utck1ooej4racdahn6r8.png" alt="Image Identity Access Management, a foundational building block" width="880" height="880"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;What is this IAM thing ?&lt;/p&gt;

&lt;p&gt;and… why do I need to know about it ?&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;It’s a must know! It’s a major key when working in the cloud 🔑&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Here is a good way to think about it.&lt;/p&gt;

&lt;p&gt;Imagine you are going to a conference, and within the venues there are security personnel in different areas checking people’s passes.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The passes may have the following groups:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Staff&lt;/strong&gt; - The people working there (Organizers, equipment, catering etc)&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Speakers&lt;/strong&gt; - The people speaking at the conference&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;General&lt;/strong&gt; - The general admission for the attendees&lt;/p&gt;

&lt;p&gt;Each of these groups will be allowed to enter with their pass, and have access to different parts of the venue.&lt;/p&gt;

&lt;p&gt;Identity Access Management (IAM) works in a very similar fashion.&lt;/p&gt;

&lt;p&gt;It identifies who is trying to access what then grants access if they have the appropriate permissions.&lt;/p&gt;

&lt;p&gt;The only difference is that IAM is controlling the access to cloud resources.&lt;/p&gt;

&lt;p&gt;These resources may include things like storage, network, compute services and much more in any of the cloud vendors.&lt;/p&gt;

&lt;p&gt;All of which are very common building blocks for most cloud infrastructures.&lt;/p&gt;

&lt;p&gt;Since all these services rely on IAM, I consider it a foundational piece.&lt;/p&gt;

&lt;p&gt;Just like with our example of the conference, IAM is the security personnel.&lt;/p&gt;

&lt;p&gt;It determines who can access what based on a defined policy or a configuration.&lt;/p&gt;

&lt;p&gt;Before we part, let’s do a review!&lt;/p&gt;

&lt;h3&gt;
  
  
  💡 Review
&lt;/h3&gt;

&lt;p&gt;► IAM is the security personnel within the cloud, it controls who and what for access control in all of the services (The technical term for this is Authentication &amp;amp; Authorization)&lt;/p&gt;

&lt;p&gt;► IAM is the building block in which all others services build on top of&lt;/p&gt;

&lt;p&gt;► IAM is one of the core pieces for security in the cloud&lt;/p&gt;

&lt;p&gt;And… That’s all.&lt;/p&gt;

&lt;p&gt;If you are in the process of learning about the cloud, I highly encourage you to start with IAM.&lt;/p&gt;

&lt;p&gt;Like I said, it’s such a foundational piece; and once you learn it, it’ll make learning other services that much easier.&lt;/p&gt;

&lt;p&gt;Do you agree ? or should someone learn something else to start ?&lt;/p&gt;

&lt;p&gt;Let me know in the comments 👇&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>webdev</category>
      <category>cloud</category>
      <category>programming</category>
    </item>
    <item>
      <title>The Mystery of Expert Intuition (Preview)</title>
      <dc:creator>Jerry</dc:creator>
      <pubDate>Wed, 01 Mar 2023 07:25:35 +0000</pubDate>
      <link>https://dev.to/jareechang/the-mystery-of-expert-intuition-preview-25c9</link>
      <guid>https://dev.to/jareechang/the-mystery-of-expert-intuition-preview-25c9</guid>
      <description>&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--dr4s7K2S--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/u0oxs1teihr6b69gpklg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--dr4s7K2S--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/u0oxs1teihr6b69gpklg.png" alt="Image Expert Intuition decisino" width="880" height="880"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Have you ever been in a highly complex situation with an expert and out of no where they just have an answer instantaneously ?&lt;/p&gt;

&lt;p&gt;And when asked about how they knew, they just reply with “trust me, I just know” or “I had a hunch”.&lt;/p&gt;

&lt;p&gt;How is it that they are able to do this instantaneously, and with high accuracy ?&lt;/p&gt;

&lt;p&gt;Is it Magic ? Or is it something else ?&lt;/p&gt;

&lt;p&gt;We’re going to get to the bottom of this!&lt;/p&gt;

&lt;p&gt;In the book “Thinking fast and slow” by Daniel Kahneman, he presents two models to better understand this phenomenon which is referred to as expert intuition.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;🧠 𝗧𝗵𝗲 𝘁𝘄𝗼 𝗺𝗼𝗱𝗲𝗹𝘀 𝗳𝗼𝗿 𝗲𝘅𝗽𝗲𝗿𝘁 𝗶𝗻𝘁𝘂𝗶𝘁𝗶𝗼𝗻 𝗮𝗿𝗲:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;1️⃣  &lt;strong&gt;Dr. Gary Klein’s model&lt;/strong&gt; (high validity intuition)&lt;/p&gt;

&lt;p&gt;2️⃣  &lt;strong&gt;Dr. Paul Meehl’s model&lt;/strong&gt; (low validity intuition, statistical method)&lt;/p&gt;

&lt;p&gt;These results are from years of research on studying clinicians, surgeons, firefighters, nurses, military operations, business operations, stock pickers and pundits.&lt;/p&gt;

&lt;p&gt;We’re going to dive deep into the inner workings of both of these models to dispel some of this “magic” that goes on.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;💡 𝗪𝗵𝘆 𝗶𝘀 𝘁𝗵𝗶𝘀 𝗶𝗺𝗽𝗼𝗿𝘁𝗮𝗻𝘁 𝗳𝗼𝗿 𝗽𝗿𝗼𝗳𝗲𝘀𝘀𝗶𝗼𝗻𝗮𝗹𝘀 ?&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;𝗗𝗲𝗰𝗶𝘀𝗶𝗼𝗻 𝗠𝗮𝗸𝗶𝗻𝗴&lt;/strong&gt; - It will help us to better understand what is behind this seemingly “magical” decision making process (That experts use)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;𝗟𝗲𝗮𝗿𝗻𝗶𝗻𝗴&lt;/strong&gt; - It will also provide insights on how to build expertise&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;𝗗𝗶𝘀𝗰𝗲𝗿𝗻𝗺𝗲𝗻𝘁&lt;/strong&gt; - It will help us understand in what situations should you supplement expert intuition with other decision making methods&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I will be posting a lot more about this topic in the coming weeks.&lt;/p&gt;

&lt;p&gt;It’s going to be a good one so stay tuned!&lt;/p&gt;

&lt;p&gt;Make sure you like this post, and be sure to follow me 👉 &lt;a class="mentioned-user" href="https://dev.to/jareechang"&gt;@jareechang&lt;/a&gt;&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>webdev</category>
      <category>programming</category>
      <category>learning</category>
    </item>
    <item>
      <title>Save Yourself From Data Loss 😱 ️</title>
      <dc:creator>Jerry</dc:creator>
      <pubDate>Wed, 01 Mar 2023 03:17:32 +0000</pubDate>
      <link>https://dev.to/jareechang/save-yourself-from-data-loss-2j4e</link>
      <guid>https://dev.to/jareechang/save-yourself-from-data-loss-2j4e</guid>
      <description>&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Pkv45dkM--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zvwv2juo04tmoqr0hjbq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Pkv45dkM--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zvwv2juo04tmoqr0hjbq.png" alt="Image Data replication across different regions and zones" width="880" height="880"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So, what is blob storage ?&lt;/p&gt;

&lt;p&gt;It is slightly different from storing a file on your computer.&lt;/p&gt;

&lt;p&gt;In fact, it’s a distributed system.&lt;/p&gt;

&lt;p&gt;What that means is that it’s a system that was engineered for availability, reliability, disaster recovery and ease of use.&lt;/p&gt;

&lt;p&gt;Just like a car or airplane or any other mission critical systems.&lt;/p&gt;

&lt;p&gt;A key feature is this disaster recovery capability which provides backups for the files that you store in the blob storage.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How Does It work ?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;When you upload a file to a blob storage, you have an option to specify data redundancy or replication across zones (This will depend on the cloud provider).&lt;/p&gt;

&lt;p&gt;What that means is that the cloud vendor is going to take that file you’ve uploaded and make copies of it then put it in their data centers around the world.&lt;/p&gt;

&lt;p&gt;So, whenever a disaster strikes in one region, only one data center is affected. &lt;/p&gt;

&lt;p&gt;That means only one copy of your data is affected.&lt;/p&gt;

&lt;p&gt;While all the other copies in other data centers are not impacted.&lt;/p&gt;

&lt;p&gt;This reduces the risk of data loss drastically.&lt;/p&gt;

&lt;p&gt;And that’s the power of blob storages.&lt;/p&gt;

&lt;p&gt;In fact, this one feature is probably one of the biggest blocks in many of the commonly used services to provide disaster recovery for other storages and databases.&lt;/p&gt;

&lt;p&gt;Because who wants to lose critical data or files ?&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;𝗪𝗵𝗮𝘁 𝗮𝗿𝗲 𝘁𝗵𝗲 𝗰𝗼𝗺𝗺𝗼𝗻 𝘀𝗲𝗿𝘃𝗶𝗰𝗲𝘀 ?&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Amazon S3  &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Google Cloud storage   &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Azure Blob storage   &lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;💡 Note: The pricing and capabilities will be slightly different but the overall offerings should be relatively similar&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;And that’s it!&lt;/p&gt;

&lt;p&gt;If you didn’t know this was possible... well, now you know!&lt;/p&gt;

&lt;p&gt;Did you find this post helpful ?&lt;/p&gt;

&lt;p&gt;Then consider sharing it with someone you know!&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>cloud</category>
      <category>webdev</category>
      <category>programming</category>
    </item>
    <item>
      <title>Astro: One idea to change your view about it (FOREVER)</title>
      <dc:creator>Jerry</dc:creator>
      <pubDate>Fri, 10 Feb 2023 06:13:57 +0000</pubDate>
      <link>https://dev.to/jareechang/astro-one-idea-to-change-your-view-about-it-forever-37fj</link>
      <guid>https://dev.to/jareechang/astro-one-idea-to-change-your-view-about-it-forever-37fj</guid>
      <description>&lt;h2&gt;
  
  
  Content
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Content&lt;/li&gt;
&lt;li&gt;Introduction&lt;/li&gt;
&lt;li&gt;The types of websites you build&lt;/li&gt;
&lt;li&gt;The Use case&lt;/li&gt;
&lt;li&gt;Conclusion&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;We’re going to talk about Astro.&lt;/p&gt;

&lt;p&gt;Most folks see Astro as yet another framework but I think there is something more to it.&lt;/p&gt;

&lt;p&gt;There is an unique use case for Astro that many folks are not talking about!&lt;/p&gt;

&lt;p&gt;Before we talk about the use case, let’s review some of the key features of Astro.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The key features include:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Static (by default)&lt;/strong&gt; - You can build your website using Javascript but the output is just a static site by default in Astro (Zero JS by default)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Partial Hydration&lt;/strong&gt; - Usage of the “island architecture” to selectively add interactive components into the website &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Flexible Framework support&lt;/strong&gt; - Astro takes a compiler first approach, meaning it supports many frontend frameworks (React, Svelte, Vue etc)&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.jerrychang.ca%2Fimages%2Fastro-stack-cutting-through-layers.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.jerrychang.ca%2Fimages%2Fastro-stack-cutting-through-layers.png" alt="Image Astro: Cutting through the frameworks (A main selling point of Astro)" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;These key features make Astro well suited for these specific scenarios.&lt;/p&gt;

&lt;p&gt;Before we start that discussion, let’s start by looking at the different types of websites we build as developers.&lt;/p&gt;

&lt;p&gt;This will help us to see which type of sites is most suited to be built with Astro.&lt;/p&gt;

&lt;h2&gt;
  
  
  The types of websites you build
&lt;/h2&gt;

&lt;p&gt;If we take a step back and look at the types of website we build, the sites tend to falls into these 5 categories.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Here is what the spectrum looks like:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.jerrychang.ca%2Fimages%2Fastro-stack-types-of-sites-you-build.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.jerrychang.ca%2Fimages%2Fastro-stack-types-of-sites-you-build.png" alt="Image Types of Site you build (H/t to FredKSchott for the original)" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It can be further divided into the sub-categories:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Content Focused (more static)&lt;/strong&gt; - Marketing, Publishing, Ecommerce&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Interaction Focused (more dynamic)&lt;/strong&gt; - Ecommerce, Stateful, Apps&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The capabilities of Astro fits within the ranges of &lt;strong&gt;Marketing, Publishing and Ecommerce&lt;/strong&gt; very well.&lt;/p&gt;

&lt;p&gt;However, if you look at most companies, it typically is a combination of both.&lt;/p&gt;

&lt;p&gt;You typically have a product then you also have a separate marketing site.&lt;/p&gt;

&lt;p&gt;You may ask — Ok, how does Astro fit into this picture ?&lt;/p&gt;

&lt;h2&gt;
  
  
  The Use case
&lt;/h2&gt;

&lt;p&gt;The use case that that many folks are not talking about is using Astro for rapid experimentation and prototyping (especially at scale).&lt;/p&gt;

&lt;p&gt;So, that means using it for within the Marketing, Publshing and Ecommerce context when you already have a product in place. &lt;/p&gt;

&lt;p&gt;This will allow you to re-use some of the code from existing Product (APIs, Components etc) to quickly build your prototypes or experiments separate from the product codebase.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.jerrychang.ca%2Fimages%2Fastro-stack-experimentation-stack.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.jerrychang.ca%2Fimages%2Fastro-stack-experimentation-stack.png" alt="Image Astro: Experimentation Stack" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Again, this an underrated use case because most folks see Astro as just another framework.&lt;/p&gt;

&lt;p&gt;When applied in this way, I see it leveraging the full strength of what Astro has to offer.&lt;/p&gt;

&lt;p&gt;I supose a good slogan to describe this process would be: &lt;strong&gt;Build simple, fast sites while leveraging existing code.&lt;/strong&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Why can’t I just use our existing stack to do this ?
&lt;/h3&gt;

&lt;p&gt;In reality, you can use any stack to do this.&lt;/p&gt;

&lt;p&gt;Astro just fits this use case a lot better (&lt;strong&gt;categories:&lt;/strong&gt; Marketing / Publishing / Ecommerce).&lt;/p&gt;

&lt;p&gt;This is the use case that it was originally designed for.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;I guess it comes down to:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;The level of fidelity of your experiments and prototypes&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The quantity of experiments and prototypes&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If we are talking about large quantities and high to medium fidelity prototypes and experiments, Astro definitely wins in this category.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Astro’s advantages (compared to other frameworks):&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Great balance between flexibiltiy (Island architecture) and baseline performance (static by default)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Simplicity in deployment (Astro build outputs just html, js, css by default)&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.jerrychang.ca%2Fimages%2Fastro-stack-experimentation-at-scale.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.jerrychang.ca%2Fimages%2Fastro-stack-experimentation-at-scale.png" alt="Image Astro: Experimentation at scale" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;While the newer versions Astro provides features to build more complex sites (ie with SSR and API), I still see Astro being most powerful in this “sweet spot”.&lt;/p&gt;

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

&lt;p&gt;And there you have it!&lt;/p&gt;

&lt;p&gt;A different way of looking at how Astro can be used to its fullest potential.&lt;/p&gt;

&lt;p&gt;And of course, the code that you re-use doesn’t have to be from a product, it can be any existing codebase (as long as Astro supports the framework).&lt;/p&gt;

&lt;p&gt;You can re-use the code to come up with prototypes, and experiments without having to build something from scratch.&lt;/p&gt;

&lt;p&gt;I hope this helps you to see Astro in a different way!&lt;/p&gt;

&lt;p&gt;Give it a try, and let me know what you think.&lt;/p&gt;

&lt;p&gt;If you enjoyed that or learned something new, please share this article with a friend or co-worker 🙏❤️! (Thanks!)&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>beginners</category>
      <category>webdev</category>
    </item>
    <item>
      <title>tRPC vs GraphQL: Why you shouldn’t use GraphQL</title>
      <dc:creator>Jerry</dc:creator>
      <pubDate>Wed, 01 Feb 2023 05:07:18 +0000</pubDate>
      <link>https://dev.to/jareechang/trpc-vs-graphql-why-you-shouldnt-use-graphql-4be1</link>
      <guid>https://dev.to/jareechang/trpc-vs-graphql-why-you-shouldnt-use-graphql-4be1</guid>
      <description>&lt;h2&gt;
  
  
  Content
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Content&lt;/li&gt;
&lt;li&gt;Introduction&lt;/li&gt;
&lt;li&gt;GraphQL&lt;/li&gt;
&lt;li&gt;tRPC&lt;/li&gt;
&lt;li&gt;Flexibility&lt;/li&gt;
&lt;li&gt;Workflows&lt;/li&gt;
&lt;li&gt;Decisions with GraphQL&lt;/li&gt;
&lt;li&gt;Hidden cost of optionality&lt;/li&gt;
&lt;li&gt;Language choice&lt;/li&gt;
&lt;li&gt;Conclusion&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;In this article, we’re going to compare the two technologies.&lt;/p&gt;

&lt;p&gt;When it comes to technology, I always try to be as objective as possible and examine its the trade off being made.&lt;/p&gt;

&lt;p&gt;Those trade offs or constraints will give guide your decision to know if it will work in your situation.&lt;/p&gt;

&lt;p&gt;And that’s what we are going to talk about!&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%2Fwww.jerrychang.ca%2Fimages%2Ftrpc-vs-graphql-star-history.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%2Fwww.jerrychang.ca%2Fimages%2Ftrpc-vs-graphql-star-history.png" alt="Image tRPC vs GraphQL star history"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The star history may be in part to do with the “hype” of a new technology.&lt;/p&gt;

&lt;p&gt;I suppose another way to look at it is maybe people were just using GraphQL for the wrong things ?&lt;/p&gt;

&lt;p&gt;That is until a simpler tool came along to fit a certain need for their use case.&lt;/p&gt;

&lt;p&gt;I’ll let you be the judge of that one.&lt;/p&gt;

&lt;p&gt;In this article, we’ll start off with a brief introduction of the core idea behind the two technologies.&lt;/p&gt;

&lt;p&gt;Then, we’ll dive in deeper to look at the technologies from a few perspectives.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;These include:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Flexibility &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Workflows&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Decisions with GraphQL&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Hidden cost of optionality &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Language support&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  GraphQL
&lt;/h2&gt;

&lt;p&gt;What is GraphQL ?&lt;/p&gt;

&lt;p&gt;I think of GraphQL much like a “SQL-like” interface for your backend (or data sources).&lt;/p&gt;

&lt;p&gt;It provides a clear contract between the consumer (clients) and the provider (backend).&lt;/p&gt;

&lt;p&gt;Many of the components that make up “contract” are managed by tools built by open source and GraphQL community.&lt;/p&gt;

&lt;p&gt;These are things like the graphql codegen, apollo, and so forth. So, the great thing is that there is a lot of support!&lt;/p&gt;

&lt;p&gt;If you boil down GraphQL down to its core, there are a few stand out benefits.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The core benefits:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;GraphQL schema&lt;/strong&gt; - The data schema that creates the contract between the consumer(s) and provider&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Flexibility&lt;/strong&gt; - The flexibility in the data querying (“SQL-like” experience), workflow and process&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Well supported client SDKs&lt;/strong&gt; - The tooling in GraphQL is very well supported in many languages (Typescript, Go, Python, Ruby etc)&lt;/p&gt;&lt;/li&gt;
&lt;/ul&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%2Fwww.jerrychang.ca%2Fimages%2Ftrpc-vs-graphql-graphql-contract.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%2Fwww.jerrychang.ca%2Fimages%2Ftrpc-vs-graphql-graphql-contract.png" alt="Image GraphQL schema contract"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now... just look at the “benefits” of GraphQL — It looks like it’s a no-brainer to adopt it right ?&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Hold on just a second&lt;/strong&gt;... There is a bit more to it than that! &lt;/p&gt;

&lt;p&gt;To get GraphQL “right”, it does take a bit of work, and decisions upfront. We’ll talk about that in a little bit.&lt;/p&gt;

&lt;p&gt;Ok, enough about GraphQL, let’s talk about tRPC.&lt;/p&gt;

&lt;h2&gt;
  
  
  tRPC
&lt;/h2&gt;

&lt;p&gt;There are some similarity between tRPC and GraphQL.&lt;/p&gt;

&lt;p&gt;They are similar in that they both try to unify the consumer and provider around a “contract”.&lt;/p&gt;

&lt;p&gt;For tRPC, instead of the aligning around a general specification, it aligns directly via Typescript types.&lt;/p&gt;

&lt;p&gt;That means the RPC endpoint defined on the backend is available to be used on the frontend via Typescript automatically when you are using tRPC.&lt;/p&gt;

&lt;p&gt;It sounds a bit like magic doesn’t it (It does feel that way when you try it! ✨)&lt;/p&gt;

&lt;p&gt;So, what are the benefits ?&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The core benefits:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Speed of development &amp;amp; A Snappy DX&lt;/strong&gt; - Defining a router (function), and having it available on client side right away (similar experience to HMR)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Ease of synchronization&lt;/strong&gt; - Since the consumers and providers are very coupled, it becomes very easy to keep the two in sync to keep up-to-date&lt;/p&gt;&lt;/li&gt;
&lt;/ul&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%2Fwww.jerrychang.ca%2Fimages%2Ftrpc-vs-graphql-trpc-contract.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%2Fwww.jerrychang.ca%2Fimages%2Ftrpc-vs-graphql-trpc-contract.png" alt="Image tRPC router contract"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now that we have a good overview of the technologies.&lt;/p&gt;

&lt;p&gt;How flexibile is each technology ? Well, let’s find out.&lt;/p&gt;

&lt;h2&gt;
  
  
  Flexibility
&lt;/h2&gt;

&lt;p&gt;When using tRPC, everything down to the workflow is quite set in stone — Or a better way to describe it is that it‘s opinionated.&lt;/p&gt;

&lt;p&gt;The consumers(s) and providers are very tightly coupled.&lt;/p&gt;

&lt;p&gt;This how tRPC is able to achieve this “seamless” experience between the frontend and backend. &lt;/p&gt;

&lt;p&gt;So, really, tRPC isn’t really the most flexible technology (that can be a good or bad thing depending on your situation).&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%2Fwww.jerrychang.ca%2Fimages%2Ftrpc-vs-graphql-flexibility.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%2Fwww.jerrychang.ca%2Fimages%2Ftrpc-vs-graphql-flexibility.png" alt="Image Flexibility: tRPC vs GraphQL"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Other the other hand, when using GraphQL, you get a lot of flexibility in how you use it, the workflow and the process.&lt;/p&gt;

&lt;p&gt;The contract between the two (consumer &amp;amp; provider) is very clear, and you can almost think of it as two separate things.&lt;/p&gt;

&lt;p&gt;But... Is this level of flexibility good ?&lt;/p&gt;

&lt;p&gt;Well, let’s see what kind of choices you need to make in order to work with GraphQL.&lt;/p&gt;

&lt;h2&gt;
  
  
  Workflows
&lt;/h2&gt;

&lt;p&gt;To compare the two workflows, let’s use an analogy of cutting down a tree.&lt;/p&gt;

&lt;p&gt;tRPC is like pre-made chainsaw that you can just use right away.&lt;/p&gt;

&lt;p&gt;Whereas GraphQL is like a chainsaw that comes with the components, and in order to use it, you’d have to assemble it.&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%2Fwww.jerrychang.ca%2Fimages%2Ftrpc-vs-graphql-workflow-comparison.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%2Fwww.jerrychang.ca%2Fimages%2Ftrpc-vs-graphql-workflow-comparison.png" alt="Image tRPC vs GraphQL: Workflow comparison"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;“Build[ing] the tool” also includes fleshing out the developer workflow and process.&lt;/p&gt;

&lt;p&gt;So, GraphQL obviously has the edge of being more flexible.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Now the question is:&lt;/strong&gt; Do you need this level of flexibility ?&lt;/p&gt;

&lt;h2&gt;
  
  
  Decisions with GraphQL
&lt;/h2&gt;

&lt;p&gt;So, what kind of decisions do you need to make when using GraphQL ?&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Here are a few:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Language choice&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Type of workflow and Developer Experience (DX) &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Code first or schema first (with codegen) ?&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;How do we handle the GraphQL query on the client ? How do we share the generated types ?&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Many more... (This is just the tip of the ice berg)&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This is not exactly an overwhelming list of choices.&lt;/p&gt;

&lt;p&gt;However, it still requires the person (or team) using GraphQL to make those decisions or choices upfront.&lt;/p&gt;

&lt;p&gt;For most folks who just need to have a simple API to read, update data and ship things.&lt;/p&gt;

&lt;p&gt;GraphQL is most likely not going to be a good choice.&lt;/p&gt;

&lt;p&gt;This is because when you adopt GraphQL, you are also assuming the hidden cost of it’s flexibility upfront.&lt;/p&gt;

&lt;p&gt;If you want to be able to share code between multiple clients and provider in Typescript, tRPC provides that out of the box.&lt;/p&gt;

&lt;p&gt;You don’t need to build a tool from the ground up just achieve this.&lt;/p&gt;

&lt;p&gt;To me, GraphQL’s flexibility is its strength and weakness.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;❓ Ask yourself:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;When it comes to your workflow, and setup... &lt;strong&gt;how much flexibility do I (really) need ?&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Hidden cost of optionality
&lt;/h2&gt;

&lt;p&gt;So, when it comes to GraphQL’s flexibility, why is it a hidden cost ?&lt;/p&gt;

&lt;p&gt;It’s easy to just look at the benefits of GraphQL, and say its a no-brainer to use it.&lt;/p&gt;

&lt;p&gt;When you have that much flexibility in your application (and workflow), you also need to assume the responsibility that comes with that.&lt;/p&gt;

&lt;p&gt;When working with GraphQL, you need to make many decisions and choices upfront.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The impact of these decisions and choices that you make compound over time.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;So, in reality, when adopting GraphQL you should treat it like an investment — you should be ready to invest upfront and on an on-going basis.&lt;/p&gt;

&lt;p&gt;When you get it right, you can make it really work for you (and your team).&lt;/p&gt;

&lt;p&gt;But the catch is it also goes in the other direction.&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%2Fwww.jerrychang.ca%2Fimages%2Ftrpc-vs-graphql-dx-compounding.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%2Fwww.jerrychang.ca%2Fimages%2Ftrpc-vs-graphql-dx-compounding.png" alt="Image Compounding effect of decisions and choices"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Language choice
&lt;/h2&gt;

&lt;p&gt;Another consideration when comparing the two technologies may be which languages it supports.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;tRPC:&lt;/strong&gt; Only supports Typescript&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;GraphQL:&lt;/strong&gt; Supports Typescript, Python, Ruby, Go, Kotlin, etc&lt;/p&gt;

&lt;p&gt;GraphQL gives you more choices when it comes to building your GraphQL backend server.&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%2Fwww.jerrychang.ca%2Fimages%2Ftrpc-vs-graphql-language.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%2Fwww.jerrychang.ca%2Fimages%2Ftrpc-vs-graphql-language.png" alt="Image tRPC vs GraphQL Language support"&gt;&lt;/a&gt;&lt;/p&gt;

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

&lt;p&gt;So, what are you saying... I should use tRPC ?&lt;/p&gt;

&lt;p&gt;Actually, no.&lt;/p&gt;

&lt;p&gt;I think you should always default to REST if you are unsure.&lt;/p&gt;

&lt;p&gt;It’s easier to start with REST then transition to either solutions — tRPC or GraphQL.&lt;/p&gt;

&lt;p&gt;It’s much complicated to do the reverse.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;When should I use tRPC ?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Go with tRPC if you want to enhance the overall developer workflow for an internal API using Typescript (on client, react-native, backend).&lt;/p&gt;

&lt;p&gt;This will allow your team to move quicker and ship more things.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;When should I use GraphQL ?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Go with GraphQL if you want to have flexibility.&lt;/p&gt;

&lt;p&gt;Whether that’s in how you query data (ie the “SQL like” querying), the workflow &amp;amp; process or in the language choice.&lt;/p&gt;

&lt;p&gt;Just make sure you are prepared to assume the responsibility that comes with the level of flexibility that GraphQL offers.&lt;/p&gt;

&lt;p&gt;That means investing the time &amp;amp; resources to build the tooling, platform and infrastructure to facilitate the end-to-end flow.&lt;/p&gt;

&lt;p&gt;This could be used for an internal or external API.&lt;/p&gt;

&lt;p&gt;Again, the important thing is to treat adopting GraphQL like an investment (think back to the compounding graph).&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%2Fwww.jerrychang.ca%2Fimages%2Ftrpc-vs-graphql-recommendation.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%2Fwww.jerrychang.ca%2Fimages%2Ftrpc-vs-graphql-recommendation.png" alt="Image Recommendation for REST, tRPC and GraphQL"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And... that’s all for now!&lt;/p&gt;

&lt;p&gt;If you enjoyed that or learned something new, please share this article with a friend or co-worker 🙏❤️! (Thanks!)&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>beginners</category>
      <category>graphql</category>
    </item>
    <item>
      <title>Next.js: Build the simplest tagging system</title>
      <dc:creator>Jerry</dc:creator>
      <pubDate>Sun, 22 Jan 2023 04:22:47 +0000</pubDate>
      <link>https://dev.to/jareechang/nextjs-build-the-simplest-tagging-system-el7</link>
      <guid>https://dev.to/jareechang/nextjs-build-the-simplest-tagging-system-el7</guid>
      <description>&lt;h2&gt;
  
  
  Content
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Content&lt;/li&gt;
&lt;li&gt;Introduction&lt;/li&gt;
&lt;li&gt;The Existing Site&lt;/li&gt;
&lt;li&gt;Requirements&lt;/li&gt;
&lt;li&gt;
The Tagging System Design

&lt;ol&gt;
&lt;li&gt;An Next.js API endpoint&lt;/li&gt;
&lt;li&gt;Pre-generated data&lt;/li&gt;
&lt;li&gt;Manifest file&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;li&gt;The UI&lt;/li&gt;
&lt;li&gt;Conclusion&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;This site that I am using to host all my articles is using Next.js or specifically Vercel.&lt;/p&gt;

&lt;p&gt;The approach that I took to hosting this site is to keep it as simple as possible.&lt;/p&gt;

&lt;p&gt;This is because I rather not have the hassle to the infrastructure burden, so everything is to be as simple as possible.&lt;/p&gt;

&lt;p&gt;I recently re-visited the usability of my site, and I realized a lot of my articles are hidden behind the “Writing” link.&lt;/p&gt;

&lt;p&gt;It was difficult to know what articles were available or even find relevant articles.&lt;/p&gt;

&lt;p&gt;So, this led me explore options, and one of the ways that many blogs (ie Wordpress sites) do this is via a tagging system.&lt;/p&gt;

&lt;p&gt;This article will discuss the architecture behind how to build a simple one using Next.js (with Vercel).&lt;/p&gt;

&lt;h2&gt;
  
  
  The Existing Site
&lt;/h2&gt;

&lt;p&gt;Before making any adjustments, let’s take a look at how my site generate the articles.&lt;/p&gt;

&lt;p&gt;Like I said, my site is very simple with no external integrations, no CMS, no Database.&lt;/p&gt;

&lt;p&gt;It’s just using Markdown.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How does the markdown get on the site ?&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;The utility will read the markdown (&lt;code&gt;*.md&lt;/code&gt; extension)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Extract and transform the metadata from it&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Next.js will render all of that information (using &lt;code&gt;getStaticProps&lt;/code&gt;)&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.jerrychang.ca%2Fimages%2Ftagging-system-existing.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.jerrychang.ca%2Fimages%2Ftagging-system-existing.png" alt="Image Existing workflow for generating articles" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Ideally, for simplicity, I wanted to keep this same workflow and layer on a tagging system.&lt;/p&gt;

&lt;p&gt;(Because I am lazy 😂)&lt;/p&gt;

&lt;p&gt;Let’s talk about how we can go about to doing that.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;💡 Note:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;My site uses Static Site Generation (SSG) because everything comes from the markdown, and I don’t deploy that often.&lt;/p&gt;

&lt;p&gt;Occasionally, I do deploy for edits or release new articles.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Requirements
&lt;/h2&gt;

&lt;p&gt;Since this is my personal site, the aim is to optimize for simplicity.&lt;/p&gt;

&lt;p&gt;This means one of key goals for me is to have the least amount of infrastructure burden.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The requirements:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Keep it as simple &amp;amp; minimal as possible&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Maintain the existing flow (Pagination etc)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;No external integeration (ie no DB, no CMS)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;No Infrastructure burden&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Even though this may not be the &lt;strong&gt;“best practice”&lt;/strong&gt;, it made sense for me given my constraints.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Tagging System Design
&lt;/h2&gt;

&lt;p&gt;Now comes the idea.&lt;/p&gt;

&lt;p&gt;The idea that I had in mind was an API that returns articles based on the &lt;code&gt;tag&lt;/code&gt; provided in the query string.&lt;/p&gt;

&lt;p&gt;Let’s go through the components in more detail.&lt;/p&gt;

&lt;h3&gt;
  
  
  1. A Next.js API endpoint
&lt;/h3&gt;

&lt;p&gt;This will return the data based on the &lt;code&gt;tag&lt;/code&gt; query in the URL.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;For Example:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;/writing?tag=aws&lt;/strong&gt; - This would return all articles that were tagged with &lt;strong&gt;"AWS"&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.jerrychang.ca%2Fimages%2Ftagging-system-api-server.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.jerrychang.ca%2Fimages%2Ftagging-system-api-server.png" alt="Image Next.js: Tagging system with API server" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Here is an example of the JSON response.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;JSON response (sample):&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"entries"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[],&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"pagination"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"total"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This api will read the JSON data directly from the filesystem.&lt;/p&gt;

&lt;p&gt;Vercel actually supports this but you do need to configure it 👇.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;💡 Note:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;If you want to support reading from the filesystem, you need to turn on &lt;strong&gt;nftTracing&lt;/strong&gt; on Next.js config.&lt;/p&gt;

&lt;p&gt;This allows for “Output File Tracing”, and Next.js will put all the files that need to be read on the production server.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;Now comes the question of:&lt;/strong&gt; How do we get this data or where does it come from ?&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Pre-generated data
&lt;/h3&gt;

&lt;p&gt;In my website, I already have an existing utility for parsing these articles in markdown.&lt;/p&gt;

&lt;p&gt;So, to get these new JSON data, I just needed to write another script to aggregate the articles into categories.&lt;/p&gt;

&lt;p&gt;I would need to pre-generate the data because we need it available in production when our API reads a particular file.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The file convention:&lt;/strong&gt; &lt;code&gt;{name-of-the-tag}-tag.json&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.jerrychang.ca%2Fimages%2Ftagging-system-json-file-system.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.jerrychang.ca%2Fimages%2Ftagging-system-json-file-system.png" alt="Image Pre-generating tagging data ahead of time" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Manifest file
&lt;/h3&gt;

&lt;p&gt;As part of the processing (using the script), it will also generate a manifest file which will contain the following:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;The tags that are used&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The number of articles in each tag&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Example:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"astro"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;6&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"frontend"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;7&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"aws"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;35&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"cloudfront"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;11&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"cdn"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;16&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"edge"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"aws-lambda"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;8&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"terraform"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;11&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"ci-cd"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"http-caching"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"build-system"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"dev-ops"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;7&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"open-id-connect"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"postgre-sql"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;7&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"aws-ecs"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;7&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"next-js"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;On the UI, this is the file that I use to render the different tag available on the site.&lt;/p&gt;

&lt;h2&gt;
  
  
  The UI
&lt;/h2&gt;

&lt;p&gt;Here is what the resulting UI for the tagging system.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.jerrychang.ca%2Fimages%2Ftagging-system-UI.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fwww.jerrychang.ca%2Fimages%2Ftagging-system-UI.png" alt="Image Tagging system UI" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

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

&lt;p&gt;And... That’s it!&lt;/p&gt;

&lt;p&gt;This is a simplified tagging system built with Next.js using Vercel.&lt;/p&gt;

&lt;p&gt;Again, this may not be the &lt;strong&gt;“best practice”&lt;/strong&gt; but given the requirements that I had, it worked for me.&lt;/p&gt;

&lt;p&gt;There are values in adding constraints, it tends to lead to more creative solutions!&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What do you think ? Got any ideas on a different way to build something like this ?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Reach out, and Let me know! I’d love to hear it!&lt;/p&gt;

&lt;p&gt;Also, if you learned something new, please share this article with a friend or co-worker 🙏❤️! (Thanks!)&lt;/p&gt;

&lt;p&gt;See it in action here 👉 &lt;a href="https://www.jerrychang.ca" rel="noopener noreferrer"&gt;www.jerrychang.ca&lt;/a&gt;&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>webdev</category>
      <category>nextjs</category>
      <category>react</category>
    </item>
    <item>
      <title>Career Success: 5 Tips on How To Take It To The Next Level (with resources)</title>
      <dc:creator>Jerry</dc:creator>
      <pubDate>Sun, 15 Jan 2023 20:17:53 +0000</pubDate>
      <link>https://dev.to/jareechang/career-success-5-tips-on-how-to-take-it-to-the-next-level-with-resources-5796</link>
      <guid>https://dev.to/jareechang/career-success-5-tips-on-how-to-take-it-to-the-next-level-with-resources-5796</guid>
      <description>&lt;p&gt;&lt;em&gt;Cover image by Rachel McDermott&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Highlight
&lt;/h2&gt;

&lt;p&gt;Here are some of the tips I wish I knew earlier.&lt;/p&gt;

&lt;p&gt;Many of these things I still use and apply.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Here are the tips:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Learning how to learn&lt;/strong&gt; - Figure out your style&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Self Advocacy&lt;/strong&gt; - Do a great job, then tell others about it&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Negotiating compensation&lt;/strong&gt; - It’s difficult but try to always negotiate&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Going beyond your bubble&lt;/strong&gt; - See, and think beyond just what you are doing right now&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Gain clarity&lt;/strong&gt; - Know where you are going&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Let’s go through them in more details 👇&lt;/p&gt;

&lt;h2&gt;
  
  
  Learning how to learn
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F60gl8n9pptitmr9s096b.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F60gl8n9pptitmr9s096b.jpg" alt="Image Love to Learn by Tim Mossholder" width="800" height="533"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Photo by Tim Mossholder&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;If there is one thing that is common for ALL people working in the tech industry, its this — You are learning ALL the time.&lt;/p&gt;

&lt;p&gt;If that is the case, you should try to figure out how you learn.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Do I learn best reading, writing, through diagrams/images or watching videos ?&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;What are ways I can myself on track ? and motivated to learn ?&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;How do I design my learning so I find the balance between being over challenged or under challenged ?&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;How do I track my learning ? (Hint: Use Notion or Trello)&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;💡 Tip:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The goal should be to get to a point where you can systemize your learning and make this into a process.&lt;/p&gt;

&lt;p&gt;That way, the more you improve this process, the better you learn.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  Resources:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://programmerspyramid.com/" rel="noopener noreferrer"&gt;Programmer’s pyramid By Amy Haddad&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://jamesclear.com/motivation" rel="noopener noreferrer"&gt;Motivation: The Scientific Guide on How to Get and Stay Motivated&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Prioritization
&lt;/h2&gt;

&lt;p&gt;Learn how to prioritize your task.&lt;/p&gt;

&lt;p&gt;Even better, learn how to prioritize it for impact.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;💡 Tip:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;What does impact mean ?&lt;/p&gt;

&lt;p&gt;Impact to me means how can I get &lt;strong&gt;the most value&lt;/strong&gt; with what I am working with, and with the time I can put in.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Don’t come up with 5 or 10 or 20 items. &lt;strong&gt;Come up with one thing&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Once you do that, just do that one thing.&lt;/p&gt;

&lt;p&gt;Every week or month, try to slot your tasks into the “Eisenhower Matrix or Box”.&lt;/p&gt;

&lt;p&gt;&lt;iframe class="tweet-embed" id="tweet-1613523380367495168-272" src="https://platform.twitter.com/embed/Tweet.html?id=1613523380367495168"&gt;
&lt;/iframe&gt;

  // Detect dark theme
  var iframe = document.getElementById('tweet-1613523380367495168-272');
  if (document.body.className.includes('dark-theme')) {
    iframe.src = "https://platform.twitter.com/embed/Tweet.html?id=1613523380367495168&amp;amp;theme=dark"
  }



&lt;/p&gt;

&lt;p&gt;Reflect and review the tasks in each category.&lt;/p&gt;

&lt;p&gt;Then set goals to move towards “Important” tasks.&lt;/p&gt;

&lt;p&gt;This is a continual process.&lt;/p&gt;

&lt;h3&gt;
  
  
  Resources:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://jamesclear.com/eisenhower-box" rel="noopener noreferrer"&gt;How to be More Productive and Eliminate Time Wasting Activities by Using the “Eisenhower Box” - James Clear&lt;/a&gt; &lt;/li&gt;
&lt;li&gt;&lt;a href="https://sahilbloom.substack.com/p/the-decision-matrix#details" rel="noopener noreferrer"&gt;The ultimate productivity tool - Sahil Bloom&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Self Advocacy
&lt;/h2&gt;

&lt;p&gt;Unfortunately, it’s not enough to do a great job or work.&lt;/p&gt;

&lt;p&gt;Beyond just doing the work, you must also advocate for yourself.&lt;/p&gt;

&lt;p&gt;Tell people about what you did, and how it adds value. &lt;/p&gt;

&lt;p&gt;Communicate the value of the work, and value you bring to the table.&lt;/p&gt;

&lt;p&gt;&lt;iframe class="tweet-embed" id="tweet-1483956048214077445-37" src="https://platform.twitter.com/embed/Tweet.html?id=1483956048214077445"&gt;
&lt;/iframe&gt;

  // Detect dark theme
  var iframe = document.getElementById('tweet-1483956048214077445-37');
  if (document.body.className.includes('dark-theme')) {
    iframe.src = "https://platform.twitter.com/embed/Tweet.html?id=1483956048214077445&amp;amp;theme=dark"
  }



&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;💡 Tip:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;It doesn’t have to be shameless or “slimey”, if you actually did the work, and delivered on it then don’t be afraid to talk about it.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  Resources:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://twitter.com/shaundai/status/1483956048214077445" rel="noopener noreferrer"&gt;Career Advancement Tip - Shaundai Person&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://jvns.ca/blog/brag-documents/" rel="noopener noreferrer"&gt;Brag Document - Julia Evans&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Negotiating compensation
&lt;/h2&gt;

&lt;p&gt;Let’s be honest... no one teaches this.&lt;/p&gt;

&lt;p&gt;There is no class for this.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Would this help your career ?&lt;/strong&gt; Yes, you bet it would.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;A lot of people like to tell you:&lt;/strong&gt; “we have a salary range here”.&lt;/p&gt;

&lt;p&gt;That’s just code name for we want to pay you the minimum amount.&lt;/p&gt;

&lt;p&gt;Get paid for what your worth.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Here are some resources:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://twitter.com/mochievous/status/1229731519570292738" rel="noopener noreferrer"&gt;Salary Negotiation thread by Moe&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://twitter.com/sriramk/status/1221890836364812288" rel="noopener noreferrer"&gt;Salary Negotiation thread by Sriram Krishnan&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Going beyond your bubble
&lt;/h2&gt;

&lt;p&gt;Most people like to say — learn a new programming language or a new framework every year.&lt;/p&gt;

&lt;p&gt;This is great but you have to realize the goal of a developer or programmer is not to code.&lt;/p&gt;

&lt;p&gt;The goal is to provide value through your work, and sometimes it does include coding.&lt;/p&gt;

&lt;p&gt;&lt;iframe class="tweet-embed" id="tweet-1478241315783544832-706" src="https://platform.twitter.com/embed/Tweet.html?id=1478241315783544832"&gt;
&lt;/iframe&gt;

  // Detect dark theme
  var iframe = document.getElementById('tweet-1478241315783544832-706');
  if (document.body.className.includes('dark-theme')) {
    iframe.src = "https://platform.twitter.com/embed/Tweet.html?id=1478241315783544832&amp;amp;theme=dark"
  }



&lt;/p&gt;

&lt;p&gt;Try to read up on how the software you build adds value or provide value to the end-user.&lt;/p&gt;

&lt;p&gt;Do you work on a marketing site that sells shoes ? or plant fertilizer ? &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Read a little bit about marketing, conversions or analytics&lt;/li&gt;
&lt;li&gt;Read a little bit about the shoes &amp;amp; the plant fertilizer&lt;/li&gt;
&lt;li&gt;Ask someone from another team questions about these things&lt;/li&gt;
&lt;li&gt;Read some reviews online, and see what people are talking about&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Don’t just be a “coder”, be a problem solver, no matter the problem, solve it.&lt;/p&gt;

&lt;h3&gt;
  
  
  Resources:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://twitter.com/LBacaj/status/1478241311392108545" rel="noopener noreferrer"&gt;12 things your manager may not be telling you - Louie Bacaj&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Gain clarity
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgsaod9bpdsd9dq7ulqjk.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgsaod9bpdsd9dq7ulqjk.jpg" alt="Image lighthouse by Evgeni Tcherkasski on Unsplash" width="800" height="533"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Photo by Evgeni Tcherkasski&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;If you ask most people where do you want to be in 5 years ? in 10 years ?&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Guess what is the most common answer ?&lt;/strong&gt; I don’t know or I am not sure.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;”If you don't know where you want to go, then it doesn't matter which path you take.” - Lewis Carroll&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Gaining clarity allows you to move in the direction you want to go.&lt;/p&gt;

&lt;p&gt;In the future, do you want to work as data scientist ? frontend ? backend ? graphic design ? content creator ? or whatever else&lt;/p&gt;

&lt;p&gt;The thing is you won’t know exactly where you want to go but you should have a vague idea of where you want to go.&lt;/p&gt;

&lt;p&gt;It’s better than not knowing at all.&lt;/p&gt;

&lt;p&gt;Just know that this direction will change and evolve as you start moving towards it, and that’s ok.&lt;/p&gt;

&lt;p&gt;&lt;iframe class="tweet-embed" id="tweet-1480061554917724161-933" src="https://platform.twitter.com/embed/Tweet.html?id=1480061554917724161"&gt;
&lt;/iframe&gt;

  // Detect dark theme
  var iframe = document.getElementById('tweet-1480061554917724161-933');
  if (document.body.className.includes('dark-theme')) {
    iframe.src = "https://platform.twitter.com/embed/Tweet.html?id=1480061554917724161&amp;amp;theme=dark"
  }



&lt;/p&gt;

&lt;p&gt;Being in motion is better than standing still in a fast moving world.&lt;/p&gt;

&lt;p&gt;Move towards a direction that opens up future optionality.&lt;/p&gt;

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

&lt;p&gt;That’s it!&lt;/p&gt;

&lt;p&gt;If you found this helpful, please help someone else by sharing it or tagging someone in the comments!&lt;/p&gt;

&lt;p&gt;Thanks! ❤️🙏&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>career</category>
      <category>webdev</category>
      <category>programming</category>
    </item>
    <item>
      <title>Zod: The Next Biggest thing after Typescript</title>
      <dc:creator>Jerry</dc:creator>
      <pubDate>Sun, 08 Jan 2023 19:27:16 +0000</pubDate>
      <link>https://dev.to/jareechang/zod-the-next-biggest-thing-after-typescript-4phh</link>
      <guid>https://dev.to/jareechang/zod-the-next-biggest-thing-after-typescript-4phh</guid>
      <description>&lt;h2&gt;
  
  
  Content
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Content&lt;/li&gt;
&lt;li&gt;Introduction&lt;/li&gt;
&lt;li&gt;Understanding the why&lt;/li&gt;
&lt;li&gt;Managing contracts&lt;/li&gt;
&lt;li&gt;Traditional approach&lt;/li&gt;
&lt;li&gt;The Zod Way&lt;/li&gt;
&lt;li&gt;
Simple example

&lt;ol&gt;
&lt;li&gt;Defining the Zod schema&lt;/li&gt;
&lt;li&gt;Convert Zod schema into Typescript types&lt;/li&gt;
&lt;li&gt;Create some pizzas&lt;/li&gt;
&lt;li&gt;Run-time validations&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;li&gt;Establishing a new standard - End-to-end Typesafety&lt;/li&gt;
&lt;li&gt;Striking the right balance&lt;/li&gt;
&lt;li&gt;Conclusion&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;I recently came across a neat little library called Zod.&lt;/p&gt;

&lt;p&gt;My first reaction looking through the documentation was this looks interesting.&lt;/p&gt;

&lt;p&gt;It wasn’t until I tried it that I felt the difference — &lt;strong&gt;The difference is MASSIVE&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Nothing comes close to it.&lt;/p&gt;

&lt;p&gt;It’s a different approach but once you try out Zod, I think you would know what I mean.&lt;/p&gt;

&lt;p&gt;In my opinion, Zod’s approach hits the right balance between robust code, and developer experience (DX) when working with data validation in Typescript.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;⚠️ Disclaimer:&lt;/strong&gt; After reading this article, you may not  want to use any other validation library! (You’ve been warned)&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Understanding the why
&lt;/h2&gt;

&lt;p&gt;Typescript introduces great checks during development by statically checking the code meets the “contract” defined in the types.&lt;/p&gt;

&lt;p&gt;This works for most cases, however, in production, it becomes more complex.&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%2Fwww.jerrychang.ca%2Fimages%2Fzod-ts-to-js-compilation.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%2Fwww.jerrychang.ca%2Fimages%2Fzod-ts-to-js-compilation.png" alt="Image Illustration of compiling Typescript to Javascript"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Javascript&lt;/strong&gt; - Typescript does not run in production, it compiles down to Javascript&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Loose contracts&lt;/strong&gt; - Typescript type contracts are not enforced when code is compiled to Javascript &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Data predictability&lt;/strong&gt; - Data quality and sources tend to be un-predictable in complex system running in production&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Hence, for this reasons, there is a need for run-time validation to enforces these contracts within Javascript.&lt;/p&gt;

&lt;h2&gt;
  
  
  Managing contracts
&lt;/h2&gt;

&lt;p&gt;When we work with functions in Javascript, it consists of inputs and outputs.&lt;/p&gt;

&lt;p&gt;A certain set of inputs will give you certain set of outputs — This is what I call a contract.&lt;/p&gt;

&lt;p&gt;It is not too different from a contract you sign a contract with your bank or insurance or telecommunication company.&lt;/p&gt;

&lt;p&gt;There is a certain level of guarantee when you sign on for their services. &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%2Fwww.jerrychang.ca%2Fimages%2Fzod-enforcing-contracts.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%2Fwww.jerrychang.ca%2Fimages%2Fzod-enforcing-contracts.png" alt="Image Illustration inputs and outputs in a Javascript function"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;By establishing a contract it forces us to narrow the scope of the inputs and outputs.&lt;/p&gt;

&lt;p&gt;In essence, you reduce the surface area hence making the function more predictable.&lt;/p&gt;

&lt;p&gt;Now comes the question, how is this done in Javascript ?&lt;/p&gt;

&lt;h2&gt;
  
  
  Traditional approach
&lt;/h2&gt;

&lt;p&gt;The traditional approach to achieve this is installing some sort of validation library (ie Joi, Ajv etc).&lt;/p&gt;

&lt;p&gt;The most common application for this is managing form inputs with user input data.&lt;/p&gt;

&lt;p&gt;However, it doesn’t have to be only for forms, you can use run-time validation for anything.&lt;/p&gt;

&lt;p&gt;It will make your code more robust because any sort of data not meeting a contract will be considered a failure.&lt;/p&gt;

&lt;p&gt;There is not in between or edge cases. It makes the code very strict.&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%2Fwww.jerrychang.ca%2Fimages%2Fzod-typical-approach.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%2Fwww.jerrychang.ca%2Fimages%2Fzod-typical-approach.png" alt="Image Illustration inputs and outputs in a Javascript function"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The trade off with these libraries is there is a lot of duplication - &lt;strong&gt;like A LOT in a large code base&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Not only do you have to define the Typescript types, you also have to define validation schemas.&lt;/p&gt;

&lt;p&gt;Talk about doubling the work...&lt;/p&gt;

&lt;p&gt;If you ever needed to do this, you know this pain. Also, let’s not even get into how much this bloats up the code base 😵.&lt;/p&gt;

&lt;p&gt;Then next thing you know, you start doing this 👇&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%2Fwww.jerrychang.ca%2Fimages%2Fzod-any-ts-ignore-meme.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%2Fwww.jerrychang.ca%2Fimages%2Fzod-any-ts-ignore-meme.png" alt="Image Meme of using ts-ignore and any in Typescript"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Well, is there a better way ?&lt;/p&gt;

&lt;p&gt;What if I told you there is...&lt;/p&gt;

&lt;p&gt;You can probably guess it. I’ll give you a hint, it start with a Z.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Zod Way
&lt;/h2&gt;

&lt;p&gt;Enter Zod.&lt;/p&gt;

&lt;p&gt;Here is where Zod differs from all the other validation libraries.&lt;/p&gt;

&lt;p&gt;How is it different from everything else ? Zod takes a schema first approach.&lt;/p&gt;

&lt;p&gt;Meaning, you start with your validation schema (Zod schema).&lt;/p&gt;

&lt;p&gt;Then, this Zod schema becomes your validations, and your types.&lt;/p&gt;

&lt;p&gt;So, you get the best of both worlds!&lt;/p&gt;

&lt;p&gt;Not only do you you get run-time validations from the schema but you also get the types by converting the schema into Typescript.&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%2Fwww.jerrychang.ca%2Fimages%2Fzod-run-time-and-static.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%2Fwww.jerrychang.ca%2Fimages%2Fzod-run-time-and-static.png" alt="Image Illustration of Zod’s schema first approach"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Neat huh ? Talk about super charging productivity and developer experience 😍⚡️&lt;/p&gt;

&lt;h2&gt;
  
  
  Simple example
&lt;/h2&gt;

&lt;p&gt;Enough of the illustrations, I want to see some code!&lt;/p&gt;

&lt;p&gt;Let’s go through a simple example.&lt;/p&gt;

&lt;p&gt;Let’s say we’re a pizza shop, and we need to design some schemas for our website.&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Defining the Zod schema
&lt;/h3&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;

&lt;p&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;z&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;zod&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;&lt;span class="c1"&gt;// Zod schema&lt;/span&gt;&lt;br&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;pizzaSchema&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;z&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;object&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;&lt;br&gt;
  &lt;span class="na"&gt;sauce&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;z&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;string&lt;/span&gt;&lt;span class="p"&gt;(),&lt;/span&gt;&lt;br&gt;
  &lt;span class="na"&gt;ingredients&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;z&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;array&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;z&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;string&lt;/span&gt;&lt;span class="p"&gt;()),&lt;/span&gt;&lt;br&gt;
&lt;span class="p"&gt;});&lt;/span&gt;&lt;/p&gt;

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

&lt;/div&gt;
&lt;h3&gt;
&lt;br&gt;
  &lt;br&gt;
  

&lt;ol&gt;
&lt;li&gt;Convert Zod schema into Typescript types
&lt;/li&gt;
&lt;/ol&gt;
&lt;/h3&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;


&lt;p&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;z&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;zod&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;&lt;span class="c1"&gt;// Zod schema&lt;/span&gt;&lt;br&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;pizzaSchema&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;z&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;object&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;&lt;br&gt;
  &lt;span class="na"&gt;sauce&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;z&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;string&lt;/span&gt;&lt;span class="p"&gt;(),&lt;/span&gt;&lt;br&gt;
  &lt;span class="na"&gt;ingredients&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;z&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;array&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;z&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;string&lt;/span&gt;&lt;span class="p"&gt;()),&lt;/span&gt;&lt;br&gt;
&lt;span class="p"&gt;});&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;&lt;span class="c1"&gt;// TypeScript type&lt;/span&gt;&lt;br&gt;
&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;type&lt;/span&gt; &lt;span class="nx"&gt;IPizza&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;z&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;infer&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="k"&gt;typeof&lt;/span&gt; &lt;span class="nx"&gt;pizzaSchema&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;/p&gt;

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

&lt;/div&gt;
&lt;h3&gt;
&lt;br&gt;
  &lt;br&gt;
  

&lt;ol&gt;
&lt;li&gt;Create some pizzas
&lt;/li&gt;
&lt;/ol&gt;
&lt;/h3&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;


&lt;p&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;z&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;zod&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;&lt;span class="c1"&gt;// Zod schema&lt;/span&gt;&lt;br&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;pizzaSchema&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;z&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;object&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;&lt;br&gt;
  &lt;span class="na"&gt;sauce&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;z&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;string&lt;/span&gt;&lt;span class="p"&gt;(),&lt;/span&gt;&lt;br&gt;
  &lt;span class="na"&gt;ingredients&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;z&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;array&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;z&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;string&lt;/span&gt;&lt;span class="p"&gt;()),&lt;/span&gt;&lt;br&gt;
&lt;span class="p"&gt;});&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;&lt;span class="c1"&gt;// TypeScript type&lt;/span&gt;&lt;br&gt;
&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;type&lt;/span&gt; &lt;span class="nx"&gt;IPizza&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;z&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;infer&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="k"&gt;typeof&lt;/span&gt; &lt;span class="nx"&gt;pizzaSchema&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;pepperoniPizza&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;IPizza&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;br&gt;
  &lt;span class="na"&gt;sauce&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;tomato&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;br&gt;
  &lt;span class="na"&gt;ingredients&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;br&gt;
    &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;cheese&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;br&gt;
    &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;pepperoni&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;br&gt;
  &lt;span class="p"&gt;],&lt;/span&gt;&lt;br&gt;
&lt;span class="p"&gt;};&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;pepperoniPizza&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;&lt;span class="c1"&gt;// =&amp;gt; { sauce: 'tomato', ingredients: [ 'cheese', 'pepperoni' ] }&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;hawaiianPizza&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;IPizza&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;br&gt;
  &lt;span class="na"&gt;sauce&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;tomato&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;br&gt;
  &lt;span class="na"&gt;ingredients&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;br&gt;
    &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;cheese&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;br&gt;
    &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;pineapple&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;br&gt;
    &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;ham&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;br&gt;
  &lt;span class="p"&gt;],&lt;/span&gt;&lt;br&gt;
&lt;span class="p"&gt;};&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;hawaiianPizza&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&lt;br&gt;
&lt;span class="c1"&gt;// =&amp;gt; { sauce: 'tomato', ingredients: [ 'cheese', 'pineapple', 'ham' ] }&lt;/span&gt;&lt;/p&gt;

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

&lt;/div&gt;
&lt;h3&gt;
&lt;br&gt;
  &lt;br&gt;
  

&lt;ol&gt;
&lt;li&gt;Run-time validations
&lt;/li&gt;
&lt;/ol&gt;
&lt;/h3&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;


&lt;p&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;z&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;zod&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;&lt;span class="c1"&gt;// Zod schema&lt;/span&gt;&lt;br&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;pizzaSchema&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;z&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;object&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;&lt;br&gt;
  &lt;span class="na"&gt;sauce&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;z&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;string&lt;/span&gt;&lt;span class="p"&gt;(),&lt;/span&gt;&lt;br&gt;
  &lt;span class="na"&gt;ingredients&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;z&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;array&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;z&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;string&lt;/span&gt;&lt;span class="p"&gt;()),&lt;/span&gt;&lt;br&gt;
&lt;span class="p"&gt;});&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;&lt;span class="c1"&gt;// TypeScript type&lt;/span&gt;&lt;br&gt;
&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;type&lt;/span&gt; &lt;span class="nx"&gt;IPizza&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;z&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;infer&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="k"&gt;typeof&lt;/span&gt; &lt;span class="nx"&gt;pizzaSchema&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;pepperoniPizza&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;IPizza&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;br&gt;
  &lt;span class="na"&gt;sauce&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;tomato&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;br&gt;
  &lt;span class="na"&gt;ingredients&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;br&gt;
    &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;cheese&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;br&gt;
    &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;pepperoni&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;br&gt;
  &lt;span class="p"&gt;],&lt;/span&gt;&lt;br&gt;
&lt;span class="p"&gt;};&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;pizzaSchema&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;parse&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;pepperoniPizza&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;&lt;br&gt;
&lt;span class="c1"&gt;// =&amp;gt; { sauce: 'tomato', ingredients: [ 'cheese', 'pepperoni' ] }&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;hawaiianPizza&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;IPizza&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;br&gt;
  &lt;span class="na"&gt;sauce&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;tomato&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;br&gt;
  &lt;span class="na"&gt;ingredients&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;br&gt;
    &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;cheese&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;br&gt;
    &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;pineapple&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;br&gt;
    &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;ham&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;br&gt;
  &lt;span class="p"&gt;],&lt;/span&gt;&lt;br&gt;
&lt;span class="p"&gt;};&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;pizzaSchema&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;parse&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;hawaiianPizza&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;&lt;br&gt;
&lt;span class="c1"&gt;// =&amp;gt; { sauce: 'tomato', ingredients: [ 'cheese', 'pineapple', 'ham' ] }&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;pizzaSchema&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;parse&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="c1"&gt;// throws ZodError&lt;/span&gt;&lt;/p&gt;

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

&lt;/div&gt;
&lt;h2&gt;
&lt;br&gt;
  &lt;br&gt;
  &lt;br&gt;
  Striking the right balance&lt;br&gt;
&lt;/h2&gt;

&lt;p&gt;Most libraries will force you to the right thing by sacrificing developer experience (DX).&lt;/p&gt;

&lt;p&gt;That’s not the case with Zod, the team really got it ‘just right’.&lt;/p&gt;

&lt;p&gt;When using Zod, you can do the right thing without any friction at all.&lt;/p&gt;

&lt;p&gt;It works seamlessly with Typescript.&lt;/p&gt;

&lt;p&gt;Now that’s a tool worth looking into.&lt;/p&gt;

&lt;h2&gt;
  
  
  Establishing a new standard - End-to-end Typesafety
&lt;/h2&gt;

&lt;p&gt;Zod opens the door up to interesting tools like tRPC which takes the developer experience (DX) to the next level.&lt;/p&gt;

&lt;p&gt;The big idea with tRPC is you can define a backend endpoint with a schema, then have automatically have autocompletion on the client side.&lt;/p&gt;

&lt;p&gt;This raises the standard for all other frameworks to provide integrations with tRPC or create a “similar” experience.&lt;/p&gt;

&lt;p&gt;I see tRPC, and “tRPC like experiences” being more prevalent in the future merely for the speed of development and developer experience (DX) it provides.&lt;/p&gt;

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

&lt;p&gt;So, there you have it. That’s Zod.&lt;/p&gt;

&lt;p&gt;A library that gives you this seamless experience for designing robust code using both run-time (schema) and static (types) validations.&lt;/p&gt;

&lt;p&gt;Before we go, let’s do a recap.&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%2Fwww.jerrychang.ca%2Fimages%2Fzod-takeaways.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%2Fwww.jerrychang.ca%2Fimages%2Fzod-takeaways.png" alt="Image Zod takeaways"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And... that’s all for now, stay tuned for more!&lt;/p&gt;

&lt;p&gt;If you found this helpful or learned something new, please do share this article with a friend or co-worker 🙏❤️ (Thanks!)&lt;/p&gt;

&lt;p&gt;Also published at - &lt;a href="https://www.jerrychang.ca/writing/super-charging-developer-experience-with-zod" rel="noopener noreferrer"&gt;jerrychang.ca&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;b&gt; ⚠️  Note:&lt;/b&gt;

Yup also supports the ability to infer types from the data schema defined.

You can do something like &lt;b&gt;yup.InferType&lt;/b&gt; in order to get your Typescript type.

Just throwing it out there as another great library that allows you to do similar things as Zod.
&lt;/blockquote&gt;

</description>
      <category>webdev</category>
      <category>beginners</category>
      <category>javascript</category>
      <category>typescript</category>
    </item>
  </channel>
</rss>
