<?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: Silas</title>
    <description>The latest articles on DEV Community by Silas (@silaslelei).</description>
    <link>https://dev.to/silaslelei</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%2F3716579%2F59e2dceb-c213-4bea-b911-f0a1f02a9dc7.png</url>
      <title>DEV Community: Silas</title>
      <link>https://dev.to/silaslelei</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/silaslelei"/>
    <language>en</language>
    <item>
      <title>Getting Started with ReactJS</title>
      <dc:creator>Silas</dc:creator>
      <pubDate>Mon, 18 May 2026 08:12:24 +0000</pubDate>
      <link>https://dev.to/silaslelei/getting-started-with-reactjs-3ag2</link>
      <guid>https://dev.to/silaslelei/getting-started-with-reactjs-3ag2</guid>
      <description>&lt;p&gt;Ever wanted to get started with react but just couldn't find the straight-to-the-point guide and you also couldn't handle sitting through hours of tutorials? Well, let's try it this way.&lt;/p&gt;

&lt;p&gt;I will not even try to get you from 0-100 of react in this one post. Just a little push is what I promise, so let's dive right in.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is React
&lt;/h2&gt;

&lt;p&gt;React is a popular open-source javascript framework by Meta used primarily for building user interfaces majorly for single page applications. &lt;/p&gt;

&lt;h2&gt;
  
  
  Installation
&lt;/h2&gt;

&lt;p&gt;To get started, you need to have node (and npm) installed. To install, follow the guide &lt;a href="https://nodejs.org/en/download" rel="noopener noreferrer"&gt;here&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Once installation is complete, you can confirm by running &lt;code&gt;node -v&lt;/code&gt; on your terminal(or command prompt), which should output something like &lt;code&gt;v24.9.0&lt;/code&gt;. That should confirm the installation was successful.&lt;/p&gt;

&lt;h3&gt;
  
  
  Install React
&lt;/h3&gt;

&lt;p&gt;Over the years, react installation has changed from the traditional &lt;code&gt;create-react-app&lt;/code&gt; to more reliable and efficient methods of using scaffolds, specifically vite.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;open your terminal(if not already opened)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Navigate to your desired directory&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Run &lt;code&gt;npm create vite@latest&lt;/code&gt; This will prompt you for a few inputs like project name, framework as shown:&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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcayk186rj85krhu8ksc4.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%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcayk186rj85krhu8ksc4.png" alt="terminal" width="300" height="168"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Finally, execute the last 3 commands shown : cd project-name, npm install and finally npm run dev.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;code&gt;npm install&lt;/code&gt; installs the dependencies required by the project as defined in package.json&lt;br&gt;
&lt;code&gt;npm run dev&lt;/code&gt; starts the development server which runs your project locally.&lt;/p&gt;

&lt;p&gt;And that's our checkpoint. You have successfully installed and ran a react project.&lt;/p&gt;

&lt;p&gt;As of vite 8, the setup comes with:&lt;br&gt;
&lt;code&gt;/public&lt;/code&gt; - this directory contains public assets like images&lt;br&gt;
&lt;code&gt;/src&lt;/code&gt; - contains all the source code of the app&lt;br&gt;
&lt;code&gt;.gitignore&lt;/code&gt; - default populated .gitignore template &lt;br&gt;
&lt;code&gt;eslint.config.js&lt;/code&gt; - configuration for the linter&lt;br&gt;
&lt;code&gt;index.html&lt;/code&gt; - the main html file that react appends components&lt;br&gt;
&lt;code&gt;package*.json&lt;/code&gt; - stores configuration and dependencies for the app&lt;br&gt;
&lt;code&gt;README.md&lt;/code&gt; - basic vite documentation&lt;br&gt;
&lt;code&gt;vite.config.js&lt;/code&gt; - configuration for vite development server&lt;/p&gt;

&lt;p&gt;Inside src, we have 2 css and 2 jsx files. The .jsx files are native to react, they denote react components. &lt;/p&gt;

&lt;p&gt;&lt;code&gt;App.css&lt;/code&gt; is styling used within App.jsx whereas &lt;br&gt;
&lt;code&gt;index.css&lt;/code&gt; is a global styling sheet for index.html, which App inherits.&lt;br&gt;
&lt;code&gt;Main.jsx&lt;/code&gt; is the entrypoint of the app. This is where the react app is injected into index.html's &lt;code&gt;&amp;lt;div id="root"&amp;gt;&amp;lt;/div&amp;gt;&lt;/code&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  Now let's code ...
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Delete everything in App.jsx and replace it with this:
&lt;/li&gt;
&lt;/ul&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;App&lt;/span&gt;&lt;span class="p"&gt;(){&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;p&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nx"&gt;Hello&lt;/span&gt; &lt;span class="nx"&gt;React&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/p&amp;gt;&lt;/span&gt;&lt;span class="err"&gt;)
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;When you run the server , &lt;code&gt;npm run dev&lt;/code&gt; and open the address &lt;code&gt;http://localhost:5173&lt;/code&gt; in browser, you should see &lt;code&gt;Hello React&lt;/code&gt; displayed&lt;/p&gt;
&lt;h2&gt;
  
  
  JSX Basics
&lt;/h2&gt;

&lt;p&gt;JSX(Javascript XML) is a syntax that allows you to write HTML-like code within Javascript. This is what aims to make react easy and intuitive, and make transition from HTML almost seamless.&lt;br&gt;
JSX will look almost exactly like HTML, but with a few differences:&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;//jsx&lt;/span&gt;
&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;div&lt;/span&gt; &lt;span class="nx"&gt;className&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;container&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/div&amp;gt;&lt;/span&gt;&lt;span class="err"&gt; 
&lt;/span&gt;
&lt;span class="nx"&gt;instead&lt;/span&gt; &lt;span class="k"&gt;of&lt;/span&gt;

&lt;span class="c1"&gt;//html&lt;/span&gt;
&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;div&lt;/span&gt; &lt;span class="kd"&gt;class&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;container&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/div&amp;gt;&lt;/span&gt;&lt;span class="err"&gt; 
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It is worth noting that, a JSX component or function MUST return ONLY ONE child/parent component. Having more than one will result in React throwing an error.&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;//only one element is returned. This will work&lt;/span&gt;
&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;App&lt;/span&gt;&lt;span class="p"&gt;(){&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
      &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;p&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nx"&gt;Hello&lt;/span&gt; &lt;span class="nx"&gt;React&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/p&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;    &lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;//More than one element is returned. This will NOT work&lt;/span&gt;
&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;App&lt;/span&gt;&lt;span class="p"&gt;(){&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
      &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;p&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nx"&gt;Hello&lt;/span&gt; &lt;span class="nx"&gt;React&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/p&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;      &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;p&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nx"&gt;Another&lt;/span&gt; &lt;span class="nx"&gt;element&lt;/span&gt; &lt;span class="nx"&gt;that&lt;/span&gt; &lt;span class="nx"&gt;will&lt;/span&gt; &lt;span class="k"&gt;break&lt;/span&gt; &lt;span class="nx"&gt;compilation&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/p&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;    &lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Ensure to only have one parent element always: To fix the above, do this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;App&lt;/span&gt;&lt;span class="p"&gt;(){&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;div&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;p&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nx"&gt;Hello&lt;/span&gt; &lt;span class="nx"&gt;React&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/p&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;      &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;p&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nx"&gt;Another&lt;/span&gt; &lt;span class="nx"&gt;element&lt;/span&gt; &lt;span class="nx"&gt;that&lt;/span&gt; &lt;span class="nx"&gt;will&lt;/span&gt; &lt;span class="k"&gt;break&lt;/span&gt; &lt;span class="nx"&gt;compilation&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/p&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/div&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;    &lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This consequently wraps all the elements in one parent div and thus the jsx only returns one element.&lt;/p&gt;

&lt;h2&gt;
  
  
  Manage States with useState()
&lt;/h2&gt;

&lt;p&gt;In React, you will run into a number of functions that start with &lt;strong&gt;use&lt;/strong&gt; e.g useState, useEffect, useContext and so on. These are called Hooks. We will learn later about them in depth.&lt;br&gt;
For now, we will start with the common ones: useState and useEffect.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;useState&lt;/strong&gt;&lt;br&gt;
This is a snapshot of a component(and its data) at a particular point in time. Component's data changes over time, so each change represent a new state.&lt;br&gt;
React has a state manager, &lt;code&gt;useState()&lt;/code&gt; to manage change in states. When a state changes, react triggers a re-render of that component to show the change, e.g user typing into a textfield. Every keypress is a new state hence the textbox is re-rendered with the new data everytime.&lt;/p&gt;

&lt;p&gt;To use this, first import useState at the top of the file:&lt;br&gt;
&lt;code&gt;import {useState} from 'react'&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Within the function body:&lt;br&gt;
&lt;code&gt;const [count,setCount] = useState(0)&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;useState() takes a default value that represents the datatype of what the state stores.&lt;br&gt;
Our example tells us that count is of type &lt;code&gt;int&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;count&lt;/code&gt; -&amp;gt; state variable&lt;br&gt;
&lt;code&gt;setCount&lt;/code&gt; -&amp;gt; function to change state.&lt;/p&gt;

&lt;p&gt;** NB: you should NEVER directly change &lt;code&gt;count&lt;/code&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;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;useState&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="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="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;App&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;count&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;setCount&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;useState&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

  &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;handleClick&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nf"&gt;setCount&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;prev&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nf"&gt;setCount&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;prev&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;

  &lt;span class="k"&gt;return &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;div&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;p&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nx"&gt;Count&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;count&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/p&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;      &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;button&lt;/span&gt; &lt;span class="nx"&gt;onClick&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;handleClick&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nx"&gt;Increment&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/button&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/div&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;  &lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

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

&lt;/div&gt;



&lt;p&gt;This shows us a simple implementation of useState() in action.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;TODO&lt;/strong&gt;: Try implement a decrement.&lt;/p&gt;

&lt;h2&gt;
  
  
  UseEffect
&lt;/h2&gt;

&lt;p&gt;This hook is used to define an action done when a particular event happens.&lt;br&gt;
It is used to define what happens:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Immediately the app loads/runs&lt;/li&gt;
&lt;li&gt;When a state changes.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The syntax for this is:&lt;/p&gt;

&lt;p&gt;First, import: &lt;code&gt;import { useEffect } from react&lt;/code&gt;&lt;br&gt;
Second, implement: &lt;/p&gt;

&lt;h3&gt;
  
  
  Pattern 1: Run on Every Render
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nf"&gt;useEffect&lt;/span&gt;&lt;span class="p"&gt;(()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="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="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;This runs after EVERY render&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="c1"&gt;// No dependency array = runs every time the component re-renders&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Pattern 2: Run Once on Mount
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nf"&gt;useEffect&lt;/span&gt;&lt;span class="p"&gt;(()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="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="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;This runs ONCE when component first appears&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;},&lt;/span&gt; &lt;span class="p"&gt;[]);&lt;/span&gt;
&lt;span class="c1"&gt;// Empty array [] = runs only on initial mount&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Pattern 3: Run When Dependencies Change
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nf"&gt;useEffect&lt;/span&gt;&lt;span class="p"&gt;(()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="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="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;This runs when 'count' changes&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;},&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;count&lt;/span&gt;&lt;span class="p"&gt;]);&lt;/span&gt;
&lt;span class="c1"&gt;// Array with variables = runs when any of those variables change&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;The Dependency Array Explained&lt;/strong&gt;&lt;br&gt;
Think of the dependency array as React asking: "What should I watch for changes?"&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;No array - "Watch everything, run after every render"&lt;/li&gt;
&lt;li&gt;Empty [] - "Watch nothing, run once and done"&lt;/li&gt;
&lt;li&gt;[count, name] - "Watch count and name, run when either changes"
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;useEffect&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;useState&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="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="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;App&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;count&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;setCount&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;useState&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

  &lt;span class="c1"&gt;// Runs every render&lt;/span&gt;
  &lt;span class="nf"&gt;useEffect&lt;/span&gt;&lt;span class="p"&gt;(()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="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="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Component rendered&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="c1"&gt;// Runs once when app starts&lt;/span&gt;
  &lt;span class="nf"&gt;useEffect&lt;/span&gt;&lt;span class="p"&gt;(()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="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="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;App mounted - this runs once&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="p"&gt;},&lt;/span&gt; &lt;span class="p"&gt;[]);&lt;/span&gt;

  &lt;span class="c1"&gt;// Runs when count changes&lt;/span&gt;
  &lt;span class="nf"&gt;useEffect&lt;/span&gt;&lt;span class="p"&gt;(()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="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="s2"&gt;`Count changed to: &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;count&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="p"&gt;},&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;count&lt;/span&gt;&lt;span class="p"&gt;]);&lt;/span&gt;

  &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;handleClick&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nf"&gt;setCount&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;prev&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;prev&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;

  &lt;span class="k"&gt;return &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;div&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;p&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nx"&gt;Count&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;count&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/p&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;      &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;button&lt;/span&gt; &lt;span class="nx"&gt;onClick&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;handleClick&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nx"&gt;Increment&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/button&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;    &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/div&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;  &lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="nx"&gt;App&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;TODO&lt;/strong&gt;:&lt;br&gt;
Open your browser console and click the increment button. Watch the console to see which useEffect hooks run and when.&lt;/p&gt;

&lt;p&gt;Note: You might see each log appear twice in development mode. This is React's StrictMode deliberately rendering components twice to help catch bugs - it only happens in development, not in production.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Common Use Cases&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;[] empty array: Fetching initial data, setting up event listeners&lt;/li&gt;
&lt;li&gt;[dependency]: Fetching new data when a filter changes, updating localStorage when state changes&lt;/li&gt;
&lt;li&gt;No array: Usually avoided unless you need something to happen on every render&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This guide has introduced you to JSX,useState and useEffect hooks in react.&lt;/p&gt;

&lt;p&gt;Keep practicing, see you on the next one.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>react</category>
      <category>programming</category>
    </item>
    <item>
      <title>Rocks vs Hard Places</title>
      <dc:creator>Silas</dc:creator>
      <pubDate>Mon, 20 Apr 2026 07:54:11 +0000</pubDate>
      <link>https://dev.to/silaslelei/rocks-vs-hard-places-4c7i</link>
      <guid>https://dev.to/silaslelei/rocks-vs-hard-places-4c7i</guid>
      <description>&lt;p&gt;"Between a rock and a hard place". We have all (probably) come across this phrase, or even worse, experienced it, lived through it.&lt;br&gt;
When you hear this, what goes on in your mind? What sparks?&lt;/p&gt;

&lt;p&gt;In such a situation, you are always faced with two difficult options to choose one. Neither is pleasant, but you have to choose the scorpion or the snake, the pan or the fire.&lt;/p&gt;

&lt;p&gt;I hope life has been fair to you!!&lt;/p&gt;

&lt;p&gt;How does this relate to programming you ask?&lt;/p&gt;

&lt;p&gt;Let's kick it up a notch.&lt;/p&gt;
&lt;h2&gt;
  
  
  Code... Rocks... Hard Places
&lt;/h2&gt;

&lt;p&gt;Updates are a crucial part of software, from your OS to you apps, to even your wardrobe!!&lt;br&gt;
We know the craze that comes with new releases of devices and whatnots. &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;iPhone 17 pre-order demand is significantly higher than the iPhone 16, with analysts reporting a 5-10% increase in early sales. The Pro Max model leads demand, with 60% higher production to meet demand, while the new "iPhone Air" model has seen a strong, high-demand release. China is seeing record-breaking demand&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;There are 2 categories of people. Those who will update to the latest versions of...anything, versus the ones who stick to the old. No harm in either, no judgement whatsoever.&lt;br&gt;
In the context of updates, Kenya's giant telco, Safaricom, released a major update to their unified MyOneApp received a lot of backlash about it, but that had a different tune to our current song, so we wont get into it.&lt;/p&gt;

&lt;p&gt;My big question to you is, why would you update (or apt upgrade ;)) to a newer version? Let me hear your thoughts.&lt;/p&gt;
&lt;h3&gt;
  
  
  Story time ...
&lt;/h3&gt;

&lt;p&gt;I have been used to the normal way of doing things:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm create vite@latest 
npm i tailwindcss @tailwindcss/vite
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Things always worked seamlessly, I was always a happy man. My last status check said that i was on Vite 7 and tailwind 4.&lt;br&gt;
I ran my project well without fusses.&lt;/p&gt;

&lt;p&gt;Then came this one day, I need to whip something up, so I do the usual, and suddenly I was running into errors. When your terminal goes blood red, you know someone(I mean something) is dead!!&lt;br&gt;
Now I was panicking and not knowing what to do, because I needed to ship something.&lt;/p&gt;

&lt;p&gt;The new vite was looking awesome and flashy, shifting to a more 'purple-y' theme. Our traditional yellow-orange &lt;a href="https://www.imdb.com/title/tt0448115/" rel="noopener noreferrer"&gt;shazam&lt;/a&gt;-like logo and what we were used to has now gotten a facelift(depending on how you choose to see it).&lt;/p&gt;

&lt;p&gt;On an abnormal level, my OCD😉 doesn't allow me to be out-of date. I'm talking about going to the app store and just hitting update because I can and because that notification has some alert badge/pill on it.&lt;br&gt;
I'm talking about some &lt;code&gt;sudo apt update&lt;/code&gt; and 'sudo apt upgrade' just because it said &lt;code&gt;17 packages can be upgraded to latest version&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Sometimes it works, and sometimes it just turns around and bites you where you can't see.&lt;/p&gt;

&lt;p&gt;After so many keystrokes and keyboard wars, I (my OCD) was faced with the brutal... Keep vite 8 and forget about Tailwind(probably it still could work with postcss and autoprefixer, but meh!!), or go down a rung, back to vite 7.&lt;br&gt;
Because I was in need, I took a glass of water and swallowed my pride😂.&lt;/p&gt;

&lt;p&gt;Of course after a few unanswered DM's and tags to Tailwindcss and Vite,  few weeks later, Tailwindcss 4.2.2 came out and my happiness was restored... Of course I hit the &lt;code&gt;npm i vite@latest&lt;/code&gt; as soon as I could, bumped up tailwind as well, fought with package-lock.json and node_modules for a while, and I won (of course the system won).&lt;/p&gt;

&lt;p&gt;I dont refute that updates are essential, especially on the security side of things(and with how fast react changes), there is another OCD side of &lt;code&gt;found [X] vulnerabilities ([Y] low, [Z] moderate, [A] high, [B] critical)&lt;/code&gt;. That thing scaaaarreesss me!! It always sends me scrambling to &lt;code&gt;npm audit fix&lt;/code&gt;, and it's not like I'm making a fintech app...Its just a ToDo list!&lt;/p&gt;

&lt;p&gt;So, would you always need to update? Do you read the changelogs and the effects it would have, or you just FAFO and taste it like I did?&lt;br&gt;
Let me know your crazy experiences on &lt;strong&gt;Latest&lt;/strong&gt;(rock) and &lt;strong&gt;Stable&lt;/strong&gt;(hard place) side of versions.&lt;/p&gt;

&lt;p&gt;Lets keep Reacting!&lt;/p&gt;

</description>
      <category>react</category>
      <category>programming</category>
    </item>
    <item>
      <title>Bash, Coffee, and Me: Learning Shell without losing your Mind</title>
      <dc:creator>Silas</dc:creator>
      <pubDate>Mon, 02 Mar 2026 08:42:58 +0000</pubDate>
      <link>https://dev.to/silaslelei/bash-coffee-and-me-learning-shell-without-losing-your-mind-50fj</link>
      <guid>https://dev.to/silaslelei/bash-coffee-and-me-learning-shell-without-losing-your-mind-50fj</guid>
      <description>&lt;p&gt;Its a cold Monday morning and the coffee doesn't seem to have hit the endpoint yet, or maybe it has and gotten a 400-500 HTTP status code response.&lt;br&gt;
As I wait for that to resolve, I find warmth in being bourne again. I am in the bourne again shell, get it?&lt;/p&gt;

&lt;p&gt;Bash has always felt a bit intimidating, and just a bit far out of my reach.  Always looking mean and something too big to wrap my head around.&lt;/p&gt;

&lt;h3&gt;
  
  
  Wait, What is Bash?
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;Bash is a command-line interpreter and shell for Unix-like operating systems (Linux, macOS) that allows users to interact with the OS via text-based commands. It serves as the default interface for executing, automating, and scripting system tasks, acting as a bridge between the user and the kernel&lt;/code&gt;.&lt;a href="https://en.wikipedia.org/wiki/Bash_(Unix_shell)" rel="noopener noreferrer"&gt;🔗&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;But the problem, I think, was me trying to swallow it whole. Fast forward time to a few days ago, a peer introduced me to a game. Oh how I love games!! &lt;br&gt;
This game gets you started on the essentials of bash. I was well versed with the very basic, or rather the ones I'd use on a daily basis: ls, mkdir, touch and a few others, so those ones didn't really raise my 'spidey senses'.&lt;/p&gt;

&lt;h3&gt;
  
  
  Basics?
&lt;/h3&gt;

&lt;p&gt;So, lets go through what I call 'the very basics':&lt;br&gt;
&lt;code&gt;ls&lt;/code&gt;: lists contents of a directory &lt;br&gt;
&lt;code&gt;mkdir name&lt;/code&gt;: creates a new directory 'name' in the current directory&lt;br&gt;
&lt;code&gt;touch name&lt;/code&gt;: creates a new file 'name' in the current directory&lt;/p&gt;

&lt;p&gt;Most of these commands take overloads or parameters or flags which are placed after the command to add more options or coverage to them.&lt;br&gt;
As we have already seen, ls just outputs the contents of a directory, both files and folders, with barely no distinction.&lt;/p&gt;

&lt;h3&gt;
  
  
  Deep (or shallow) dive into ls
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;ls -l&lt;/code&gt; : This is "long listing". It will give you the contents of the current directory together with more info about each content. You will get an output resembling this:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;drwxr-xr-x 2 ksilas cohort2    4096 Feb 17 13:27 algorithm&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;The first letter d&lt;/code&gt; shows that 'algorithm' is a directory. A file would be denoted with a -&lt;br&gt;
The second batch (position &lt;code&gt;2,3,4&lt;/code&gt;) which are &lt;code&gt;rwx&lt;/code&gt; represent the permission assigned to the user: r-read, w-write, x-execute&lt;br&gt;
The next 3 in position &lt;code&gt;5,6,7&lt;/code&gt; are also permissions for the group the user/file is in.&lt;br&gt;
The &lt;code&gt;last 3&lt;/code&gt; are permissions for others. These permissions apply to users who are not owners and are not not in the user group.&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;number&lt;/code&gt; that follows the permission, &lt;code&gt;2&lt;/code&gt;, represents the number of hard links in the directory.&lt;/p&gt;

&lt;p&gt;The next text, &lt;code&gt;ksilas&lt;/code&gt; represent the owner of the file, and &lt;code&gt;cohort2&lt;/code&gt; represents the group in which the file belongs to. By default, the group will be the one the owner belongs to.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;4096&lt;/code&gt; is the size, in bytes, of the file or directory&lt;/p&gt;

&lt;p&gt;&lt;code&gt;Feb 17 13:27&lt;/code&gt; represents the date and time the file/directory was last modified.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;algorithm&lt;/code&gt; would then finally represent the current items with the above stats.&lt;/p&gt;

&lt;h3&gt;
  
  
  Still There?
&lt;/h3&gt;

&lt;p&gt;Already overwhelming, right???😄 Stay with me. I haven't shown you something amazing. We want to find a file with a particular name, and of course the directory.&lt;br&gt;
This is where I shut down😰.&lt;br&gt;
What is &lt;code&gt;grep&lt;/code&gt;, you ask. Well, I actually just went to google that up😅. &lt;code&gt;Global Regular Expression Print&lt;/code&gt;. Basically, it looks for files  or text that match the particular pattern given. Say &lt;code&gt;grep "hello"&lt;/code&gt; will look for texts that contain 'hello'&lt;/p&gt;

&lt;p&gt;But that's not even the problem. What annoyed me was, yes it would list all files that match a pattern, but what I really needed was WHERE the file is. Grep didn't give me that, or at least I didn't know how to ask nicely.&lt;/p&gt;

&lt;h3&gt;
  
  
  FIND the savior
&lt;/h3&gt;

&lt;p&gt;In walks &lt;code&gt;FIND&lt;/code&gt;. I could never ask for more😂🤩.&lt;br&gt;
This is the heart of our discourse today.&lt;br&gt;
Suppose you want to find a FILE with size 100 bytes, and an owner silas, I could imagine your head spinning already.&lt;/p&gt;

&lt;p&gt;But for our Swiss Army knife:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;**find . -type f -size 100c -user silas**&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Let me leave you marvel at the wonders of Bourne Again SHell!! I go away smiling... a happier man.&lt;/p&gt;

&lt;p&gt;But before I go, check out the &lt;a href="https://overthewire.org/wargames/bandit/" rel="noopener noreferrer"&gt;game&lt;/a&gt; I mentioned earlier.&lt;/p&gt;

&lt;p&gt;Bye👋🏻&lt;/p&gt;

</description>
      <category>bash</category>
      <category>programming</category>
    </item>
    <item>
      <title>How to Write Git Commit Messages Like a Pro</title>
      <dc:creator>Silas</dc:creator>
      <pubDate>Wed, 11 Feb 2026 01:34:24 +0000</pubDate>
      <link>https://dev.to/silaslelei/how-to-write-git-commit-messages-like-a-pro-3ep4</link>
      <guid>https://dev.to/silaslelei/how-to-write-git-commit-messages-like-a-pro-3ep4</guid>
      <description>&lt;p&gt;Ever wondered how to write commit messages for Git? Or maybe you’ve written messages that were technically correct but still caused murmurs in your team?&lt;/p&gt;

&lt;p&gt;Well, that ends here and now. We’ve all been victims of this anomaly, and the way forward is simple: improve ourselves and share knowledge.&lt;br&gt;
Let's dive in...&lt;/p&gt;

&lt;h3&gt;
  
  
  What is Git?
&lt;/h3&gt;

&lt;p&gt;Git is a distributed version control system that manages versions of source code or data. Programmers often use it to collaborate on projects efficiently.&lt;/p&gt;

&lt;p&gt;Git lets you work locally, track changes to files, and push those changes to remote repositories like GitHub or Bitbucket for collaboration. &lt;br&gt;
&lt;a href="https://en.wikipedia.org/wiki/Git" rel="noopener noreferrer"&gt;More about git&lt;/a&gt;&lt;br&gt;
&lt;a href="https://git-scm.com/" rel="noopener noreferrer"&gt;Git official&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  How to commit
&lt;/h3&gt;

&lt;p&gt;A commit is made by running &lt;code&gt;git commit -m "some-message"&lt;/code&gt; with -m flag denoting &lt;em&gt;message&lt;/em&gt; and "some-message" being the details of what you are committing, which is the main point of our article today.&lt;/p&gt;

&lt;p&gt;Commit messages aren’t about long paragraphs, perfect grammar, or capitalization. They are about clarity, brevity, and readability. &lt;/p&gt;

&lt;h3&gt;
  
  
  Common Commit Message Tags
&lt;/h3&gt;

&lt;p&gt;Using standard tags makes Git history clear and helps your team understand the purpose of each change.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;feat&lt;/code&gt;:&lt;br&gt;
when the commit adds or changes functionality in a way that matters to users e.g &lt;code&gt;feat: add GitHub OAuth login&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;fix&lt;/code&gt;:&lt;br&gt;
when the commit fixes a bug that existed e.g &lt;code&gt;fix: handle API rate limits&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;docs&lt;/code&gt;:&lt;br&gt;
when only the documentation changes (no code behavior changes). e.g &lt;code&gt;docs: update README with setup instructions&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;style&lt;/code&gt;:&lt;br&gt;
Code style or formatting changes that do not affect logic or behavior. e.g &lt;code&gt;style: fix indentation&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;refactor&lt;/code&gt;:&lt;br&gt;
Code changes that improve structure or readability without changing behavior. e.g &lt;code&gt;refactor: simplify GitHub client logic&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;test&lt;/code&gt;:&lt;br&gt;
Adds, updates, or fixes tests only. e.g &lt;code&gt;test: add unit tests for login&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;chore&lt;/code&gt;:&lt;br&gt;
Maintenance tasks that don’t affect application behavior&lt;br&gt;
(dependencies, configs, scripts). e.g &lt;code&gt;chore: update GitHub Actions workflow&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;revert&lt;/code&gt;:&lt;br&gt;
Reverts a previous commit e.g &lt;code&gt;revert: undo login feature&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;perf&lt;/code&gt;:&lt;br&gt;
Changes that improve performance e.g &lt;code&gt;perf: optimize database queries&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;build&lt;/code&gt;:&lt;br&gt;
Changes that affect the build system or external dependencies. e.g &lt;code&gt;build: update dependencies&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It is also good practice to write your commits in the present tense. Instead of "feat: added login functionality", do "feat: add login functionality" &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"That's how dad did it, that's how America does it, and it's worked out pretty well so far"&lt;br&gt;
 ~Iron Man 2008&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;This sets the base for linear and standard collaboration works and i hope you are a better commiter now that you've come this far.&lt;/p&gt;

&lt;p&gt;Like my boss would say, leave with a quote to appear smart, i will leave you with this:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"Git commit messages are how we communicate to our future selves."&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Happy committing, and may your Git history be forever clean and understandable.&lt;/p&gt;

&lt;p&gt;Bye 👋&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>github</category>
      <category>git</category>
      <category>programming</category>
    </item>
    <item>
      <title>Survival Mode: Week 1 at Zone01 Kisumu ✅</title>
      <dc:creator>Silas</dc:creator>
      <pubDate>Tue, 20 Jan 2026 05:44:28 +0000</pubDate>
      <link>https://dev.to/silaslelei/survival-mode-week-1-at-zone01-kisumu-3pd8</link>
      <guid>https://dev.to/silaslelei/survival-mode-week-1-at-zone01-kisumu-3pd8</guid>
      <description>&lt;p&gt;The first week is officially in the books. To say it was a "challenge" would be an understatement—it was a full-on baptism by fire.&lt;/p&gt;

&lt;p&gt;If there was ever a moment to throw in the towel, this was it. The learning curve was vertical, the bugs were relentless, and the caffeine was mandatory. But we made it through. We might have a few "mental bruises" and syntax-induced scars, but we’re still standing.&lt;/p&gt;

&lt;p&gt;I’m finally starting to find my rhythm at Zone01 Kisumu. The road ahead looks intense, but if Week 1 taught me anything, it's that the grind is where the growth happens.&lt;/p&gt;

&lt;p&gt;Keep it locked. 🚀&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Sabbatical... 😂</title>
      <dc:creator>Silas</dc:creator>
      <pubDate>Sat, 17 Jan 2026 13:36:05 +0000</pubDate>
      <link>https://dev.to/silaslelei/sabbatical-2h4b</link>
      <guid>https://dev.to/silaslelei/sabbatical-2h4b</guid>
      <description>&lt;p&gt;So yesterday, I wrote a test on golang after about 300 days of not touching code. &lt;br&gt;
I was very confident about acing the test and I had nothing to worry about. &lt;br&gt;
Well... 😂&lt;br&gt;
Let's just say, iron rusts when left outside. &lt;br&gt;
Dust accumulates when stuff is undisturbed. &lt;/p&gt;

&lt;p&gt;So here I am, back again, to writing code. May the codes be with me... And y'all 💪&lt;/p&gt;

</description>
      <category>go</category>
      <category>zone01kisumu</category>
    </item>
  </channel>
</rss>
