<?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: Noriuki</title>
    <description>The latest articles on DEV Community by Noriuki (@noriuki).</description>
    <link>https://dev.to/noriuki</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%2F963609%2Fb4f9651c-e63a-4411-bb6f-dd53da86b3e0.jpeg</url>
      <title>DEV Community: Noriuki</title>
      <link>https://dev.to/noriuki</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/noriuki"/>
    <language>en</language>
    <item>
      <title>TypeScript Survival Guide (Part 2): Start Thinking in TypeScript</title>
      <dc:creator>Noriuki</dc:creator>
      <pubDate>Tue, 28 Apr 2026 21:21:37 +0000</pubDate>
      <link>https://dev.to/noriuki/typescript-survival-guide-part-2-start-thinking-in-typescript-4l2j</link>
      <guid>https://dev.to/noriuki/typescript-survival-guide-part-2-start-thinking-in-typescript-4l2j</guid>
      <description>&lt;p&gt;In Part 1, we covered the most common mistakes.&lt;/p&gt;

&lt;p&gt;Now it’s time to shift how you think.&lt;/p&gt;

&lt;p&gt;Because TypeScript is not just about adding types —&lt;br&gt;
it’s about designing your code better.&lt;/p&gt;


&lt;h2&gt;
  
  
  1. Stop thinking in variables — think in models
&lt;/h2&gt;

&lt;p&gt;Beginners often focus on typing variables:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;John&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;But real TypeScript starts when you model your data:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="kd"&gt;type&lt;/span&gt; &lt;span class="nx"&gt;User&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt;
  &lt;span class="na"&gt;age&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;number&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now you're not just typing values —&lt;br&gt;
you're defining structures.&lt;/p&gt;

&lt;p&gt;This makes your code easier to understand and reuse.&lt;/p&gt;


&lt;h2&gt;
  
  
  2. Model states, not just data
&lt;/h2&gt;

&lt;p&gt;One of the biggest mindset shifts is modeling &lt;em&gt;possibilities&lt;/em&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="kd"&gt;type&lt;/span&gt; &lt;span class="nx"&gt;Status&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;loading&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;success&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;error&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is powerful because:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;it limits what can happen&lt;/li&gt;
&lt;li&gt;it documents your logic&lt;/li&gt;
&lt;li&gt;it prevents invalid states&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Instead of asking:&lt;br&gt;
“what values can this have?”&lt;/p&gt;

&lt;p&gt;You already know the answer.&lt;/p&gt;


&lt;h2&gt;
  
  
  3. Let types guide your code
&lt;/h2&gt;

&lt;p&gt;In JavaScript, you write code first and figure things out later.&lt;/p&gt;

&lt;p&gt;In TypeScript, types help guide your implementation.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;createUser&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;user&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;User&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="c1"&gt;// your code here&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Before writing logic, you already know:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;what you receive&lt;/li&gt;
&lt;li&gt;what shape it has&lt;/li&gt;
&lt;li&gt;what is allowed&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Types become a form of design.&lt;/p&gt;




&lt;h2&gt;
  
  
  4. Reduce ambiguity as early as possible
&lt;/h2&gt;

&lt;p&gt;Good TypeScript is not about adding more types.&lt;/p&gt;

&lt;p&gt;It’s about removing uncertainty.&lt;/p&gt;

&lt;p&gt;Bad:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;process&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;any&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="c1"&gt;// unclear&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Better:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;process&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;user&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;User&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="c1"&gt;// clear and predictable&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The earlier you define structure,&lt;br&gt;
the fewer problems you have later.&lt;/p&gt;




&lt;h2&gt;
  
  
  5. Think in constraints, not freedom
&lt;/h2&gt;

&lt;p&gt;JavaScript gives you freedom.&lt;/p&gt;

&lt;p&gt;TypeScript gives you boundaries.&lt;/p&gt;

&lt;p&gt;And that’s a good thing.&lt;/p&gt;

&lt;p&gt;Constraints:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;prevent invalid states&lt;/li&gt;
&lt;li&gt;guide other developers&lt;/li&gt;
&lt;li&gt;make refactoring safer&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The goal is not to allow everything —&lt;br&gt;
it’s to allow only what makes sense.&lt;/p&gt;




&lt;h2&gt;
  
  
  Final thoughts
&lt;/h2&gt;

&lt;p&gt;Once you start thinking in types:&lt;/p&gt;

&lt;p&gt;You stop guessing.&lt;br&gt;
You stop overchecking.&lt;br&gt;
You start building with intention.&lt;/p&gt;

&lt;p&gt;And that’s when TypeScript really clicks.&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>javascript</category>
      <category>tutorial</category>
      <category>typescript</category>
    </item>
    <item>
      <title>TypeScript Survival Guide (Part 1): Stop Making These Mistakes</title>
      <dc:creator>Noriuki</dc:creator>
      <pubDate>Tue, 28 Apr 2026 21:19:30 +0000</pubDate>
      <link>https://dev.to/noriuki/typescript-survival-guide-part-1-stop-making-these-mistakes-45g7</link>
      <guid>https://dev.to/noriuki/typescript-survival-guide-part-1-stop-making-these-mistakes-45g7</guid>
      <description>&lt;p&gt;If you're coming from JavaScript, TypeScript can feel overwhelming at first.&lt;/p&gt;

&lt;p&gt;Suddenly, you have types, errors, and things that didn’t exist before.&lt;/p&gt;

&lt;p&gt;This is a simple survival guide to help you avoid the most common mistakes.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Avoid using &lt;code&gt;any&lt;/code&gt;
&lt;/h2&gt;

&lt;p&gt;When I first started using TypeScript, I used &lt;code&gt;any&lt;/code&gt; everywhere.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;value&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;any&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;hello&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It works — but it defeats the whole purpose of TypeScript.&lt;/p&gt;

&lt;p&gt;You're basically going back to plain JavaScript.&lt;/p&gt;

&lt;p&gt;👉 Use &lt;code&gt;any&lt;/code&gt; only when you really have no other option.&lt;/p&gt;




&lt;h2&gt;
  
  
  2. Prefer &lt;code&gt;unknown&lt;/code&gt; over &lt;code&gt;any&lt;/code&gt;
&lt;/h2&gt;

&lt;p&gt;If you don’t know the type yet, use &lt;code&gt;unknown&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;value&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;unknown&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;hello&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The difference is:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;any&lt;/code&gt; lets you do anything (no safety)&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;unknown&lt;/code&gt; forces you to check the type first&lt;/li&gt;
&lt;/ul&gt;

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

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;value&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;unknown&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;typeof&lt;/span&gt; &lt;span class="nx"&gt;value&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;string&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="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;value&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;toUpperCase&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This makes your code safer and more predictable.&lt;/p&gt;




&lt;h2&gt;
  
  
  3. Always type your functions
&lt;/h2&gt;

&lt;p&gt;JavaScript:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;sum&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;a&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;b&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;a&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nx"&gt;b&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;TypeScript:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;sum&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;a&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;number&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;b&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;number&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt; &lt;span class="kr"&gt;number&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;a&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nx"&gt;b&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now it's clear:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;what the function expects
&lt;/li&gt;
&lt;li&gt;what it returns
&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  4. Types are not just rules — they are documentation
&lt;/h2&gt;

&lt;p&gt;Good types make your code easier to read.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="kd"&gt;type&lt;/span&gt; &lt;span class="nx"&gt;User&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt;
  &lt;span class="na"&gt;age&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;number&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now anyone can understand your data structure instantly.&lt;/p&gt;




&lt;h2&gt;
  
  
  5. Learn type narrowing (this is more important than it looks)
&lt;/h2&gt;

&lt;p&gt;TypeScript can "narrow" types based on checks you write.&lt;/p&gt;

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

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;value&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kr"&gt;string&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="kr"&gt;number&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;typeof&lt;/span&gt; &lt;span class="nx"&gt;value&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;string&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="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;value&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;toUpperCase&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;value&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;toFixed&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Even though &lt;code&gt;value&lt;/code&gt; can be multiple types,&lt;br&gt;&lt;br&gt;
TypeScript understands what it is inside each block.&lt;/p&gt;

&lt;p&gt;This is called type narrowing.&lt;/p&gt;

&lt;p&gt;👉 This is what makes TypeScript actually smart — not just strict.&lt;/p&gt;




&lt;h2&gt;
  
  
  Final thoughts
&lt;/h2&gt;

&lt;p&gt;TypeScript is not just about avoiding errors.&lt;/p&gt;

&lt;p&gt;It's about writing clearer, more predictable code.&lt;/p&gt;

&lt;p&gt;At first, it might feel slower.&lt;/p&gt;

&lt;p&gt;But once you get used to it, it becomes hard to go back to JavaScript without types.&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>javascript</category>
      <category>tutorial</category>
      <category>typescript</category>
    </item>
    <item>
      <title>5 Simple Practices That Help Me Write Cleaner Code</title>
      <dc:creator>Noriuki</dc:creator>
      <pubDate>Mon, 09 Mar 2026 22:44:04 +0000</pubDate>
      <link>https://dev.to/noriuki/5-simple-practices-that-help-me-write-cleaner-code-1o2p</link>
      <guid>https://dev.to/noriuki/5-simple-practices-that-help-me-write-cleaner-code-1o2p</guid>
      <description>&lt;p&gt;When I first started coding, my main goal was simple: &lt;strong&gt;make the program work&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;If it ran without errors, I considered the job done. But as projects grew in size and complexity, I realized something important — working code isn't always easy to read or maintain.&lt;/p&gt;

&lt;p&gt;Sometimes I would revisit code I wrote weeks earlier and think: &lt;em&gt;"Why did I write it like this?"&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Because of that, I started paying more attention to small habits that make code easier to understand and maintain over time.&lt;/p&gt;

&lt;p&gt;Here are five simple practices I use to keep my code cleaner in day-to-day development.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Comment Strategically: Add Value, Don't Just Explain
&lt;/h2&gt;

&lt;p&gt;Comments can be helpful, but I try to avoid adding them everywhere.&lt;/p&gt;

&lt;p&gt;Most of the time, clear naming and well-structured code already explain what the code is doing. Instead, I prefer to add comments when the logic is complex or when there's a business rule that isn't obvious.&lt;/p&gt;

&lt;p&gt;For example, a comment like this usually doesn't add much value:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// check if the user is active&lt;/span&gt;
&lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;user&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;isActive&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nf"&gt;sendNotification&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;user&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The code already explains what is happening.&lt;/p&gt;

&lt;p&gt;However, comments can be very useful when they provide context:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// Users created before 2022 don't have the "isActive" field,&lt;/span&gt;
&lt;span class="c1"&gt;// so we assume they are active by default&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;isActiveUser&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;user&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;isActive&lt;/span&gt; &lt;span class="o"&gt;??&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In this case, the comment explains &lt;strong&gt;why&lt;/strong&gt; the code exists, not just what it does.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Group Imports Logically
&lt;/h2&gt;

&lt;p&gt;Another small habit that improves readability is organizing import statements.&lt;/p&gt;

&lt;p&gt;Instead of keeping all imports in a single block, I like grouping them by type. For example: external libraries, internal components, and utility functions.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// external libraries&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;React&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;react&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="c1"&gt;// components&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;Button&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;@/components/Button&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;Card&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;@/components/Card&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="c1"&gt;// utilities&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;formatDate&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;@/utils/formatDate&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This makes it easier to understand where things are coming from and keeps the file structure cleaner.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Use Early Returns to Simplify Logic
&lt;/h2&gt;

&lt;p&gt;A pattern I often use is &lt;strong&gt;early return&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Instead of wrapping the entire logic inside nested &lt;code&gt;if&lt;/code&gt; statements, I prefer checking invalid conditions first and returning early.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Without early return:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;user&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;user&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;isActive&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nf"&gt;showDashboard&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;With early return:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nx"&gt;user&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nx"&gt;user&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;isActive&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nf"&gt;showDashboard&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This helps avoid deep nesting and makes the main flow of the function easier to read.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Use Clear and Descriptive Names
&lt;/h2&gt;

&lt;p&gt;Naming is one of the most important aspects of writing clean code.&lt;/p&gt;

&lt;p&gt;Variables and functions should clearly describe their purpose.&lt;/p&gt;

&lt;p&gt;For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// not very clear&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;d&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Date&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

&lt;span class="c1"&gt;// clearer&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;currentDate&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Date&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Good names make code easier to read and reduce the need for additional comments.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. Keep Functions Focused on One Responsibility
&lt;/h2&gt;

&lt;p&gt;I try to keep functions focused on a &lt;strong&gt;single responsibility&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;When a function starts doing too many things, it becomes harder to read, test, and maintain.&lt;/p&gt;

&lt;p&gt;Breaking logic into smaller functions often makes the code more modular and easier to understand.&lt;/p&gt;

&lt;h2&gt;
  
  
  Final Thoughts
&lt;/h2&gt;

&lt;p&gt;Clean code isn't about writing perfect code. It's about writing code that other developers — and your future self — can easily understand.&lt;/p&gt;

&lt;p&gt;Small habits like writing meaningful comments, organizing imports, using early returns, and choosing better names can make a big difference over time.&lt;/p&gt;

&lt;p&gt;They may seem like small improvements, but they help keep codebases more readable and maintainable.&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>codequality</category>
      <category>programming</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Authentication vs Authorization</title>
      <dc:creator>Noriuki</dc:creator>
      <pubDate>Mon, 09 Mar 2026 22:40:00 +0000</pubDate>
      <link>https://dev.to/noriuki/authentication-vs-authorization-3je5</link>
      <guid>https://dev.to/noriuki/authentication-vs-authorization-3je5</guid>
      <description>&lt;p&gt;When you're developing web applications, you'll frequently encounter the terms &lt;strong&gt;authentication&lt;/strong&gt; and &lt;strong&gt;authorization&lt;/strong&gt;. They often appear together, and sometimes they're even used interchangeably.&lt;/p&gt;

&lt;p&gt;However, they represent &lt;strong&gt;different concepts&lt;/strong&gt; that are essential for building secure applications.&lt;/p&gt;

&lt;p&gt;Let's break them down.&lt;/p&gt;

&lt;h2&gt;
  
  
  What Is Authentication?
&lt;/h2&gt;

&lt;p&gt;At its core, &lt;strong&gt;authentication&lt;/strong&gt; is about confirming a user's &lt;strong&gt;identity&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;It's the process the system uses to verify that you are who you claim to be.&lt;/p&gt;

&lt;p&gt;A common example is logging into an application. When you enter your email and password, the system checks whether those credentials match what it has stored. If they do, you are &lt;strong&gt;authenticated&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Some common authentication methods include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;passwords&lt;/li&gt;
&lt;li&gt;one-time codes (OTP)&lt;/li&gt;
&lt;li&gt;biometrics like fingerprints or facial recognition&lt;/li&gt;
&lt;li&gt;signing in with providers like Google or GitHub&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;At the end of the process, the system knows &lt;strong&gt;who&lt;/strong&gt; the user is.&lt;/p&gt;

&lt;h2&gt;
  
  
  What Is Authorization?
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Authorization&lt;/strong&gt; happens &lt;strong&gt;after&lt;/strong&gt; authentication.&lt;/p&gt;

&lt;p&gt;Once the system knows who the user is, it needs to determine &lt;strong&gt;what that user is allowed to do&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;For example, imagine an admin dashboard:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;regular users&lt;/strong&gt; can view their own data&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;moderators&lt;/strong&gt; can edit content&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;administrators&lt;/strong&gt; can manage users&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Even though all of them are authenticated, they have different permissions.&lt;/p&gt;

&lt;p&gt;Authorization is what controls those access levels.&lt;/p&gt;

&lt;h2&gt;
  
  
  A Simple Example
&lt;/h2&gt;

&lt;p&gt;Imagine a web application with two types of users:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;regular users&lt;/li&gt;
&lt;li&gt;administrators&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Authentication&lt;/strong&gt; answers the question:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;"Is this person really Alice?"&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;Authorization&lt;/strong&gt; answers a different question:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;"What is Alice allowed to do?"&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;For example:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Alice logs in → &lt;strong&gt;authentication&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;The system checks if Alice is an admin → &lt;strong&gt;authorization&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Why the Difference Matters
&lt;/h2&gt;

&lt;p&gt;Separating authentication and authorization helps make systems more secure and easier to manage.&lt;/p&gt;

&lt;p&gt;It allows developers to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;verify user identities&lt;/li&gt;
&lt;li&gt;control access to specific features&lt;/li&gt;
&lt;li&gt;implement role-based permissions&lt;/li&gt;
&lt;li&gt;protect sensitive data&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Most modern applications rely on &lt;strong&gt;both&lt;/strong&gt; processes working together.&lt;/p&gt;

&lt;h2&gt;
  
  
  Final Thoughts
&lt;/h2&gt;

&lt;p&gt;Authentication and authorization are closely related, but they serve different purposes.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Authentication&lt;/strong&gt; verifies &lt;strong&gt;who&lt;/strong&gt; the user is&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Authorization&lt;/strong&gt; determines &lt;strong&gt;what&lt;/strong&gt; the user can do&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Understanding this distinction is an important step when building secure and scalable applications.&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>security</category>
      <category>tutorial</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Understanding APIs in Simple Terms</title>
      <dc:creator>Noriuki</dc:creator>
      <pubDate>Mon, 09 Mar 2026 21:56:38 +0000</pubDate>
      <link>https://dev.to/noriuki/understanding-apis-in-simple-terms-5729</link>
      <guid>https://dev.to/noriuki/understanding-apis-in-simple-terms-5729</guid>
      <description>&lt;p&gt;If you're diving into web development, you've likely encountered the term &lt;strong&gt;API&lt;/strong&gt; quite a bit. While APIs are fundamental to how modern software operates, they can seem a bit daunting for newcomers.&lt;/p&gt;

&lt;p&gt;Let's break down what they are in straightforward terms.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is an API?
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;API&lt;/strong&gt; stands for &lt;strong&gt;Application Programming Interface&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Essentially, an API acts as a &lt;strong&gt;bridge&lt;/strong&gt; that allows different software systems to communicate with each other. Instead of directly accessing a system's internal logic or its database, applications interact with it through a defined interface — the API.&lt;/p&gt;

&lt;h2&gt;
  
  
  A Simple Analogy
&lt;/h2&gt;

&lt;p&gt;One way to understand an API is to think about a &lt;strong&gt;restaurant&lt;/strong&gt;.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;You&lt;/strong&gt; are the customer&lt;/li&gt;
&lt;li&gt;The &lt;strong&gt;kitchen&lt;/strong&gt; represents the system&lt;/li&gt;
&lt;li&gt;The &lt;strong&gt;waiter&lt;/strong&gt; represents the API&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You don't walk into the kitchen and cook your own meal. Instead, you tell the waiter what you want. The waiter brings your request to the kitchen, the kitchen prepares the food, and the waiter brings it back to your table.&lt;/p&gt;

&lt;p&gt;The process is simple:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;You make a request&lt;/li&gt;
&lt;li&gt;The waiter takes it to the kitchen&lt;/li&gt;
&lt;li&gt;The kitchen prepares the response&lt;/li&gt;
&lt;li&gt;The waiter delivers it back to you&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;An API works in a very similar way. Your application sends a request to the API, the system processes it, and the API returns the response.&lt;/p&gt;

&lt;h2&gt;
  
  
  APIs on the Web
&lt;/h2&gt;

&lt;p&gt;On the web, APIs commonly use &lt;strong&gt;HTTP requests&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Some common request types include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;GET&lt;/strong&gt; – retrieve data&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;POST&lt;/strong&gt; – send new data&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;PUT / PATCH&lt;/strong&gt; – update existing data&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;DELETE&lt;/strong&gt; – remove data&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These requests are sent to specific &lt;strong&gt;endpoints&lt;/strong&gt;, which are URLs that represent particular resources or actions.&lt;/p&gt;

&lt;p&gt;For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight http"&gt;&lt;code&gt;&lt;span class="err"&gt;GET /users
GET /users/10
POST /users
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Each endpoint represents a resource or an action that the API can handle.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why APIs Matter
&lt;/h2&gt;

&lt;p&gt;APIs are essential to modern software development.&lt;/p&gt;

&lt;p&gt;They allow applications to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;communicate with other systems&lt;/li&gt;
&lt;li&gt;reuse existing services&lt;/li&gt;
&lt;li&gt;integrate with external platforms&lt;/li&gt;
&lt;li&gt;build scalable applications&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Many well-known platforms provide APIs so developers can build on top of their services, including &lt;strong&gt;Google&lt;/strong&gt;, &lt;strong&gt;Stripe&lt;/strong&gt;, and &lt;strong&gt;GitHub&lt;/strong&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Final Thoughts
&lt;/h2&gt;

&lt;p&gt;APIs are one of the core building blocks of modern development.&lt;/p&gt;

&lt;p&gt;Once you understand how they work, many parts of web development start to make a lot more sense.&lt;/p&gt;

&lt;p&gt;If you're learning programming, experimenting with public APIs is a great way to understand how applications communicate and exchange data.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>programming</category>
      <category>api</category>
      <category>beginners</category>
    </item>
  </channel>
</rss>
