<?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: Abdur-Rahman</title>
    <description>The latest articles on DEV Community by Abdur-Rahman (@shafspecs).</description>
    <link>https://dev.to/shafspecs</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%2F546793%2F1c00bcbe-7c8d-4542-8b15-9749590a82e4.png</url>
      <title>DEV Community: Abdur-Rahman</title>
      <link>https://dev.to/shafspecs</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/shafspecs"/>
    <language>en</language>
    <item>
      <title>Exploring Binary Trees (in C++)</title>
      <dc:creator>Abdur-Rahman</dc:creator>
      <pubDate>Tue, 06 Aug 2024 10:52:17 +0000</pubDate>
      <link>https://dev.to/shafspecs/exploring-binary-trees-in-c-jlk</link>
      <guid>https://dev.to/shafspecs/exploring-binary-trees-in-c-jlk</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;This post was originally posted on &lt;a href="https://hashnode.com/post/clzbruiro000609jvd3b9359g" rel="noopener noreferrer"&gt;my Hashnode blog&lt;/a&gt;.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;A short while ago, I undertook the task of improving my C++ via DSA (which stands for &lt;strong&gt;D&lt;/strong&gt;ata &lt;strong&gt;S&lt;/strong&gt;tructure &amp;amp; &lt;strong&gt;A&lt;/strong&gt;lgorithms). The aim of practising DSA is simple: By implementing your own data structures and algorithms, you learn a lot of what happens under the hood of your everyday programming, allowing you to write more efficient and optimised code. In short, it helps you distinguish between bloat and useful code.&lt;/p&gt;

&lt;p&gt;Before we move on, what exactly is even DSA? Let's define the words in there.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Data Structure:&lt;/strong&gt; A data structure is a named location that allows you to store and organise data. An example of a data structure is the common &lt;code&gt;Map&lt;/code&gt; found in multiple languages&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Algorithm:&lt;/strong&gt; An algorithm is a set of steps that define processes/steps to perform a task. There are two main, important components of an algorithm: the order and the steps. A non-technical example is getting ready for work, you have 4 steps: wake up, shower, dress for the day, and head out. We defined the steps and also ordered them. Imagine showering, then waking up, then heading out, then dressing up! That's a sure way to land in an asylum.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That's the basics out of the way, back to my journey. Binary trees are a data tree structure with multiple nodes, with a node having no more than 2 children.&lt;/p&gt;

&lt;h2&gt;
  
  
  🌲 Binary Tree
&lt;/h2&gt;

&lt;p&gt;What was the word salad above, you ask? Let's break down the concepts:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Tree Data Structure:&lt;/strong&gt; A tree data structure is an abstract data structure that mimics a tree hierarchical structure with a set of connected points. Each point has one parent point, except the root point (where the tree starts from). Each point here is called a node. The connecting "lines" between a node is called an edge.&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%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1722507080527%2F2f3d3e61-3443-47f6-8667-3511014fe26d.png%3Fauto%3Dcompress%2Cformat%26format%3Dwebp" 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%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1722507080527%2F2f3d3e61-3443-47f6-8667-3511014fe26d.png%3Fauto%3Dcompress%2Cformat%26format%3Dwebp" alt="Node Visualizer"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Binary Tree:&lt;/strong&gt; A binary tree is a tree data structure where each node has no more than two children, usually referred to as the left and right nodes. A child here means a node connected to a node on an upper level. In the picture above, the root has two children's nodes, with the left child's node having two children and the right child's node having three children nodes. &lt;em&gt;The picture above is&lt;/em&gt; &lt;strong&gt;&lt;em&gt;not&lt;/em&gt;&lt;/strong&gt; &lt;em&gt;a binary tree.&lt;/em&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;Note that the data structures here like trees and graphs are abstract concepts. They are models/conventions for shaping data.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Based on that, we can go ahead and define a basic Binary Tree:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight cpp"&gt;&lt;code&gt;&lt;span class="k"&gt;struct&lt;/span&gt; &lt;span class="nc"&gt;TreeNode&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;value&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="n"&gt;TreeNode&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;right&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;left&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

    &lt;span class="k"&gt;explicit&lt;/span&gt; &lt;span class="n"&gt;TreeNode&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;val&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;
        &lt;span class="n"&gt;value&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;val&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
        &lt;span class="n"&gt;right&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;nullptr&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
        &lt;span class="n"&gt;left&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;nullptr&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;Our binary tree is a struct that allows us to instantiate a root node, that is a node with no parent. It also points the left and right child nodes to nothing. Also, the edges are the pointers to its children nodes.&lt;/p&gt;

&lt;p&gt;We use pointers (&lt;code&gt;TreeNode *right, *left;&lt;/code&gt;) in our struct because binary trees are recursive structures. Each node needs to reference its children, but we don't know how many nodes the tree will have in advance. Pointers allow us to dynamically allocate memory for new nodes as we build the tree, providing flexibility and efficient memory usage.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight cpp"&gt;&lt;code&gt;&lt;span class="n"&gt;TreeNode&lt;/span&gt; &lt;span class="n"&gt;root&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;TreeNode&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;/code&gt;&lt;/pre&gt;

&lt;/div&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%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1722507949524%2Fe2554ecc-44b7-42c6-9d73-7478aa77e356.png%3Fauto%3Dcompress%2Cformat%26format%3Dwebp" 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%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1722507949524%2Fe2554ecc-44b7-42c6-9d73-7478aa77e356.png%3Fauto%3Dcompress%2Cformat%26format%3Dwebp" alt="Initial TreeNode Visual"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Let's add children nodes and see how it would tally.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight cpp"&gt;&lt;code&gt;&lt;span class="n"&gt;root&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;right&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nf"&gt;TreeNode&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="n"&gt;root&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;left&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nf"&gt;TreeNode&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="k"&gt;auto&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;node_three&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nf"&gt;TreeNode&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="k"&gt;auto&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;node_four&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nf"&gt;TreeNode&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="k"&gt;auto&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;node_five&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nf"&gt;TreeNode&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="n"&gt;root&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;right&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;left&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;node_three&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;root&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;right&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;right&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;node_five&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;root&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;left&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;left&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;node_four&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&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%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1722508715399%2F10e01a03-4035-4d13-9ec9-2da8c9c878a3.png%3Fauto%3Dcompress%2Cformat%26format%3Dwebp" 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%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1722508715399%2F10e01a03-4035-4d13-9ec9-2da8c9c878a3.png%3Fauto%3Dcompress%2Cformat%26format%3Dwebp" alt="TreeNode Binary Tree Hierarchy"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;That's the basics of the Binary Tree. Next, we will briefly look at the traversal of a Binary Tree.&lt;/p&gt;

&lt;h3&gt;
  
  
  ↗️ Traversing a Binary Tree
&lt;/h3&gt;

&lt;p&gt;Traversing a binary tree simply means moving through the tree nodes. It can be broken down into two main categories:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Depth-First Search (DFS) Algorithms:&lt;/strong&gt; Depth-first is an algorithm (remember, steps and order) that is as its name advertises, a search algorithm used to travel around a tree by going down. For example, using our tree above, we can traverse: 0-2-4-1-3-5. Starting from the root, then going down the leftmost node recursively, then moving to the right and repeating the same process. DFS has different types of traversals we won't be looking at, namely Preorder, Inorder, and Postorder traversals.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Breadth-First Search (BFS) Algorithms:&lt;/strong&gt; Breadth-first is the opposite of the DFS algorithm, in that the traversal occurs across instead of down. Using our trusty tree above, a complete traversal would yield: 0-2-1-4-3-5. Unlike DFS, there's only one type of traversal when it comes to this algorithm. And that's Level Order Traversal.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That's it for this section. As I said above, a binary tree is an abstract data model (concept), not an actual topic to be cramming or sweating over. It only makes sense when applied to something practical (one good reason I &lt;strong&gt;hate&lt;/strong&gt; Leetcode and the like).&lt;/p&gt;

&lt;h2&gt;
  
  
  🔬 Practical Examples
&lt;/h2&gt;

&lt;p&gt;A good application of binary trees is in expression trees and ASTs (Abstract Syntax Trees). Expression trees are simply a way of representing mathematical expressions, whilst ASTs are used by compilers and parsers to represent code. Note that an expression tree/AST doesn't necessarily equate to a binary tree structure. A binary tree is just one of the ways they could be represented.&lt;/p&gt;

&lt;p&gt;Starting out with expression trees, let's say we want to represent the following:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight cpp"&gt;&lt;code&gt;&lt;span class="mi"&gt;2&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;7&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We can start out with a tree of the following structure:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight cpp"&gt;&lt;code&gt;&lt;span class="c1"&gt;// with the syntax &amp;lt;value|node&amp;gt;&lt;/span&gt;
&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="n"&gt;left&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="n"&gt;root&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="p"&gt;((&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;7&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="n"&gt;right&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The right node can then be broken down further to:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight cpp"&gt;&lt;code&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;7&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="n"&gt;left&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="n"&gt;root&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="mi"&gt;4&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="n"&gt;right&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The left node can also be broken down further..., do you see how this is coming along? By using a divide-and-conquer strategy, we can turn any complicated expression into a simple representation made up of multiple left-parent-right structures.&lt;/p&gt;

&lt;p&gt;For mathematical expression evaluation, expression trees allow for efficient computation of complex formulas. By traversing the tree, we can easily separate and respect the order of operations and handle nested expressions individually. This is very useful in applications like spreadsheet software, where users input complex mathematical expressions that need to be evaluated quickly and accurately.&lt;/p&gt;

&lt;p&gt;The same goes for ASTs. A common example of binary trees in AST is a compiler. Using a simple conditional as an example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight cpp"&gt;&lt;code&gt;&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="n"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;An AST can be thought of as a more elegant expression tree, we can represent the above as:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight cpp"&gt;&lt;code&gt;&lt;span class="n"&gt;ASTNode&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;ifNode&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nf"&gt;ASTNode&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"IfStatement"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="n"&gt;ASTNode&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;condition&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nf"&gt;ASTNode&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"BinaryExpression"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"&amp;gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="n"&gt;condition&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;left&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nf"&gt;ASTNode&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Identifier"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"x"&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;
&lt;span class="n"&gt;condition&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;right&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nf"&gt;ASTNode&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Literal"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"0"&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;

&lt;span class="n"&gt;ASTNode&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;printCall&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nf"&gt;ASTNode&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"CallExpression"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"print"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="n"&gt;printCall&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;left&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nf"&gt;ASTNode&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Identifier"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;"x"&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;

&lt;span class="n"&gt;ifNode&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;left&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;condition&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="n"&gt;ifNode&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="n"&gt;right&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;printCall&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is a &lt;strong&gt;very&lt;/strong&gt; simple representation of the code. As I mentioned above, these data structures are just abstract models to fit data. If we wanted to parse a longer statement like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight cpp"&gt;&lt;code&gt;&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;print&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="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="n"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&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;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We would find a node having more than two children nodes, in which case, it is still a tree structure, but no longer a binary tree.&lt;/p&gt;

&lt;p&gt;We've covered the basics of binary trees, including their structure, implementation in C++, traversal methods, and practical applications in expression evaluation and compiler design. Binary trees are important in programming because they provide an efficient way to organize and search hierarchical data. They form the foundation for more complex tree structures like binary search trees (BSTs) and AVL trees, which are crucial for implementing efficient searching and sorting algorithms. I am still learning about these though and would be documenting my progress along the way.&lt;/p&gt;




&lt;p&gt;That's it for this article! DSA is a very large and interesting field, especially when done with a language like C++. This is because C++ is a language that gives you a high degree of control over memory management (which allows for things to go so wrong) and performance optimization. Understanding these data structures allows you to choose the most efficient ways to organize and access data, while knowledge of algorithms in your arsenal helps you implement the most effective solutions to problems.&lt;/p&gt;

&lt;p&gt;I am currently having fun playing around with multiple algos and structures and then trying to put them into practice in small projects, if you want to follow along or take a peek at my progress, it is available in &lt;a href="https://github.com/ShafSpecs/DSA-CPP" rel="noopener noreferrer"&gt;this repository&lt;/a&gt; with tests too (yes, full test coverage 😁). Speaking of tests, TDD in C++ is very fun, I should write up on that too. Once again, thanks for reading my notes. If you have any corrections or additions for us, feel free to share in the comments. Till next time 👋!&lt;/p&gt;

</description>
      <category>cpp</category>
      <category>algorithms</category>
      <category>dsa</category>
    </item>
    <item>
      <title>Breaking down pointers (in C++)</title>
      <dc:creator>Abdur-Rahman</dc:creator>
      <pubDate>Mon, 01 Jul 2024 18:33:44 +0000</pubDate>
      <link>https://dev.to/shafspecs/breaking-down-pointers-in-c-1ib5</link>
      <guid>https://dev.to/shafspecs/breaking-down-pointers-in-c-1ib5</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;This post was originally posted on &lt;a href="https://shafspecs.hashnode.dev/breaking-down-pointers" rel="noopener noreferrer"&gt;my Hashnode blog&lt;/a&gt;.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;I recently began learning C++ (or CPP), a powerful language built on C. C++ is a language that exposes a lot more than conventional languages like JS, Python and Java. Having worked with weird languages (like Rust) and language for dummies (Golang), a lot of that knowledge was easily transferable to C++. But there were still some grey areas where I didn't fully understand what was happening under the hood. Taking a cue from one of my mentors &lt;a class="mentioned-user" href="https://dev.to/tigerabrodi"&gt;@tigerabrodi&lt;/a&gt;, I am now writing those grey areas as I learn and attempting to simplify them for myself and you, the reader.&lt;/p&gt;

&lt;p&gt;The first concept I would be writing about is &lt;em&gt;pointers&lt;/em&gt;. What are pointers?&lt;/p&gt;

&lt;h2&gt;
  
  
  👉 Pointers
&lt;/h2&gt;

&lt;p&gt;A pointer is a variable that stores the reference to another variable. A variable is named &lt;em&gt;object&lt;/em&gt;. What's an object? An object is a region of memory with a type that specifies what kind of information can be placed in there. The type here refers to &lt;code&gt;int&lt;/code&gt;, &lt;code&gt;double&lt;/code&gt;, &lt;code&gt;char&lt;/code&gt;, etc. Think of an object as a box, where you can only put a certain type of item (jackets, for example). If you label the box, it becomes a &lt;em&gt;variable&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;Pointers are simply what I like to refer to as middlemen or contacts. Using the box analogy from the last paragraph, let's imagine the box is in a room. A pointer would be a person standing in the room and pointing to the box. The room is your computer memory, the location of the box in the room is the address or &lt;em&gt;memory address&lt;/em&gt; of "jacket box" (what we are calling the box), and the person pointing is the pointer.&lt;/p&gt;

&lt;p&gt;We could enter the room and directly head over to the box to get, change or even remove its contents. That is the normal declaration and assignment we are used to.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight cpp"&gt;&lt;code&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;6&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="c1"&gt;// print a&lt;/span&gt;
&lt;span class="n"&gt;std&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="n"&gt;cout&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// 6&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Alternatively, we could head over to the person pointing, and following their direction (the pointing finger), locate the box. Recall what we said earlier? A pointer stores the &lt;em&gt;reference&lt;/em&gt; to another variable. We could also say a pointer stores the &lt;em&gt;memory address&lt;/em&gt; of another variable. Using that, we can also define a pointer as: "A data type that can store memory addresses".&lt;/p&gt;

&lt;p&gt;Going back to the room analogy, one thing to note is that the person pointing to the box is also inside the room. Not outside. It is also a variable stored in memory. Going back to the first definition of pointers, a pointer is an unusual variable. Other variables store a number or a character, a pointer stores the location of another variable!&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight cpp"&gt;&lt;code&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;num&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;8&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;ptr&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;num&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="n"&gt;cout&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;ptr&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;endl&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;cout&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;ptr&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;endl&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In C++, the &lt;code&gt;*&lt;/code&gt; is one of the ways to declare a pointer type. This is interpreted as a variable that would store (point to) the memory address of an &lt;code&gt;int&lt;/code&gt; type. The &lt;code&gt;&amp;amp;num&lt;/code&gt; is a notation to get the memory address of a variable itself. We then printed out &lt;code&gt;ptr&lt;/code&gt;, which would give us a weird string (like &lt;code&gt;0x7ffeee679d4c8&lt;/code&gt;). That weird string is the address of &lt;code&gt;num&lt;/code&gt; in the memory, if we were to head here (whilst the program is running), we would find &lt;code&gt;num&lt;/code&gt;!&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;What happens if we print &lt;code&gt;&amp;amp;num&lt;/code&gt;? It prints out the same memory address as our pointer. That's because the pointer stores the memory address, and the reference operator (&lt;code&gt;&amp;amp;&lt;/code&gt;) also returns the memory address of that variable.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The last line (&lt;code&gt;*ptr&lt;/code&gt;) is called the "dereference operator". Dereferencing is trying to get the value of the memory address pointed to by our pointer. Using the room analogy, instead of just giving me the location of the box, we are asking the person what is stored at that location. In this case, a handful of jackets! Don't forget, the box is the holder of the jacket, it isn't the actual item stored in that location.&lt;/p&gt;

&lt;p&gt;At the start, I also mentioned that pointers are middlemen. What do I mean by that? A pointer isn't tied to what it points to. It can point to something else, or even nothing at all! (Null pointers 👀). Remember, a pointer is a variable that stores the memory address of others. Like any other variable, it can be re-assigned (pointed to something else)&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight cpp"&gt;&lt;code&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;num&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;let&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;20&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="c1"&gt;// ptr initially points to num&lt;/span&gt;
&lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;ptr&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;num&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="c1"&gt;// Reassign ptr to point to let instead&lt;/span&gt;
&lt;span class="n"&gt;ptr&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;let&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  🆚 Pointers vs Reference
&lt;/h2&gt;

&lt;p&gt;Something I tended to gloss over was the difference between a reference declaration and a pointer. They are very similar in what they do but are two very different things.&lt;/p&gt;

&lt;p&gt;What does a reference mean here? A reference is an alias for an already declared variable. Let's re-use the room analogy. A reference would simply be slapping another label on the box. We originally called the box "jacket box", that is the name. A reference is simply a "reference to that variable", let's call it "jacket ref" (short for reference).&lt;/p&gt;

&lt;p&gt;References do not take up additional space in memory. It is simply just an "alias".&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight cpp"&gt;&lt;code&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;num&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="o"&gt;&amp;amp;&lt;/span&gt; &lt;span class="n"&gt;alias&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;num&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;int&amp;amp;&lt;/code&gt; means "a reference to type &lt;code&gt;int&lt;/code&gt;". Notice how we are assigning it to the memory address of &lt;code&gt;num&lt;/code&gt; and not the value of &lt;code&gt;num&lt;/code&gt;. If we were to print out &lt;code&gt;alias&lt;/code&gt; and &lt;code&gt;num&lt;/code&gt;, they would both be 5. If we were to modify the value of &lt;code&gt;alias&lt;/code&gt;, it would modify the value of num as well.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight cpp"&gt;&lt;code&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;num&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="o"&gt;&amp;amp;&lt;/span&gt; &lt;span class="n"&gt;alias&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;num&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="n"&gt;alias&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;cout&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="s"&gt;"Alias is: "&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;alias&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="s"&gt;"&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s"&gt;Num is: "&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;num&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;They would both print 10. Using the room analogy, we just added a second label to the box. If we walked into the room looking for "jacket ref", we would still head over to the same box. So, what would happen to the "jacket box" if we were to change the jackets in the "jacket ref" box? The same thing because they are the same box!&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;By the way, this is the basis of pass-by-reference in languages that utilise it like Java, Rust and C++.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;What about pointers? A pointer can do the same thing&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight cpp"&gt;&lt;code&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;num&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;6&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;ptr&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="n"&gt;num&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="n"&gt;ptr&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;8&lt;/span&gt; &lt;span class="c1"&gt;// num becomes 8&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;OK, what just happened? As we can change the address a pointer stores (points to), we can also change the content of what is stored in that address. Using the same old room analogy, this is the same as the person pointing and reaching over to add, change or remove jackets from the box.&lt;/p&gt;

&lt;p&gt;What are some of the main differences?&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Pointer&lt;/th&gt;
&lt;th&gt;Reference&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;A pointer is a variable stored in memory. It stores the address of another variable&lt;/td&gt;
&lt;td&gt;A reference is an alias for another variable. It's not a new one, just another name for an existing one.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Can be reassigned to point to other &lt;em&gt;objects&lt;/em&gt;.&lt;/td&gt;
&lt;td&gt;Can not be re-assigned to another variable.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Can be null (pointing to nothing)&lt;/td&gt;
&lt;td&gt;Cannot be null. It must be initialized to something.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Pointers have their memory address (they're stored in memory after all)&lt;/td&gt;
&lt;td&gt;References don't occupy any additional space beyond the referenced variable.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;You can have pointers pointing to another (Remember, they are storing memory addresses after all)&lt;/td&gt;
&lt;td&gt;References cannot reference another reference&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Based on the current article, can you figure out what this meme implies 😄&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftp0ctptl0vfub72xns51.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftp0ctptl0vfub72xns51.jpg" alt="Anya keeps pointing!" width="716" height="670"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;p&gt;That's it for this article! I hope to write more as I learn more, blog driven development is a wild, yet effective method of learning and I am committed to putting pen to paper when I have something of note. I am also building simple, public projects on my GitHub using C++, trying to put what I learn into practice, you can check me out &lt;a href="https://github.com/Shafspecs" rel="noopener noreferrer"&gt;@ShafSpecs&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;I also enjoy this analogy and simple writing format. Makes things easier for me when revising notes, hope you enjoyed it too! If you have any tips, comments or corrections, please drop them down below. Till next time 👋!&lt;/p&gt;

</description>
      <category>cpp</category>
      <category>beginners</category>
      <category>programming</category>
      <category>computerscience</category>
    </item>
    <item>
      <title>Remix + Trigger.dev: Match made in Heaven</title>
      <dc:creator>Abdur-Rahman</dc:creator>
      <pubDate>Fri, 29 Sep 2023 20:39:01 +0000</pubDate>
      <link>https://dev.to/shafspecs/remix-triggerdev-match-made-in-heaven-51n1</link>
      <guid>https://dev.to/shafspecs/remix-triggerdev-match-made-in-heaven-51n1</guid>
      <description>&lt;h2&gt;
  
  
  Introduction 🔰
&lt;/h2&gt;

&lt;p&gt;The concept of jobs and long-running jobs within web applications is not a foreign one, indeed a lot of software utilizes various solutions and code snippets and it works. Within the JS ecosystem and Web Development in particular, tools for this are quite scarce, if you didn't want to go the manual route (of doing everything yourself), you didn't have much options. Till Trigger.&lt;/p&gt;

&lt;h2&gt;
  
  
  Breakdown 🛠️
&lt;/h2&gt;

&lt;h3&gt;
  
  
  What's Trigger.dev?
&lt;/h3&gt;

&lt;p&gt;Trigger.dev is a TypeScript framework for background jobs. It allows you to integrate smart webhooks, APIs and long-running tasks into your application with ease.&lt;/p&gt;

&lt;p&gt;I was fortunate to stumble upon Trigger in my quest to build the ultimate Remix PWA stack 👀, and it has been a tool I have been using ever since in a lot of projects.&lt;/p&gt;

&lt;h3&gt;
  
  
  What's special about it?
&lt;/h3&gt;

&lt;p&gt;There are a lot of things about Trigger I am yet to discover myself, but I would highlight some of my main pros for it.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Longevity:&lt;/strong&gt; This means long. In other words, it's support for long-running tasks. I am a fan and advocate of more Progressive Web Apps (PWAs) and one core thing about PWAs is long-running tasks. Tasks that can run even when the app is closed. Trigger is a fantastic complementary tool for that on the server, keeping tasks alive for up to a year if needed!&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Cron Jobs:&lt;/strong&gt; A cron can be simply defined as a task that runs at intervals, think of JavaScript's setInterval on a larger scale. Running Cron Jobs has never been easier with Trigger, truth be told I haven't used it yet (no cause for it yet) but going through the API earlier and comparing it with how I currently handle cron jobs (on some boring server with quite a lot configuration), I am sold in this aspect.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Integrations:&lt;/strong&gt; This is my biggest takeaway from this all, Trigger doesn't just exist in its bubble, it's a platform that focuses on extensibility. Telegram, WhatsApp, OneSignal, Resend, Slack and a lot more can be connected with just a few lines of code and you don't have to worry about it. Deploy it and it runs forever!&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Self-Hosting:&lt;/strong&gt; Edited this article and can't believe I forgot to add this, self-hosting option. As a massive fan of Fly.io and self-deployment (Vercel &amp;amp; Serverless has disappointed me enough), the option to host this incredible tool is a big win for me.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Open-Source:&lt;/strong&gt; Open-Source...yayyy 🎉! Seriously though, Open-Source Software (OSS) is to be celebrated and this is one that also deserves recognition and praise.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Trigger.dev &amp;amp; Remix
&lt;/h3&gt;

&lt;p&gt;Now to the actual topic, Remix and Trigger. What makes them so perfect in my opinion? I will be discussing a few reasons why that is so (my opinions).&lt;/p&gt;

&lt;p&gt;First of all, Remix Resource Routes. A resource route in a Remix application is a route (your normal route) that doesn't return a component. Like an API endpoint. If you've written a controller with Express, that's your app.get() handler, or @Controller annotation in SpringBoot. Trigger in Remix takes advantage of this in Remix and builds itself within a single resource route (mostly /api/trigger) without disrupting your app flow. In short, Trigger builds itself as a part of your app, not a large service you have to plug in a few env keys and download a lot of packages to get it to work.&lt;/p&gt;

&lt;p&gt;As a continuation of that, other Resource routes can integrate seamlessly with Trigger SDK, want to send an email? Create a send-email job in Trigger, create a send-email route and within its action, run (trigger) the job. Need to tell a customer their order is on the way via WhatsApp? No worries, that can be easily handled by creating another job and triggering it at the right time. Creating powerful and smart webhooks in Remix has never been easier!&lt;/p&gt;

&lt;p&gt;I work with Push API a lot as a part of the Remix PWA ecosystem and one thing that must be factored in is consistency; whether offline or online, app opened or closed, the push must be sent and Trigger is an easy tool that helps with that.&lt;/p&gt;

&lt;p&gt;The last point I would make for Remix &amp;amp; Trigger is Trigger Events. Events are triggers that react to an event within your application or another job. I think the best way to visualize this is with examples, if you are creating a fund-raising application for example, and you want to tweet every milestone hit on the user's Twitter account, you simply have an event that triggers whenever the milestones are hit and tweet, tweet! You are now tweeting based on set goals from within your application without extra input.&lt;/p&gt;

&lt;p&gt;There are more I can go into like scheduled jobs and resumability which help ensure consistency within your job runs so you never run the same thing twice. But this would be all 😉&lt;/p&gt;




&lt;p&gt;There's a lot for me to discover within Trigger, I am still at the top layer and it's impressive. Can't wait to dive deeper and see what more is possible with it. I will be writing more about Trigger within the coming months about my discoveries and maybe a trick or two, till then have fun and keep learning 💪. Till next time 👋!&lt;/p&gt;

</description>
      <category>remix</category>
      <category>webdev</category>
      <category>javascript</category>
    </item>
    <item>
      <title>Remix PWA v3.0: A new era</title>
      <dc:creator>Abdur-Rahman</dc:creator>
      <pubDate>Tue, 19 Sep 2023 15:30:12 +0000</pubDate>
      <link>https://dev.to/shafspecs/remix-pwa-v30-a-new-era-48f</link>
      <guid>https://dev.to/shafspecs/remix-pwa-v30-a-new-era-48f</guid>
      <description>&lt;p&gt;Hurray 🎉🎉! We are finally pleased to introduce Remix PWA v3.0 to the world 🌍. &lt;a href="https://remix-pwa.run"&gt;Remix PWA&lt;/a&gt; is a PWA framework for building perfomant, enhanced Progressive Web Applications in &lt;a href="https://remix.run"&gt;Remix&lt;/a&gt;. Remix 💿 is a web framework for building fast, perfomant and gorgeous sites of all scales with ease and no unnecessary abstractions.&lt;/p&gt;

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

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



&lt;/p&gt;

&lt;p&gt;This article will go over what's new in this update (spoiler: &lt;strong&gt;a lot&lt;/strong&gt;), and dive a bit deeper into under-the-hood, our dream of solidifying PWA in Remix; and maybe even native support (who knows?).&lt;/p&gt;

&lt;p&gt;&lt;u&gt;&lt;/u&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Synopsis 🧪
&lt;/h2&gt;



&lt;p&gt;Remix PWA v3.0 is the first real PWA framework (that I know of) built to integrate native PWA enhancements into your web applications. All this is possible thanks to the very fast compiler (powered by esbuild) behind-the-scenes and the separation of concerns pattern we adopted from Remix.&lt;/p&gt;

&lt;p&gt;Remix separates its main build process into two via: &lt;code&gt;@remix-run/dev&lt;/code&gt; and &lt;code&gt;@remix-run/{adapter}&lt;/code&gt;. So it is easy to add adapters on the fly and extend Remix without needing to modify the original compiler. &lt;/p&gt;

&lt;p&gt;Remix PWA follows that approach by separating our compilation process into two parts via: &lt;code&gt;@remix-pwa/dev&lt;/code&gt; and &lt;code&gt;@remix-pwa/{runtime}&lt;/code&gt;. &lt;/p&gt;

&lt;p&gt;&lt;u&gt;&lt;/u&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  What's a Runtime?
&lt;/h3&gt;



&lt;p&gt;Runtime can be defined simply as an internal Service Worker. It is your base of operations, the foundation from which Remix PWA builds any other service worker you provide on top. It's quite the thing.&lt;/p&gt;

&lt;p&gt;Currently, only a basic javascript runtime adapter is provided by Remix PWA (in the form of &lt;code&gt;@remix-pwa/worker-runtime&lt;/code&gt;). Support for other tools like Workbox will be coming along in the coming months.&lt;/p&gt;




&lt;p&gt;Now that we've introduced Remix PWA and defined what runtime is, let's keep digging!&lt;/p&gt;

&lt;p&gt;&lt;u&gt;&lt;/u&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Highlights of the day ✨
&lt;/h2&gt;



&lt;p&gt;A lot of new things came out of this update, to avoid spending all day here reading a documentation, I would drop three highlights to satiate your curiosity (Don't forget to check out &lt;a href="https://remix-pwa.run"&gt;https://remix-pwa.run&lt;/a&gt; too). The main highlights of Remix PWA v3.0 can be surmised as:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A new compiler has been shipped. Building PWAs just became less of a hassle!&lt;/li&gt;
&lt;li&gt;New package lineup. We shipped quite a few new packages to help with scaling your PWA in a very short time.&lt;/li&gt;
&lt;li&gt;Worker Route API: We brought the service worker directly to your routes 😁!&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;u&gt;&lt;/u&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Compiler ⚙️
&lt;/h3&gt;



&lt;p&gt;Remix PWA v3.0 took things up a notch this time by shipping with a compiler. Previously, it was a simple esbuild script that bundled one file from &lt;code&gt;app&lt;/code&gt; to &lt;code&gt;public&lt;/code&gt;. &lt;/p&gt;

&lt;p&gt;With this update, we decided to go all out (what could go wrong?) and just ship a compiler. Not only does it handle building worker files, but you also get the route APIs, global worker &lt;code&gt;context&lt;/code&gt; and more.&lt;/p&gt;

&lt;p&gt;&lt;u&gt;&lt;/u&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  New Packages 📦
&lt;/h3&gt;



&lt;p&gt;Remix PWA v3.0 update wasn't just about building a compiler for Service Workers but building a mini-ecosystem for PWAs in Remix. Say hello to &lt;code&gt;@remix-pwa/sync&lt;/code&gt; (for &lt;a href="https://developer.mozilla.org/en-US/docs/Web/API/Background_Synchronization_API"&gt;Background Sync&lt;/a&gt;), &lt;code&gt;@remix-pwa/cache&lt;/code&gt; (a supercharged framework-agnostic wrapper for &lt;code&gt;Cache&lt;/code&gt; API) and some more. &lt;/p&gt;

&lt;p&gt;Our approach with each of these packages was simple: what is the common solution for x? When we find it, we look at their approach and try to replicate the approach for Remix. Thereby lowering the learning curve substantially and making things more familiar and easy.&lt;/p&gt;

&lt;p&gt;&lt;u&gt;&lt;/u&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Worker Route API 🔥
&lt;/h3&gt;



&lt;p&gt;I could definitely go on and on about this one, this is by far one of the biggest highlights of the Remix PWA v3.0 update.&lt;/p&gt;

&lt;p&gt;Introducing &lt;code&gt;workerLoader&lt;/code&gt; and &lt;code&gt;workerAction&lt;/code&gt;. Two new route APIs that behave like your normal Remix &lt;a href="https://remix.run/docs/en/main/route/loader"&gt;loaders&lt;/a&gt; and &lt;a href="https://remix.run/docs/en/main/route/action"&gt;actions&lt;/a&gt;. Two different handlers that run on the server and handle a route's request.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;workerLoader&lt;/code&gt; and &lt;code&gt;workerAction&lt;/code&gt; run in the worker thread and act as middleware in your route's communication process. It's no longer a direct client -&amp;gt; server relationship but a client -&amp;gt; worker -&amp;gt; server one and it's as powerful as ever!&lt;/p&gt;




&lt;p&gt;That wraps up our highlight ⚡️! There's a whole lot more to unpack and be excited for. Stay tuned for more content and updates. &lt;/p&gt;

&lt;p&gt;At the end of the day, Remix PWA is a firm part of the Remix ecosystem and it's our goal (and dream) that some of what you see released would no longer be in v4.0 because it is already shipped with Remix itself.&lt;/p&gt;




&lt;p&gt;That's the end of this unofficial announcement post. I hope you are as excited as I am for the future of PWA, not just in Remix but on the World Wide Web as a whole. Am I back to consistent writing? I hope so. Anyway, I would leave you with this one to have explore and fun 🤩. Love you all, see you in the next one 👋!&lt;/p&gt;

</description>
      <category>remix</category>
      <category>pwa</category>
      <category>webdev</category>
      <category>javascript</category>
    </item>
    <item>
      <title>Writing as a growth tool</title>
      <dc:creator>Abdur-Rahman</dc:creator>
      <pubDate>Wed, 11 Jan 2023 22:54:26 +0000</pubDate>
      <link>https://dev.to/shafspecs/writing-as-a-growth-tool-34k7</link>
      <guid>https://dev.to/shafspecs/writing-as-a-growth-tool-34k7</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;This post was originally published on my &lt;a href="https://shafspecs.hashnode.dev/writing-as-a-growth-tool"&gt;Hashnode blog!&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;A fact that has been established over and over is that the art of writing is also the art of mental sticking. To save something in your memory longer, you need to jot it down somewhere. I embraced the art of writing as a tool for me to learn last year and my growth has been more steady than before. Let's break it down:&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;u&gt;✍ Writing as an Engineer&lt;/u&gt;
&lt;/h2&gt;

&lt;p&gt;Humans are never perfect, as much as we love perfection in our lives, there is always the element of volatility, the element of uncertainty. This applies to learning as well, if you learn a language and you don't speak it often. You forget it. You cram a user manual but never use the product? You never know how to use the product!&lt;/p&gt;

&lt;p&gt;Whenever we learn something new, we tend to unconsciously tie it to something else in our lives. For example, when we learned the alphabet in school, we were taught to tie it with something ('A for Apple' for example), and this is generally how we store and recall things. Writing is also a way to recall things learnt, so I learned about Docker today and Docker vs Virtualization, I pen it down.&lt;/p&gt;

&lt;p&gt;I don't need to memorize/cram the various concepts and definitions there to recall something. By writing, I am reinforcing what I learned because for I would structure my write-up in such a way that I would understand in the future, hence improving my existing knowledge on the topic.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;u&gt;📢 Writing publicly as an Engineer&lt;/u&gt;
&lt;/h2&gt;

&lt;p&gt;Okay, this one is a bit harder. Writing publicly, or blogging is when we take that write-up we created and put it out there for others to benefit from whatever we learnt. When writing publicly, you are no longer writing just for yourself to understand but for others from multiple nationalities (it's a global village, remember?) to understand you.&lt;/p&gt;

&lt;p&gt;This is where your communication skills come into play, depending on underlying factors, it might be difficult to start or easy. But one thing for sure is that with consistency, you would get better. We can't escape the web of society so our communication key is important in the long run, what better way to improve it than writing to an "audience"?&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;u&gt;📈 Growth as a byproduct&lt;/u&gt;
&lt;/h2&gt;

&lt;p&gt;There is this saying I hear here and there: "If you want to learn something well, teach it". I don't know who said it first but he was darn right! By writing, we reinforce what we already know because fact-checking occurs, also in the process of writing about a topic, we tend to simplify it to encourage easy comprehension, and we also get to discover more about it as we dig deeper into the topic. These are all elements of growth.&lt;/p&gt;

&lt;p&gt;By fact-checking, we stamp out the doubts and realign our thoughts. By simplifying a topic, we present it with a perspective which we might have never thought of. By digging deeper, we learn more hence improving our proficiency. Growth would happen unconsciously, but first, consistency!&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;u&gt;💪 Consistency as a Golden Rule&lt;/u&gt;
&lt;/h2&gt;

&lt;p&gt;Whichever goal you aim to achieve through writing won't come overnight, and this is where the repetition of your writing plays a role. Growth is a gradual process that is cemented slowly over time. To nurture it, we should repeat the act of writing.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;Consistency 🏗 is greater than Intensity 💪&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Especially when starting new, you don't want to bore yourself out too quickly or burn out from too much work. You want to stretch your progress and growth over months instead of weeks, you want writing to become another one of your daily activities, not a chore. Building slowly and progressively always wins, growth is never instantaneous.&lt;/p&gt;




&lt;p&gt;Another article is finished. Thanks a lot for the read, writing has been a skill I started building last year and it's been a pivotal point for me, wanted to share a few tips and insights and maybe convince you to pick up the pencil (or the keyboard) once in a while. You just never know who might open your article. Have fun, bye-bye 👋&lt;/p&gt;

</description>
      <category>writing</category>
      <category>career</category>
      <category>programming</category>
    </item>
    <item>
      <title>One year of Remix: The then, the now &amp; the later</title>
      <dc:creator>Abdur-Rahman</dc:creator>
      <pubDate>Tue, 03 Jan 2023 07:48:37 +0000</pubDate>
      <link>https://dev.to/shafspecs/one-year-of-remix-the-then-the-now-the-later-1986</link>
      <guid>https://dev.to/shafspecs/one-year-of-remix-the-then-the-now-the-later-1986</guid>
      <description>&lt;p&gt;&lt;strong&gt;This article was originally published on Hashnode, check my &lt;a href="https://shafspecs.hashnode.dev/"&gt;blog out&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;It's been approximately one year and one month since Remix v1 was released to the world. Been writing it since then and it has changed a lot of my perceptions and the way I approach writing code altogether. Pouring my thoughts out about this framework, what it's done, how I'm faring and what the future might look like.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;u&gt;The Then:&lt;/u&gt;
&lt;/h2&gt;

&lt;h3&gt;
  
  
  November 2021
&lt;/h3&gt;

&lt;p&gt;I can't exactly recall the date, but I remember waiting for the launch. I had heard a lot of great things from beta testers and was hyped about it. A framework built on web fundamentals and not a clumsy framework called React? I was sold!&lt;/p&gt;

&lt;p&gt;I recall the launch being late, not only due to delays but because the timing was centred around the US timezone, I live in Nigeria and that is at least 6 hours ahead, so it was pretty late. The launch finally happened and I remember skimming the docs that night and playing with some code, this had potential 💪.&lt;/p&gt;

&lt;p&gt;Remix wasn't the greatest it could be, but it was better than the popular option at that time. NextJS. Don't worry, Next is still great but nah, Remix is anytime for me.&lt;/p&gt;

&lt;h3&gt;
  
  
  Early 2022
&lt;/h3&gt;

&lt;p&gt;I had just committed myself to write articles and I wasn't going to miss this one out, not a chance. I built projects and played with different use cases with Remix, and since I wasn't in school or working at the time, I had time on my hands and I didn't let it slide. I also started studying Progressive Web Apps (PWAs) around this time and decided to port the feature over to Remix.&lt;/p&gt;

&lt;p&gt;Thanks to Jacob from the Remix team, I was able to create remix-pwa. A set of scripts to change your application in seconds. It was also my first major contribution to Open-Source, and it was a great feeling.&lt;/p&gt;

&lt;p&gt;Remix taught me a lot, I unlearned around this period too. A couple of wrong practices and a few Udemy courses with a drizzle of YouTube crash courses and you sometimes forget to learn the utmost basics, which I did.&lt;/p&gt;

&lt;p&gt;All I would say is: when I decided to learn Remix, I wasn't learning a framework, I was learning how the Web works.&lt;/p&gt;

&lt;h3&gt;
  
  
  Mid 2022
&lt;/h3&gt;

&lt;p&gt;...Nothing to see here...&lt;/p&gt;

&lt;p&gt;I was deep in school activities...&lt;/p&gt;

&lt;p&gt;Schooling wasn't all that bad for me, it reinforced my knowledge and taught me more.&lt;/p&gt;

&lt;p&gt;I did want to write a complete guide on Remix around this time, but couldn't find a good tool to do so efficiently.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;u&gt;The Now:&lt;/u&gt;
&lt;/h2&gt;

&lt;p&gt;I joined my current company in August. The primary tool for front end was React at the time, good enough. It was a great bastion of knowledge (thanks to all my wonderful colleagues) and I was constantly trying to improve myself. Then I became the Lead Frontend Engineer, and around that time we were changing some of the technology we used. When I mentioned Remix to the team, no persuasion was needed, Remix said it all (Tip: Large react codebases can also be a nightmare)&lt;/p&gt;

&lt;p&gt;I would call myself lucky, I use my favourite web framework at work and home. I have been able to iterate my learning and orientation throughout the year to adapt to some of the things I picked up. Seriously, give Remix a run 💿!&lt;/p&gt;

&lt;p&gt;2023 is knocking and I'm still at it. I write other languages including Java, Golang and Python and being able to build apps with those languages and fuse them with Remix brings me joy and hope for the JavaScript (and web) community. So far, so good.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;u&gt;The Later:&lt;/u&gt;
&lt;/h2&gt;

&lt;p&gt;This is all contemplation and just plans, but over this year, I've seen great tools and frameworks born out of nowhere and witnessing more options is quite pleasing. I have two that come to mind anytime I think of a framework with growth potential:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Sveltekit&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Solid.js&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I won't dive into them in this article but I can defo say that I would be playing around with them more and adopting them into more projects. Seriously, 2023 would be very exciting!&lt;/p&gt;

&lt;p&gt;Remix is a framework that helped accelerate my growth as a Software Engineer, I'm not the only one that says so. Check the the &lt;a href="https://remix.run"&gt;site&lt;/a&gt; for testimonials. Thanks to its community, I also met a lot of like-minded and fun folks there who all helped me in numerous ways. 2022 is the most important year in my programming journey so far, and as weird as it sounds, a single framework was a key player in bringing that to life.&lt;/p&gt;




&lt;p&gt;That's it for this article peeps! It was interesting to pour out my mind and reflect on a framework like Remix. Now I would add a disclaimer to my article; never get attached to a framework because it is so-and-so... instead, adopt it because of what it does. Even though the concept of Remix isn't new altogether, it was a first for me in terms of bringing all these great things under a single umbrella.&lt;/p&gt;

&lt;p&gt;Like programming languages, all these frameworks are tools to achieve a specified objective. They don't necessarily dictate how your program would turn out. Ultimately, that's up to you and your approach to building software. So learning the fundamentals would help even with choosing what tools to use when building.&lt;/p&gt;

&lt;p&gt;That's it for now, hope you enjoyed reading a piece of my mind. Enjoy yourself and have a blast! Keep learning, reading and playing! Till next time 👋&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>discuss</category>
      <category>devjournal</category>
      <category>writing</category>
    </item>
    <item>
      <title>My 2022 in review</title>
      <dc:creator>Abdur-Rahman</dc:creator>
      <pubDate>Mon, 26 Dec 2022 14:18:34 +0000</pubDate>
      <link>https://dev.to/shafspecs/my-2022-in-review-3db9</link>
      <guid>https://dev.to/shafspecs/my-2022-in-review-3db9</guid>
      <description>&lt;p&gt;The year 2022 was and is a year that stood out for me as a programmer and a student. In this article, I hope to go through some of my accomplishments, what I learned and some of my next year's goals. Hopefully, you would get a thing or two out of this, so shall we?&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;u&gt;🔰 The beginning:&lt;/u&gt;
&lt;/h2&gt;

&lt;p&gt;This year started out busy. I had just learned the art of writing and was getting the hang of it. Remix had just released v1 a few days before and I &lt;strong&gt;loved&lt;/strong&gt; it 😍. Due to its simplicity and reliance on the core fundamentals, it was a framework that had come to stay.&lt;/p&gt;

&lt;p&gt;I also made the resolution to write one article a week from the start of this year, and surprisingly, I always did that. Always. Until I didn't.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;u&gt;🏫 Sch...what?!:&lt;/u&gt;
&lt;/h2&gt;

&lt;p&gt;That's right, I went back to school. That was in March, and writing wasn't something I could keep up with. &lt;/p&gt;

&lt;p&gt;A bit about my schooling, it was a Software Engineering program at &lt;a href="https://semicolon.africa/" rel="noopener noreferrer"&gt;Semicolon&lt;/a&gt;. It's a one-year accelerated program and was swell! I joined in March and my weeks just flew by in a blur. It was busy but worth it in my journey. &lt;/p&gt;

&lt;p&gt;I learned a lot during my months there, programming languages, methodologies and much more. Plus the great colleagues I met.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;u&gt;The end?:&lt;/u&gt;
&lt;/h2&gt;

&lt;p&gt;During this year, I was privileged to work at two different companies. The first was a three months contract I did with a non-Nigerian startup. It was a stepping stone for me as a Software Engineer. I learned quite a lot during those three months too. I joined &lt;a href="https://twitter.com/flynaerospace" rel="noopener noreferrer"&gt;NaeroSpace&lt;/a&gt; in August and have been with them since. It was a wild ride cause I joined when it was an early startup and have been with them till it wasn't. &lt;/p&gt;

&lt;p&gt;I'm approaching the end of my course and yes, I am less busy. I hope to pick up the slack and resume my writing. I have one major open-sourced project that I paused maintenance on (&lt;a href="https://github.com/ShafSpecs/remix-pwa" rel="noopener noreferrer"&gt;remix-pwa&lt;/a&gt;), I would be continuing my active maintenance of the package.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;u&gt;🏁 Highlights &amp;amp; Goals:&lt;/u&gt;
&lt;/h2&gt;

&lt;p&gt;I have had a year to learn, fail and try again with Remix 💿. I also learned interesting facts and know-how whilst learning at Semicolon, I would be writing on all these things collectively from next year. I aim to be more diversified and impactful in my writing next year.&lt;/p&gt;

&lt;p&gt;Talking about impact, I love my current job and what we do. In summary, we provide solutions to Africa's problems with aerospace technologies. Over my years writing code, I have crossed paths with engineers at multiple points in their careers and picked up a thing or two from discussions on careers and impact. I would be writing more on careers, career tips and using the skill of programming to make an impact. Stay tuned!&lt;/p&gt;

&lt;p&gt;I love to read about diverse topics. A lot. I definitely would write more on these next year from what I learned from these books. It should be a blast!&lt;/p&gt;

&lt;p&gt;I have been using the Test Driven Development (TDD) approach in a lot of projects I write in other languages. For some reason, I never got the hang of JavaScript testing tools (&lt;em&gt;except Cypress&lt;/em&gt;). I am hoping to pick these technologies up and build more projects with them.&lt;/p&gt;

&lt;p&gt;Finally, I hope to be building more side projects. I have some SaaS in mind for next year (thank you &lt;a class="mentioned-user" href="https://dev.to/tigerabrodi"&gt;@tigerabrodi&lt;/a&gt;) and would announce it if I ever advance on this idea. I build more side-projects, learn more, share them with you dear readers and iterate.&lt;/p&gt;




&lt;p&gt;That's it for now, folks! Hopefully, we would engage more often over the coming weeks to exchange ideas and hold discussions. I would hopefully get back to Twitter despite recent events. It was nice to write again and I would definitely be doing it again. Till next time!&lt;/p&gt;

</description>
      <category>miniscript</category>
      <category>discuss</category>
    </item>
    <item>
      <title>Git: A beginner's guide</title>
      <dc:creator>Abdur-Rahman</dc:creator>
      <pubDate>Fri, 15 Apr 2022 17:28:24 +0000</pubDate>
      <link>https://dev.to/shafspecs/git-a-beginners-guide-5dia</link>
      <guid>https://dev.to/shafspecs/git-a-beginners-guide-5dia</guid>
      <description>&lt;p&gt;Welcome to this week's article peeps 👋, where I would be talking about git, why it's important to you as a developer/engineer and how to get started with it.&lt;/p&gt;

&lt;h2&gt;
  
  
  🔰 &lt;u&gt;Introduction:&lt;/u&gt;
&lt;/h2&gt;

&lt;p&gt;Git is a free and open source distributed version control system designed to handle everything from small to very large projects with speed and efficiency. &lt;em&gt;In short, git is a version control system&lt;/em&gt;. A Version Control System (VCS) is a tool that helps software developers keep track of how their software development projects change over time 🔃.&lt;/p&gt;

&lt;p&gt;Each snapshot or state of the files and folders in a codebase at a given time can be called a "version". Version control systems were created to allow developers a convenient way to create, manage, and share those versions. It allows them to have control over managing the versions of their code as it evolves over time. It also enable collaboration within a team of software developers, without losing or overwriting anyone's work (&lt;em&gt;it prevents intra-company fights and brawls 🔥&lt;/em&gt;) . After a developer makes a set of code changes to one or more files, they tell the version control system to save a representation of those changes.&lt;/p&gt;

&lt;p&gt;In this way, a history of code changes - or versions - is built up as the code evolves. This history is preserved so that all developers, even if they are working in totally different locations, have access to a consistent and up-to-date history of the project. A version control system can also be referred to as a source control system, source code management, version control software, version control tools, or other combinations of these terms.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;Version control discussion sourced from &lt;a href="https://initialcommit.com"&gt;IC&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  🐱 &lt;u&gt;Github:&lt;/u&gt;
&lt;/h2&gt;

&lt;p&gt;First thing to note: &lt;strong&gt;Github is not Git&lt;/strong&gt;! Github is a platform (&lt;em&gt;a service&lt;/em&gt;) used by developers (&lt;em&gt;who use git&lt;/em&gt;) to upload and download resources and source codes. Git is used to connect and interact with Github to download and upload resources. There are other platform aside from Github used for versioning, some of which are GitLab, GitBucket, etc. With over 73 million user base, Github is a very popular and a favorite of many. If you don't have an account yet, head over there and set one up now!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ICwgBSD7--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zuyvbe66m89eogs9hgpd.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ICwgBSD7--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zuyvbe66m89eogs9hgpd.png" alt="Github Profile Page" width="800" height="399"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;A typical Github user's profile page.&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  📩 &lt;u&gt;Installation:&lt;/u&gt;
&lt;/h2&gt;

&lt;p&gt;Head over to &lt;a href="https://git-scm.com/downloads"&gt;Git.com&lt;/a&gt; to download git installer, it can also be installed via the command line but let's do it the easy way 😉.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--PgRGvinE--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/o3m8hb896r698l5wlc81.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--PgRGvinE--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/o3m8hb896r698l5wlc81.png" alt="Git Download Page" width="800" height="318"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After downloading and running the installer, the next thing to do is test that the git installation was successful. Navigate into any folder using the &lt;code&gt;cd&lt;/code&gt; command. Run the command &lt;code&gt;git init&lt;/code&gt;. If you get the message "Initialized empty gi...", voila! you've had a successful installation!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s---us95UCx--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/tmqrn3en8wj613eqvmw8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s---us95UCx--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/tmqrn3en8wj613eqvmw8.png" alt="git init" width="800" height="120"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  🔧 &lt;u&gt;Connecting Git to Github:&lt;/u&gt;
&lt;/h2&gt;

&lt;p&gt;Let's connect our git to github, first, let's configure our name (Github username) and email. Run these two commands:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git config &lt;span class="nt"&gt;--global&lt;/span&gt; user.name &lt;span class="s2"&gt;"Your name here"&lt;/span&gt;
git config &lt;span class="nt"&gt;--global&lt;/span&gt; user.email &lt;span class="s2"&gt;"your_email@example.com"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After that, run the command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ssh-keygen &lt;span class="nt"&gt;-t&lt;/span&gt; rsa &lt;span class="nt"&gt;-C&lt;/span&gt; &lt;span class="s2"&gt;"your_email@example.com"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This creates two files, &lt;code&gt;~/.ssh/id_rsa&lt;/code&gt; and &lt;code&gt;~/.ssh/id_rsa.pub&lt;/code&gt;. On windows, head into your &lt;code&gt;C:/username&lt;/code&gt; folder and look for a folder called &lt;code&gt;.ssh&lt;/code&gt; (&lt;em&gt;You might need to enable "Show hidden files" to see it). On Linux, it would be in your "Home" folder (*also a hidden folder&lt;/em&gt;). Navigate into that folder and open the one called &lt;code&gt;id_rsa.pub&lt;/code&gt;.&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--hfoSBiUJ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dl03n5vxlyrl9inn4vhu.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--hfoSBiUJ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dl03n5vxlyrl9inn4vhu.png" alt="ssh file" width="800" height="422"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You would see a long string of gibberish in there ending with your email, that's good. Head over to Github and go to your settings&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Mj7oLKw7--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/shdu5pwscd7zswxy2z20.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Mj7oLKw7--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/shdu5pwscd7zswxy2z20.png" alt="Settings" width="281" height="728"&gt;&lt;/a&gt;&lt;br&gt;
Head to the "SSH and GPG" keys and click "New SSH Key" in the top right corner. Give your ssh key a name and paste that gibberish in the &lt;code&gt;id_rsa.pub&lt;/code&gt; file. Click "Create key" and head back to your terminal. Run the command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ssh &lt;span class="nt"&gt;-T&lt;/span&gt; git@github.com
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you get a message like: "Hi username, ...". Then, mission successful! &lt;/p&gt;

&lt;h2&gt;
  
  
  🔖 &lt;u&gt;Git Keywords:&lt;/u&gt;
&lt;/h2&gt;

&lt;p&gt;Let's discuss some of the terminologies you would find in the git ecosystem (&lt;em&gt;including GitHub&lt;/em&gt;), after all, you need to be able to speak like a version control master 😄. &lt;em&gt;I would be using&lt;/em&gt; &lt;code&gt;remix-pwa&lt;/code&gt; &lt;em&gt;as an example here&lt;/em&gt;.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Repository:&lt;/strong&gt; A Git repository (also called "repo") tracks and saves the history of all changes made to the files in a Git project. This information is used by online platforms like Github to store, track and display resources (&lt;em&gt;mostly source codes&lt;/em&gt;) in a graphical format.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--nR3BKAKt--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mwsv5jv7di8myj7wtzq2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--nR3BKAKt--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mwsv5jv7di8myj7wtzq2.png" alt="Repository" width="800" height="399"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;A repo example on Github. This can be used to view changes and if needed, reverse those changes. Plus, Github gives a lot more features.&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Branch:&lt;/strong&gt; A branch is a version of the repository that diverges from the main working project. Imagine a project, that has multiple versions that don't interfere with each other and these versions can change independent of the others. A git repo can have several branches.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--n5RiYl3o--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fto5lk18syny0f858ueh.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--n5RiYl3o--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fto5lk18syny0f858ueh.png" alt="Branch" width="800" height="399"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;A branch system in a repo, each of these branches contain different versions of code of a particular project. One benefit here is that I can compare across branches and edit a project's source code without "destroying" the project itself. Think of a project as a tree, and different versions as different branches.&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Fork:&lt;/strong&gt; Fork or forking is a process of duplicating someone else's project (or code) in order to make edits or changes. One of the ethics of being a developer or engineer is to &lt;strong&gt;never&lt;/strong&gt; edit someone else's source code directly, if you wish to make a change, you duplicate that person's code as your own (&lt;em&gt;you fork that person's project&lt;/em&gt;)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--GHPYZsr6--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/nch8ldizr3873wluwp5d.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--GHPYZsr6--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/nch8ldizr3873wluwp5d.png" alt="Fork" width="800" height="93"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;If I wanted to make a change to this person's work, I would fork it then edit, and not edit it directly.&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Pull Request:&lt;/strong&gt; Pull requests (&lt;em&gt;also known as PR&lt;/em&gt;) is the process of trying to &lt;u&gt;merge&lt;/u&gt; to seperate code together. Imagine this scenario, we realized a mistake in someone's code (&lt;em&gt;could be a team member or just an &lt;a href="https://dev.to/shafspecs/how-to-get-started-with-open-source-2ldj"&gt;Open Source&lt;/a&gt; work&lt;/em&gt;) and we want to fix that bug 🐛. The steps we would take would be:&lt;/li&gt;
&lt;li&gt;Fork the project&lt;/li&gt;
&lt;li&gt;Make the changes and fix what we intended&lt;/li&gt;
&lt;li&gt;Open a PR (&lt;em&gt;request the owner of the original project to merge the two codes together&lt;/em&gt;)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--fNF7iKMR--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jvo0fk5wkgavdijzop6m.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--fNF7iKMR--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jvo0fk5wkgavdijzop6m.png" alt="Pull Request" width="800" height="396"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;This is an example of a merged PR. We have two different versions (&lt;/em&gt;&lt;strong&gt;two different branches in this case&lt;/strong&gt;&lt;em&gt;) and we want to combine their content. We open a PR, and then if the change we want to merge is valid (has no bugs or issues), we merge.&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Staging:&lt;/strong&gt; Staging is a used to add files of a working tree (&lt;em&gt;directory&lt;/em&gt;) to a snapshot. This is used to prepare the files for a &lt;u&gt;&lt;em&gt;commit&lt;/em&gt;&lt;/u&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Commit:&lt;/strong&gt; A commit is used to record the changes in the repository. The staging and committing are co-related to each other. Staging allows us to continue in making changes to the repository, and when we want to share these changes to the version control system, committing allows us to record these changes.&lt;br&gt;
Commits are the snapshots of the project. Every commit is recorded in the master branch of the repository. We can recall the commits or revert it to the older version.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Clone:&lt;/strong&gt; Cloning is used to make a copy of the target repository locally or "clone it". If for example, we want a local copy of a repository from GitHub, this tool allows creating a local copy of that repository on your local computer.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Merge:&lt;/strong&gt; Merging is a process to put a forked history back together. It is simply just the merging of two seperate code history into one branch.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Issue:&lt;/strong&gt; An issue is a Github thing (&lt;em&gt;I don't know any other providers that offer it too 😅&lt;/em&gt;) that is used to keep track of bugs, issues, requests and features in a repository. &lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--hG5-AHYo--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ied4ygkvf9avd5uew055.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--hG5-AHYo--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ied4ygkvf9avd5uew055.png" alt="Issues" width="800" height="376"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;An issue example, in this case, there is an issue with using this project that the developer hasn't fixed yet. A user can easily come here and contact the developers directly who can offer solutions, fixes or alternatives.&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Push:&lt;/strong&gt; Pushing is the process of moving (&lt;em&gt;more like copying&lt;/em&gt;) a local repo to a remote repo. A remote repo means a repo stored on the cloud, in a database somewhere. It is used for example, to move code from your computer to github.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That's ten popular keywords used in git and github for you guys 😄, there are a lot more you can read up on by yourself. If you know of anymore and want to share, let's hear it in the comments!&lt;/p&gt;

&lt;h2&gt;
  
  
  📝 &lt;u&gt;Example Time:&lt;/u&gt;
&lt;/h2&gt;

&lt;p&gt;That's enough talk! Let's do a miniature project and implement git in it. Open up your terminal and navigate to a directory (&lt;em&gt;as always, I would be using "Documents"&lt;/em&gt;). Run the command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;mkdir &lt;/span&gt;git-example
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The command &lt;code&gt;mkdir&lt;/code&gt; means "&lt;em&gt;make directory&lt;/em&gt;" and is used to create a directory in the folder we're in (in this case, &lt;em&gt;git-example&lt;/em&gt;). Afterwards, use the &lt;code&gt;cd&lt;/code&gt; command to navigate to the newly created folder. Let's now create the files we would upload to github, as a person with Javascript running in their veins, we would create a very simple js example (&lt;em&gt;don't worry if you don't know js&lt;/em&gt;). Run the command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;touch &lt;/span&gt;example.js
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The command &lt;code&gt;touch&lt;/code&gt; creates that particular file in our current directory, in this case, &lt;code&gt;example.js&lt;/code&gt;. Open up an editor and let's write a very simple conditional statement in 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;const&lt;/span&gt; &lt;span class="nx"&gt;a&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;12&lt;/span&gt;
&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;b&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;13&lt;/span&gt;

&lt;span class="nx"&gt;b&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;12&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;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;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;a and b are equal&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;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="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;a and b are not equal&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;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;this code initializes two variables, a and b with two different numbers (12 and 13). We later assigned 12 to the variable &lt;code&gt;b&lt;/code&gt;. We then had an &lt;code&gt;if&lt;/code&gt; statement, if a is equal to b, then log a message in the console, if not, log a different message. Okay! Let's push to Github!&lt;/p&gt;

&lt;p&gt;Open up your github's repo page and click "New Repository". I would be calling mine "DEV-example", make sure the visibility is set to public (&lt;em&gt;other users would be able to view your source code&lt;/em&gt;). Add a description for your repo and skip the remaining questions and boxes below, click "Create repository".&lt;/p&gt;

&lt;p&gt;Head back to the terminal of your project and run the commands:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git init
git remote add origin &amp;lt;URL-of-the-repo&amp;gt;.git
git add &lt;span class="nb"&gt;.&lt;/span&gt;
git commit &lt;span class="nt"&gt;-m&lt;/span&gt; &lt;span class="s2"&gt;"Initial commit"&lt;/span&gt;
git branch &lt;span class="nt"&gt;-M&lt;/span&gt; main
git push &lt;span class="nt"&gt;-u&lt;/span&gt; origin main
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Let's run through each command, &lt;code&gt;git init&lt;/code&gt; initializes an empty, local repo in your project (&lt;em&gt;a &lt;code&gt;.git&lt;/code&gt; folder&lt;/em&gt;).&lt;/p&gt;

&lt;p&gt;&lt;code&gt;git remote add origin &amp;lt;URL-of-the-repo&amp;gt;.git&lt;/code&gt; is used to tell your local repo the location of the remote repo, where on the cloud are we connecting to, to store our repo.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;git add .&lt;/code&gt; is used for staging, normally, we use &lt;code&gt;git add &amp;lt;name-of-file&amp;gt;&lt;/code&gt; but as a shortcut, you can use &lt;code&gt;.&lt;/code&gt; to stage every file in the directory (&lt;em&gt;except the &lt;code&gt;.git&lt;/code&gt; local folder&lt;/em&gt;). &lt;/p&gt;

&lt;p&gt;&lt;code&gt;git commit -m "Initial commit"&lt;/code&gt; is used to commit our project. The &lt;code&gt;-m&lt;/code&gt; part is called a "flag". Flags are used to pass arguments to a command, in this case, the flag &lt;code&gt;-m&lt;/code&gt; stands for "message" (&lt;strong&gt;Every commit must have a message&lt;/strong&gt;, &lt;em&gt;usually, this should contain a brief description of what your changes consists of or what they do&lt;/em&gt;). The text between the double quotes is the message argument we want to pass to the commit command.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;git branch -M main&lt;/code&gt; is used to change our branch (&lt;em&gt;also known as rebasing&lt;/em&gt;). The &lt;code&gt;-M&lt;/code&gt; flag here means "move" and what it does is "move our current folder content to the branch called 'main'".&lt;/p&gt;

&lt;p&gt;&lt;code&gt;git push -u origin main&lt;/code&gt; is used to push our local changes to our remote repo. The &lt;code&gt;-u&lt;/code&gt; flag is used to track that repo changes (&lt;em&gt;useful when pushing to a remote repo for the first time&lt;/em&gt;). It means "set up an upstream tracker to track changes". &lt;code&gt;origin main&lt;/code&gt; is telling git where to push to, which branch should it push to, in this case, our branch "main".&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--HurdKf4y--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xx4n0hdr3idw49osjzf1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--HurdKf4y--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xx4n0hdr3idw49osjzf1.png" alt="git" width="800" height="373"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;I forgot to authenticate my github and forgot to rebase my repo to main 😅😅&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Head back to your github repo and refresh the page, voila!&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--7PqSFqIn--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6kas0mhmd8qj7thpeylm.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--7PqSFqIn--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6kas0mhmd8qj7thpeylm.png" alt="done" width="800" height="399"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;p&gt;That's it for this week's peeps, I would still try and write as often as I can but it would be an irregular writing schedule 😅. Keep the comments flowing with questions or observations, we would love to hear them. Remember to keep reading, learning, and coding. And don't forget to play now and then! Love you guys, cya in the next article 👋.&lt;/p&gt;

</description>
      <category>git</category>
      <category>github</category>
      <category>beginners</category>
      <category>codenewbie</category>
    </item>
    <item>
      <title>Content creation update</title>
      <dc:creator>Abdur-Rahman</dc:creator>
      <pubDate>Fri, 15 Apr 2022 14:19:34 +0000</pubDate>
      <link>https://dev.to/shafspecs/content-creation-update-1jfm</link>
      <guid>https://dev.to/shafspecs/content-creation-update-1jfm</guid>
      <description>&lt;p&gt;Two weeks and no post, bugs me a lot to be honest, so I decided to write a short post on why and my plan for content creation in the future.&lt;/p&gt;

&lt;p&gt;Finding time to write posts in school is quite hard (&lt;em&gt;any college or uni students should share their coping mechanism&lt;/em&gt; 😄), I am currently studying Software Engineering and it's &lt;strong&gt;intensive&lt;/strong&gt;. If you've heard of &lt;a href="https://www.fullsail.edu/"&gt;Full Sail&lt;/a&gt;, you know what I mean (&lt;em&gt;it is a one-year degree&lt;/em&gt;). I am enjoying it, meeting other devs and just immersing in the tech world, it is an eye opener. On the other hand, things like side project and blogging is getting more and more tasking.&lt;/p&gt;

&lt;p&gt;Now, what are my plans for the future of content creation? I would still write, and I would keep working on courses for &lt;a href="https://freecodecamp.org"&gt;freecodecamp&lt;/a&gt; albeit at a slower pace. So yeah, I broke my "one-article-a-week" streak and I've been working less on my side projects, but no fear! I would still write when I can, post tips every now-and-then and shitpost on Twitter when I can 😆. &lt;/p&gt;




&lt;p&gt;That's it for this post, send your tips and wishes, I'm all ears. Read, learn, code, repeat. Play with open-source, it's a massive opportunity and &lt;strong&gt;don't forget to play and take a break&lt;/strong&gt;. See you guys next time 👋.&lt;/p&gt;

</description>
      <category>discuss</category>
      <category>writing</category>
    </item>
    <item>
      <title>Programming job and a BSc.</title>
      <dc:creator>Abdur-Rahman</dc:creator>
      <pubDate>Sat, 26 Mar 2022 18:50:06 +0000</pubDate>
      <link>https://dev.to/shafspecs/programming-job-and-a-bsc-83o</link>
      <guid>https://dev.to/shafspecs/programming-job-and-a-bsc-83o</guid>
      <description>&lt;p&gt;Welcome to this week's article peeps 👋, we would be talking about "that" degree, getting a job in tech and being a self-taught programmer. First of, what's "that" degree?&lt;br&gt;
That degree is basically Computer Science. Now, you might be wondering how on earth I can give a piece of advice on this when I haven't gone to college and haven't had real work experience. Well in this article, I would be talking about all that, let's get started!&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;u&gt;🎓 How importaant is a BSc?:&lt;/u&gt;
&lt;/h2&gt;

&lt;p&gt;If you thought I was going to talk about a computer science degree being useless, you are wrong. As opposed to some notions, a degree is important and also a person's choice.&lt;/p&gt;

&lt;p&gt;A computer science degree, despite being just a cardboard, is an important part of a developers journey. One very important aspect of every developers journey is networking, network with the right people and everything else could and would fall in place. A second thing is that no knowledge is useless (&lt;em&gt;except if it's Java 🤣, jk&lt;/em&gt;), and would help you at one point or the other. Finally, a degree gives you a little perk when applying for jobs later on...&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;u&gt;❔ Should you get one?&lt;/u&gt;
&lt;/h2&gt;

&lt;p&gt;It's a matter of choice, a degree won't usually help you when it comes to getting jobs (mostly US) but can help secure connections. I would still advise getting a degree. Period.&lt;/p&gt;

&lt;p&gt;So you are a self-taught developer, you want to get a job and establish yourself in tech, technical writing and open source would help you better than a degree in that regard. Speaking from personal experience, I have never applied for a job in my life but receive job offers from referrals on a consistent basis. It's not really about age, so don't berate yourself for being too young or being too old. It's also not about a degree (&lt;em&gt;really&lt;/em&gt;), but more about your mindset and skillset, developing your personal skillset as a developer is another entire topic.&lt;/p&gt;

&lt;p&gt;The world is changing rapidly, and you shouldn't allow job requirements to scare you. Ask the seniors in tech, those requirements don't really stand when you apply for a job, but also remember that failure and rejection would happen. &lt;em&gt;Fail fast, fail often, fail forward&lt;/em&gt;. One more thing, personally I am not going to college, wether for a computer science degree or other.&lt;/p&gt;




&lt;p&gt;That's another week gone, writing huge content has been hard for me nowadays as I have a lot on my hands. Still planning to allocate more time for that, this post is blown wide open for comments and discussions. Would love to chat with you peeps in the comments, and remember, &lt;strong&gt;fail fast, fail often, fail forward&lt;/strong&gt;, you would only learn one more way to not fail. See you guys next week 👋.&lt;/p&gt;

</description>
      <category>discuss</category>
      <category>programming</category>
      <category>beginners</category>
      <category>career</category>
    </item>
    <item>
      <title>Svelte: My thoughts 🤔</title>
      <dc:creator>Abdur-Rahman</dc:creator>
      <pubDate>Sat, 19 Mar 2022 19:49:12 +0000</pubDate>
      <link>https://dev.to/shafspecs/svelte-my-thoughts-2bm</link>
      <guid>https://dev.to/shafspecs/svelte-my-thoughts-2bm</guid>
      <description>&lt;p&gt;Welcome peeps to this week's article where I would be discussing Svelte, the new framework revving to hit the moon with their objectives, objectives I believe is achievable.&lt;/p&gt;

&lt;p&gt;As sourced from the official site, Svelte is &lt;em&gt;a radical new approach to building user interfaces. Whereas traditional frameworks like React and Vue do the bulk of their work in the browser, Svelte shifts that work into a compile step that happens when you build your app.&lt;/em&gt;&lt;br&gt;
&lt;em&gt;Instead of using techniques like virtual DOM diffing, Svelte writes code that surgically updates the DOM when the state of your app changes.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;I played with Svelte and pretty much enjoyed it for a side-project. It's quick, doesn't utilize V-Dom and has an easy syntax. Sveltekit is a svelte framework, a solid one. I don't know much about it since I haven't played with it myself but I do know that it is efficient and Next.js better watch out.&lt;/p&gt;

&lt;p&gt;Is Svelte better than Remix? No in my opinion. Svemix is an unofficial thing though, Svelte + Remix. In my opinion, it is quite inefficient. Use what works best for you though, if Angular appeals to you and delivers, use it. Don't sway for other opinions though, not worth swaying for them. &lt;/p&gt;

&lt;p&gt;Final thought on Svelte, interesting framework with a unique approach compared to React. I am excited for it's future and would keep on using it for small side-projects and playing with it. I think you React devs out there ought to give it a try, a small chance. Might be worth it. See you next time 👋   &lt;/p&gt;

</description>
      <category>webdev</category>
      <category>javascript</category>
      <category>svelte</category>
      <category>discuss</category>
    </item>
    <item>
      <title>How to get started with Open-Source</title>
      <dc:creator>Abdur-Rahman</dc:creator>
      <pubDate>Thu, 10 Mar 2022 07:46:18 +0000</pubDate>
      <link>https://dev.to/shafspecs/how-to-get-started-with-open-source-2ldj</link>
      <guid>https://dev.to/shafspecs/how-to-get-started-with-open-source-2ldj</guid>
      <description>&lt;p&gt;You know you can write some code, you've in fact, written a &lt;strong&gt;LOT&lt;/strong&gt;. You can also recognize typos in files and documentation, and now you want to give something back to the community. So what do you do 🤔? Huh, good question. &lt;/p&gt;

&lt;p&gt;Except you've got the finances, sponsoring the giants that help build our tech world is quite impossible. So, you decide instead that you want to give back by simplifying the learning process for other devs, you want to build softwares and modules that simplify tasks for others, you want to teach the community and make a lot of things easily accessible by others. But you can't 😐.&lt;br&gt;
For starters, you are a shy speaker so you don't want to talk publicly. You also don't understand how to create anything "useful" for the community so you can't create "anything". Your writing creativity is null and more or less, underground. So your solution is to just just sit by the side and wait for the next brave person to give back to the community thinking you won't be able to give anything to the community. &lt;em&gt;Uh uh, I disagree&lt;/em&gt;.&lt;/p&gt;
&lt;h2&gt;
  
  
  &lt;u&gt;🚀 Open Source:&lt;/u&gt;
&lt;/h2&gt;

&lt;p&gt;According to &lt;a href="https://opensource.com"&gt;opensource.com&lt;/a&gt;, Open Source can be defined as: &lt;em&gt;something people can modify and share because its design is publicly accessible&lt;/em&gt;. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://wikipedia.org"&gt;Wikipedia&lt;/a&gt; is even more direct with it's definition which is given as: &lt;em&gt;Open source is source code that is made freely available for possible modification and redistribution. Products include permission to use the source code, design documents, or content of the product&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;The last definition by &lt;a href="https://synopsys.com"&gt;Synopsys&lt;/a&gt; is generalized as: &lt;em&gt;Open source software (OSS) is software that is distributed with its source code, making it available for use, modification, and distribution with its original rights. Source code is the part of software that most computer users don’t ever see; it’s the code computer programmers manipulate to control how a program or application behaves&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;These definitions of Open Source (&lt;em&gt;general definitions&lt;/em&gt;) gives a pretty good idea of what open source is and what I am going to rant about next. &lt;/p&gt;
&lt;h2&gt;
  
  
  &lt;u&gt;🚨 Getting out of "that" mindset:&lt;/u&gt;
&lt;/h2&gt;

&lt;p&gt;Let's be realistic, deciding to get out of your comfort zone to create a project on the "global stage" is something that makes us feel queasy. Not only would your bad code be public to everyone, but you also want others to &lt;em&gt;go through it&lt;/em&gt;, &lt;em&gt;contribute&lt;/em&gt; and even &lt;em&gt;fork and improve it&lt;/em&gt;! &lt;/p&gt;
&lt;h3&gt;
  
  
  ▶ Some things you should know about Open Source:
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;u&gt;&lt;strong&gt;It's not always about creating a new project&lt;/strong&gt;:&lt;/u&gt; Anything, literally anything that adds a single meaning or value is termed Open Source. If you saw a typo in Google's Docs and you create a Pull Request (PR) to fix it, congrats! That's Open Source. Want to create a brand new public framework? That's also Open Source. You don't need to be a &lt;em&gt;guru&lt;/em&gt; to contribute. Heck, I don't even think such things exist in Programming.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;u&gt;&lt;strong&gt;If it can run, it can be public&lt;/strong&gt;:&lt;/u&gt; Do you make all your repos private? I used to do that all the time too. It doesn't help matters at all. Take the leap of faith and start making them public! Except it's a private project that &lt;strong&gt;needs&lt;/strong&gt; discretion, why make it private?&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;u&gt;&lt;strong&gt;Stars don't matter&lt;/strong&gt;:&lt;/u&gt; This might sound funny, but I had this mentality as well and I'm sure a lot of devs have it too.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;GitHub stars doesn't rate the success of an Open Source project!&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;That's important. Keep it in your mind when planning on creating that next public repo. &lt;em&gt;15.5k stars or 3 stars&lt;/em&gt;? Duh, who cares. &lt;em&gt;Open Source is about the satisfaction, not the fame&lt;/em&gt;. &lt;/p&gt;

&lt;p&gt;If you're looking for fame tho, the Show Biz industry might be what you want 😉.&lt;/p&gt;
&lt;h2&gt;
  
  
  &lt;u&gt;Start Contributing!&lt;/u&gt;
&lt;/h2&gt;

&lt;p&gt;It's more of a mindset and less of an activity. You want it to become a reflexive thought, when you see a mistake, you either fix it or create an issue if the problem is beyond you. Make yourself a promise to pick up that mindset from today.&lt;/p&gt;

&lt;p&gt;Okay, you have promised yourself and all. Let's get practical, the first thing I normally tell people looking to contribute is to look out for documentation issues and typos. Remember, humans are always humans and would make awful, hilarious mistakes so your "big fix" might be a wrong module import:&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;// ❌ Wrong importing format&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;React&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;useState&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;useEffect&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="c1"&gt;// ✔ Correct importing format&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;React&lt;/span&gt;&lt;span class="p"&gt;,&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="nx"&gt;useEffect&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;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Or typo:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// ❌ Soo wrong...
..some preloaded some the links 

// ✔ Much better..
..some preloaded links
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you successfully created a PR and it got merged, you have contributed to Open Source 🎉!&lt;/p&gt;

&lt;p&gt;In summary, get out there and start making those PRs!&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;u&gt;🛣 The way beyond:&lt;/u&gt;
&lt;/h2&gt;

&lt;p&gt;So, you have made a lot of PRs and you have scanned codebases and learned a lot of useful practices, you now want to take on a bigger challenge. Create a public repo and start maintaining it! It doesn't have to be a complex CLI npm package meant to hack into human satellites and give you live video feed of Earth. It could even be a SaaS (&lt;strong&gt;S&lt;/strong&gt;&lt;em&gt;oftware&lt;/em&gt; &lt;strong&gt;a&lt;/strong&gt;&lt;em&gt;s&lt;/em&gt; &lt;strong&gt;a&lt;/strong&gt; &lt;strong&gt;S&lt;/strong&gt;&lt;em&gt;ervice&lt;/em&gt;) or a simple "Generate a random number" module. &lt;a href="https://kentcdodds"&gt;Kent C. Dodds&lt;/a&gt; has an awesome &lt;a href="https://egghead.io/courses/how-to-write-an-open-source-javascript-library"&gt;egghead.io course&lt;/a&gt; that shows how to create a basic, open source library. &lt;/p&gt;

&lt;p&gt;Remember, it's nice to be fancy with your projects but not everything needs to be a monumental bang 💥 to be considered Open Source 😝! &lt;/p&gt;




&lt;p&gt;That's it for this week's article peeps, what projects are you building? Have you already gotten into Open Source? If so, share your experience in the comments. I am currently re-building my portfolio with a personal blog (&lt;em&gt;stay tuned for that&lt;/em&gt;), and I should be welcoming you guys there this month, hopefully. I haven't mentioned it here yet, but I recently joined &lt;a href="https://freecodecamp.org"&gt;FreeCodeCamp&lt;/a&gt; as an author and member (&lt;em&gt;YAY&lt;/em&gt; 🙌) and &lt;strong&gt;⚠SPOILER ALERT⚠&lt;/strong&gt;, I'm building that mega Remix course I promised you guys, free and accessible. &lt;/p&gt;

&lt;p&gt;Remember to take breaks and even vacations, read, learn more, push yourself, you can do it 💪. We were all there at some point but only through perseverance did some of us move up and scale our hurdles, you would too, I know that. Enjoy yourself, stay positive and don't forget to play! See you in the next one 👋.&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>opensource</category>
      <category>codenewbie</category>
      <category>webdev</category>
    </item>
  </channel>
</rss>
