<?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: lusayo_ny</title>
    <description>The latest articles on DEV Community by lusayo_ny (@lusayo_ny).</description>
    <link>https://dev.to/lusayo_ny</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%2F648280%2F439a6254-5fab-4a4b-a78f-431a9bba111f.jpeg</url>
      <title>DEV Community: lusayo_ny</title>
      <link>https://dev.to/lusayo_ny</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/lusayo_ny"/>
    <language>en</language>
    <item>
      <title>More Thoughts on My Mental Model for Understanding Data Structures and Algorithms</title>
      <dc:creator>lusayo_ny</dc:creator>
      <pubDate>Sat, 09 Aug 2025 14:48:51 +0000</pubDate>
      <link>https://dev.to/lusayo_ny/more-thoughts-on-my-mental-model-for-understanding-data-structures-and-algorithms-2e90</link>
      <guid>https://dev.to/lusayo_ny/more-thoughts-on-my-mental-model-for-understanding-data-structures-and-algorithms-2e90</guid>
      <description>&lt;p&gt;As the title states, this article is just about my personal thoughts and my mental model on learning and teaching data structures and algorithms. I've written a blog post that covers the same article here &lt;a href="https://projectsayo.hashnode.dev/leap-before-you-look-a-slightly-more-refined-approach-to-algorithmic-techniques%5Bhttps://projectsayo.hashnode.dev/leap-before-you-look-a-slightly-more-refined-approach-to-algorithmic-techniques%5D(https://projectsayo.hashnode.dev/leap-before-you-look-a-slightly-more-refined-approach-to-algorithmic-techniques)" rel="noopener noreferrer"&gt;https://projectsayo.hashnode.dev/leap-before-you-look-a-slightly-more-refined-approach-to-algorithmic-techniques[https://projectsayo.hashnode.dev/leap-before-you-look-a-slightly-more-refined-approach-to-algorithmic-techniques](https://projectsayo.hashnode.dev/leap-before-you-look-a-slightly-more-refined-approach-to-algorithmic-techniques)&lt;/a&gt;. Do feel free to visit the actual blog and maybe subscribe to my newsletter if you're interested in this kind of content, but it's not necessary for you to do so. Hope you enjoy the read.&lt;/p&gt;

&lt;h1&gt;
  
  
  Algorithmic Techniques In a NutShell
&lt;/h1&gt;

&lt;h2&gt;
  
  
  1. Fundamental Operations
&lt;/h2&gt;

&lt;p&gt;These are the basic, atomic actions you perform on data. Think of them as the verbs of algorithms. hey fall into three major categories: Navigation, Querying, and Computation. Let's get into a bit more detail:&lt;/p&gt;

&lt;h3&gt;
  
  
  a. Navigation 🧭
&lt;/h3&gt;

&lt;p&gt;The process of traversing a data structure to visit its elements. This is about movement and access.&lt;/p&gt;

&lt;h4&gt;
  
  
  i. Linear Navigation
&lt;/h4&gt;

&lt;p&gt;Moving sequentially through elements.&lt;/p&gt;

&lt;h5&gt;
  
  
  1. Single-Pointer
&lt;/h5&gt;

&lt;p&gt;Using a single index or reference to move one element at a time (e.g., for loop on an array).&lt;/p&gt;

&lt;h5&gt;
  
  
  2. Multi-Pointer
&lt;/h5&gt;

&lt;p&gt;Using two or more indices or references to move through the data simultaneously. A classic example of this is the two-pointer technique used in arrays to examine them from opposite directions for a specific condition. Another example is the use of fast and slow pointers in a linked list to detect a cycle or find the middle element. Other examples include low and high indices in a binary search.&lt;/p&gt;

&lt;h4&gt;
  
  
  ii. Non-Linear Navigation.
&lt;/h4&gt;

&lt;p&gt;Moving through hierarchical or networked structures.&lt;/p&gt;

&lt;h5&gt;
  
  
  1. Hierarchical Traversal
&lt;/h5&gt;

&lt;p&gt;Moving between a parent and its children (e.g., traversing a tree). This is the underlying principle for algorithms like Depth-First Search (DFS) and Breadth-First Search (BFS), which use auxiliary data structures to manage the order of traversal.&lt;/p&gt;

&lt;h5&gt;
  
  
  2. Network Traversal
&lt;/h5&gt;

&lt;p&gt;Moving between interconnected nodes in a graph. The key here is that a node can have multiple neighbors without a strict parent-child relationship.&lt;/p&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Examples: Algorithms like Breadth-First Search (BFS) and Depth-First Search (DFS) are strategies that use a queue or stack (auxiliary data structures) to manage the exploration order, ensuring all nodes are visited even in the presence of cycles.&lt;br&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h3&gt;
&lt;br&gt;
  &lt;br&gt;
  &lt;br&gt;
  b. Querying 🔎&lt;br&gt;
&lt;/h3&gt;

&lt;p&gt;The act of asking a question about the data and getting an answer about the structure of the ADT itself, often a boolean or a specific value.&lt;/p&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Examples: contains(element), isEmpty(), size(), min(), max(), elementAt(index), subset(start:finish). These are operations that inspect the data without changing it.&lt;br&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h3&gt;
&lt;br&gt;
  &lt;br&gt;
  &lt;br&gt;
  c. Computation ⚙️&lt;br&gt;
&lt;/h3&gt;

&lt;p&gt;The process of deriving a new value or a new data structure from the existing data. We can break this down based on how the computation's logic is determined.&lt;/p&gt;

&lt;h4&gt;
  
  
  i. Primitive Computation
&lt;/h4&gt;

&lt;p&gt;This is the most foundational form of computation. It uses the computer's circuitry to perform basic mathematical operations and logical comparisons. All other forms of computation are built on these primitives. From the perspective of a programmer, it's things the computer just knows how to do, it's low level, and we don't question it.&lt;/p&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Examples: Arithmetic operations (+, -, *, /), logical operations (AND, OR, NOT), and comparisons (=, &amp;lt;, &amp;gt;): i.e. 1 + 1 = 2, True AND False = False, etc.&lt;br&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h4&gt;
&lt;br&gt;
  &lt;br&gt;
  &lt;br&gt;
  ii. Algorithmic Computation&lt;br&gt;
&lt;/h4&gt;

&lt;p&gt;This is a computation technique where we as programmers define a fixed, predetermined set of steps to produce a result. The logic is straightforward and doesn't involve a complex decision-making process at each step.&lt;/p&gt;

&lt;p&gt;Examples: sum(array), average(array), merge(list1, list2). The instructions are clear and the same every time.&lt;/p&gt;

&lt;h4&gt;
  
  
  iii. Heuristic Computation
&lt;/h4&gt;

&lt;p&gt;This is a computation techniques that involves a navigating a data structure and executing some decision-making process at each step to determine whether or not to change the result of the computation. The algorithm doesn't just follow a fixed script and gives a deterministic answer; it makes a choice based on a specific rule or heuristic. General subcategories of this include:&lt;/p&gt;

&lt;h5&gt;
  
  
  1. Greedy algorithms.
&lt;/h5&gt;

&lt;p&gt;This is a type of heuristic computation that, at each step, makes the choice that looks best at the moment, without considering the global outcome. A good example is Dijkstra's algorithm for finding the shortest path; at each step, the algorithm's heuristic is to choose the unvisited node with the smallest known distance from the starting node. This is a locally optimal choice that is assumed to lead to the overall shortest path. Another example is the sum of consecutive positive differences solution to determine the maximum possible profit in the buy-low sell-high problem.&lt;/p&gt;

&lt;h5&gt;
  
  
  2. Simulated Annealing 🌡️
&lt;/h5&gt;

&lt;p&gt;This heuristic is inspired by the metallurgical process of annealing, where a metal is heated and slowly cooled to reduce defects.&lt;/p&gt;

&lt;p&gt;How it Works: The algorithm starts with a random solution and iteratively makes small, random changes. It always accepts changes that improve the solution. However, it also accepts changes that worsen the solution with a certain probability, which decreases over time (like the cooling process). This "worse-case" acceptance allows the algorithm to escape local optima and explore a wider range of possible solutions.&lt;/p&gt;

&lt;h5&gt;
  
  
  3. Genetic Algorithms 🌱
&lt;/h5&gt;

&lt;p&gt;This heuristic is inspired by the process of natural selection and evolution.&lt;/p&gt;

&lt;p&gt;How it Works: The algorithm maintains a "population" of potential solutions. In each generation, it selects the best-performing solutions, which then "reproduce" (combine) and "mutate" (randomly change) to create new, diverse solutions for the next generation. This process continues until a satisfactory solution is found.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Implementation Strategies for Querying, Computation, and Navigation
&lt;/h2&gt;

&lt;p&gt;These are the actual strategies that we use when writing implementations for algorithms. Think of them as high-level strategies, with some well-known techniques for performing queries, computing values, or navigating a data structure.&lt;/p&gt;

&lt;p&gt;There are generally three techniques to implementing complex algorithms on data structures: Simple operations using stored properties of the data structure, using precomputation, and using iterative refinement. Let's get into a bit more detail about what we mean:&lt;/p&gt;

&lt;h3&gt;
  
  
  a. Stored properties
&lt;/h3&gt;

&lt;p&gt;This strategy leverages the data structure's known pre-defined properties to perform a query or computation.&lt;/p&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Example: The size of an array, the head of a linked list, the "next" pointer of a linked list node, etc. Also getting the pointer for a particular index of the array using pointer arithmetic could be an example (because we know the array's size, and we know the index of the element we want, and the size of each individual element slot, so we can calculate the pointer of the element we want to fetch).&lt;br&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h3&gt;
&lt;br&gt;
  &lt;br&gt;
  &lt;br&gt;
  b. Precomputation ✨&lt;br&gt;
&lt;/h3&gt;

&lt;p&gt;The strategy of navigating through your data structure in an initial pass to make a new, different, and optimized ADT that you will then use for further processing.&lt;/p&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Example: Creating a hash table from a list of keys to enable near-constant-time queries. Another example is building a prefix sum array to allow for constant-time range sum queries. The act of creating the new data structure is the precomputation. Intervals also fall within this category. The intervals problem is a class of problems often solved by sorting the intervals (a form of precomputation) and then iterating through them to merge or find overlaps.&lt;br&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h3&gt;
&lt;br&gt;
  &lt;br&gt;
  &lt;br&gt;
  c. Iterative Refinement 🔬&lt;br&gt;
&lt;/h3&gt;

&lt;p&gt;This is a problem-solving strategy where you repeatedly apply computations on small portions of your dataset to narrow down a solution. It only operates on the ADT in question and uses some data structure to store intermediate results. It falls into two major implementation categories:&lt;/p&gt;

&lt;h4&gt;
  
  
  i. Iterative Method (Looping)
&lt;/h4&gt;

&lt;p&gt;This is where you use a standard loop to repeatedly refine the solution. Intermediate results or the state of the algorithm are stored explicitly by you in standard variables or data structures like arrays, queues, or hash maps. This approach gives you full control over the state management.&lt;/p&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Example: A Binary Search implemented with a while loop. The intermediate results are just the low and high variables, which you explicitly update in each iteration. Another example is a sliding window where the intermediate results are stored in a simple primitive variable.&lt;br&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h4&gt;
&lt;br&gt;
  &lt;br&gt;
  &lt;br&gt;
  ii. Recursive Method&lt;br&gt;
&lt;/h4&gt;

&lt;p&gt;This technique solves a problem by breaking it down into smaller, similar subproblems. Instead of using a loop, it relies on repeated function calls to manage the state. The intermediate results for each function call are automatically stored on the call stack, a stack-based data structure that is managed by the system.&lt;/p&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Example: A recursive implementation of Binary Search or a Depth-First Search (DFS) traversal. Each function call pushes a new frame onto the call stack, effectively caching the state of that particular subproblem.&lt;br&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h2&gt;
&lt;br&gt;
  &lt;br&gt;
  &lt;br&gt;
  The 16 Common Interview Questions Explained Using This Mental Model&lt;br&gt;
&lt;/h2&gt;

&lt;p&gt;Now that we've gotten this far, we can try to apply this mental model to think about the 16 categories of common data structures and algorithms questions in interviews.&lt;/p&gt;

&lt;h3&gt;
  
  
  Arrays, Strings, and Linked Lists
&lt;/h3&gt;

&lt;p&gt;These are your foundational data models. Their primary operations are Linear Navigation (single-pointer, multi-pointer) and Querying (e.g., elementAt(index), isEmpty()).&lt;/p&gt;

&lt;h3&gt;
  
  
  Stacks and Queues
&lt;/h3&gt;

&lt;p&gt;These are abstract data types with specific constraints on access. Their operations (push, pop, enqueue, dequeue) are a form of limited Linear Navigation.&lt;/p&gt;

&lt;h3&gt;
  
  
  Hash Maps and Hash Sets
&lt;/h3&gt;

&lt;p&gt;These use Precomputation (hashing) to enable extremely fast Querying (contains, get) and Computation (insert, remove).&lt;/p&gt;

&lt;h3&gt;
  
  
  Trees and Graphs
&lt;/h3&gt;

&lt;p&gt;These are the ADTs that are the primary subject of Non-Linear Navigation (hierarchical and network traversal). Algorithms like DFS and BFS are the strategies that implement this navigation.&lt;/p&gt;

&lt;h3&gt;
  
  
  Sorting Algorithms (e.g., Merge Sort, Quick Sort)
&lt;/h3&gt;

&lt;p&gt;These are examples of Computation. They take an unsorted data structure and produce a new, sorted one. The underlying process often uses Multi-Pointer Navigation and Precomputation (e.g., Merge Sort splits the list into halves, which is a form of precomputation).&lt;/p&gt;

&lt;h3&gt;
  
  
  Binary Search
&lt;/h3&gt;

&lt;p&gt;This is a classic example of Iterative Refinement. It uses Multi-Pointer Navigation and Querying to repeatedly reduce the search space by half.&lt;/p&gt;

&lt;h3&gt;
  
  
  Recursion
&lt;/h3&gt;

&lt;p&gt;This is a special programming technique for implementing algorithmic strategies like Iterative Refinement and Non-Linear Navigation. It enables a solution by breaking a problem down into smaller, similar subproblems.&lt;/p&gt;

&lt;p&gt;Instead of explicitly managing state with a loop, recursion relies on the call stack, a system-managed stack-based data structure, to implicitly cache intermediate results.&lt;/p&gt;

&lt;h4&gt;
  
  
  i. Application of Recursion in Iterative Refinement
&lt;/h4&gt;

&lt;p&gt;Recursion is a method for implementing the Iterative Refinement strategy. It solves a problem by repeatedly applying a function to smaller portions of the dataset.&lt;/p&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Example: A recursive Binary Search is an example of iterative refinement. The search space is continually narrowed, and the state of each subproblem (the low and high indices) is implicitly stored on the call stack.&lt;br&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h4&gt;
&lt;br&gt;
  &lt;br&gt;
  &lt;br&gt;
  ii. Application of Recursion in Non-Linear Navigation&lt;br&gt;
&lt;/h4&gt;

&lt;p&gt;Recursion is a natural and common way to implement Non-Linear Navigation on hierarchical data structures.&lt;/p&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Example: A recursive Depth-First Search (DFS) uses recursion to traverse a tree or graph. The call stack manages the path and allows the algorithm to backtrack to previous nodes, which is the core of DFS.&lt;br&gt;
&lt;/code&gt;&lt;/pre&gt;

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

&lt;p&gt;Heaps are a great example of Precomputation. Building a heap from an array is a precomputation step that enables a fast Query (peek) and a specific Computation (extractMin).&lt;/p&gt;

&lt;h3&gt;
  
  
  Prefix Sums and Intervals
&lt;/h3&gt;

&lt;p&gt;Prefix Sums are a perfect example of a Precomputation technique to build an intermediate array for future queries. Intervals are also a good example of precomputation that uses a combination of sorting (another precomputation) and multi-pointer navigation techniques.&lt;/p&gt;

&lt;h3&gt;
  
  
  Two-Pointer and Fast-and-Slow Pointer Techniques
&lt;/h3&gt;

&lt;p&gt;These are classic examples of multi-pointer navigation for linear data structures. Both techniques use two or more indices or references to traverse the data simultaneously.&lt;/p&gt;

&lt;h4&gt;
  
  
  a. Two-Pointer Technique 🤝
&lt;/h4&gt;

&lt;p&gt;This is a general technique often used on indexed data structures like arrays or strings. The pointers can move in the same direction (e.g., to find a subarray) or opposite directions (e.g., to find a pair of elements that meet a certain condition).&lt;/p&gt;

&lt;h4&gt;
  
  
  b. Fast-and-Slow Pointer Technique 🐇🐢:
&lt;/h4&gt;

&lt;p&gt;This is a specialized variation typically used on pointer-based data structures like linked lists. The pointers move at different speeds (e.g., one moves two steps for every one step of the other). This speed difference allows them to be in different positions relative to each other after the same number of iterations. It's particularly useful for solving problems that don't require knowing the total length of the list, such as detecting a cycle, finding the middle element, or finding the k &lt;br&gt;
th node from the end.&lt;/p&gt;

&lt;h3&gt;
  
  
  Sliding Windows
&lt;/h3&gt;

&lt;p&gt;The Sliding Window technique fits neatly into Iterative Refinement because it's a looping method that repeatedly applies computations on a small, moving portion of a dataset.&lt;/p&gt;

&lt;h3&gt;
  
  
  Dynamic Programming.
&lt;/h3&gt;

&lt;p&gt;This is a powerful form of Precomputation and Iterative Refinement. It involves solving a problem by breaking it down into subproblems and storing the results of these subproblems in an intermediary data structure (often an array or hash map) to avoid re-computation.&lt;/p&gt;

&lt;h3&gt;
  
  
  Greedy Algorithms.
&lt;/h3&gt;

&lt;p&gt;A greedy algorithm is a great example of a Heuristic Computation. It's a strategy that makes a locally optimal choice at each step while navigating a data structure, with the hope of finding a globally optimal solution.&lt;/p&gt;

&lt;p&gt;This strategy relies on a combination of fundamental operations:&lt;/p&gt;

&lt;p&gt;Querying: It heavily uses querying to evaluate the available options at a given state (e.g., finding the minimum or maximum element, or the cheapest edge).&lt;/p&gt;

&lt;p&gt;Computation: It performs a computation to make the optimal choice based on a specific heuristic.&lt;/p&gt;

&lt;h3&gt;
  
  
  Backtracking.
&lt;/h3&gt;

&lt;p&gt;This is a strategy that uses a form of Non-Linear Navigation. It explores a search space by trying to build a solution incrementally. If a path leads to a dead end, it "backtracks" to a previous state and tries a different path. This is often implemented with recursion and a stack (a form of Precomputation with an auxiliary data structure).&lt;/p&gt;

</description>
      <category>datastructures</category>
      <category>algorithms</category>
      <category>interview</category>
      <category>learning</category>
    </item>
    <item>
      <title>Leap Before You Look - An Alternative Mental Model to Data Structures and Algorithms</title>
      <dc:creator>lusayo_ny</dc:creator>
      <pubDate>Sat, 09 Aug 2025 04:21:26 +0000</pubDate>
      <link>https://dev.to/lusayo_ny/leap-before-you-look-an-alternative-mental-model-to-data-structures-and-algorithms-3b2m</link>
      <guid>https://dev.to/lusayo_ny/leap-before-you-look-an-alternative-mental-model-to-data-structures-and-algorithms-3b2m</guid>
      <description>&lt;p&gt;Like the title says, this article is going to be about an alternative mental model to learning about and possibly teaching data structures and algorithms. The reason I'm writing it is out of a personal gripe of mine, so allow me to tell you a bit about myself first. If you want to skip that though, you can go sthreat to “The Mental Model”.&lt;/p&gt;

&lt;p&gt;Like many developers in today's landscape, I did not go through a formal education in computer science. I went to college for management information systems for a few years, barely did any math and/or theoretical programming classes, and was thrust into the world of systems administration. After about 2 years of that, I got laid off and decided instead of looking for another job in that field, I'd focus on trying to do what I always wanted to do - code for a living. I coded everyday, picked up django and react, applied for as many jobs as I could and after about 8 months, I finally got myself a job. After about 4 years of basically hovering around the same level in terms of salary, I wanted to get a better job, but found that the types of jobs that paid what I wanted to be paid required an interview process that I dreaded - what people today would call the "FAANG interview." Basically, an interview process that involves a good understanding of data structures and algorithms which I've always hesitated to really pick up.&lt;/p&gt;

&lt;p&gt;When you're not formally trained, data structures and algorithms can be a very intimidating topic. Sure, there's lots of materials to learn online, and lots of free courses and books that offer university-level courses on them. However, that's kind of the problem - that they try to provide "university-level" style teaching, when not everyone needs to learn them in a university context.&lt;/p&gt;

&lt;p&gt;For the working man (or woman) with limited time who last cracked open a math textbook half a decade ago, a more intuitive, get-into-details-later approach is necessary to introduce data structures and algorithms. Basically we need to "leap" into developing an intuition for solving problems using data structures and algorithms before spending time "looking" at how to analyze or even design them.&lt;/p&gt;

&lt;p&gt;To this end, as I was studying data structures and algorithms for myself, I found I've developed a bit of a mental model that allows me to think about data structures and algorithms in a way that I think makes them more intuitive to understand. And I'm writing this article to share that approach to anyone who might be interested.&lt;/p&gt;

&lt;p&gt;The Mental Model&lt;/p&gt;

&lt;p&gt;For me, it helps to look at data structures and algorithms using a conceptual framework that I'd like to call the Index-Pointer approach. It's a fun little re-classification of the concepts related to the study of data structures and algorithms. Basically, every concept related to data structures can be organized starting from the concept of indexes and pointers, and we’ll build on these definitions.&lt;/p&gt;

&lt;p&gt;The mental model I have organizes understanding data structures and algorithms in three phases:&lt;/p&gt;

&lt;p&gt;Foundational Data Models&lt;/p&gt;

&lt;p&gt;Abstract Data Types&lt;/p&gt;

&lt;p&gt;Algorithmic Techniques&lt;/p&gt;

&lt;p&gt;These three serve as the building blocks for the way I understand data structures and algorithms and the way that I would teach someone if I had to tutor them. Let's get into what each of these actually mean.&lt;/p&gt;

&lt;p&gt;Foundational Data Models&lt;/p&gt;

&lt;p&gt;So first things we need to define what exactly is a "Data Structure". For my mental model, a "Data Structure" is a way of grouping related items in a way a computer can understand.&lt;/p&gt;

&lt;p&gt;There are fundamentally two ways of grouping related items, which is what I mean when I say "Foundational Data Models". These data models are:&lt;/p&gt;

&lt;p&gt;a. Index-based data models - A data model where you can know its exact size without looking at the data. You can use the data model’s preconfigured size, and known properties about its elements to infer the position of its elements.&lt;/p&gt;

&lt;p&gt;A good example is the number of seats on a plane. You know exactly how many there are before you know how many people are actually on the plane because the plane itself is designed to have a fixed number of seats.&lt;/p&gt;

&lt;p&gt;b. Pointer-based data models - A data model where you do not know its exact size until you look at all the elements in the data model. You can only use the elements themselves to infer the positions of other elements.&lt;/p&gt;

&lt;p&gt;A good example is the number of people in, say, two generations of a family tree. You cannot know the number until you quantify how many children and siblings each individual member has. Based on those two core data models, we can then talk about the traditional data structures that we know of.&lt;/p&gt;

&lt;p&gt;Abstract Data Types&lt;/p&gt;

&lt;p&gt;Now, based on those two core data models, we can now start defining abstract data types.&lt;/p&gt;

&lt;p&gt;Abstract data types are basically representations of a group of items that have logical constraints on the way the items or ordered and a contract for how to access and manipulate their individual elements.&lt;/p&gt;

&lt;p&gt;They are independent of the actual data model that's used to implement them. Of these, we have the examples:&lt;/p&gt;

&lt;p&gt;Array&lt;/p&gt;

&lt;p&gt;In normal computer science, maybe this isn't considered an ADT, but for this framework it is. An array is an ADT that defines the contract for a fixed-size collection of elements, where each element is identified by an index.&lt;/p&gt;

&lt;p&gt;size() -&amp;gt; Get the number of elements in the array.&lt;/p&gt;

&lt;p&gt;insertAt(index, element) -&amp;gt; Insert an element at a specific index. This operation may replace an existing element.&lt;/p&gt;

&lt;p&gt;elementAt(index) -&amp;gt; Retrieve the element at a specific index.&lt;/p&gt;

&lt;p&gt;removeAt(index) -&amp;gt; Remove the element at a specific index.&lt;/p&gt;

&lt;p&gt;Hash Map A Hash Map is an ADT that defines the contract for a collection of key-value pairs. It uses a hashing function to map keys to specific locations, allowing for very fast insertion and retrieval.&lt;/p&gt;

&lt;p&gt;size() -&amp;gt; Get the number of key-value pairs stored in the map.&lt;/p&gt;

&lt;p&gt;insert(key, value) -&amp;gt; Insert a key and its associated value into the map. If the key already exists, its value is updated.&lt;/p&gt;

&lt;p&gt;get(key) -&amp;gt; Retrieve the value associated with a specific key.&lt;/p&gt;

&lt;p&gt;remove(key) -&amp;gt; Remove a key and its associated value from the map.&lt;/p&gt;

&lt;p&gt;containsKey(key) -&amp;gt; Check if a given key exists in the map.&lt;/p&gt;

&lt;p&gt;isEmpty() -&amp;gt; Check if the map has any key-value pairs.&lt;/p&gt;

&lt;p&gt;Stack An ADT that defines the contract for a collection of elements with a Last-In, First-Out (LIFO) access pattern.&lt;/p&gt;

&lt;p&gt;push(element) -&amp;gt; Add an element to the top of the stack.&lt;/p&gt;

&lt;p&gt;pop() -&amp;gt; Remove and return the element at the top of the stack.&lt;/p&gt;

&lt;p&gt;peek() -&amp;gt; Return the element at the top of the stack without removing it.&lt;/p&gt;

&lt;p&gt;isEmpty() -&amp;gt; Check if the stack is empty.&lt;/p&gt;

&lt;p&gt;Queue An ADT that defines the contract for a collection of elements with a First-In, First-Out (FIFO) access pattern.&lt;/p&gt;

&lt;p&gt;enqueue(element) -&amp;gt; Add an element to the back (or tail) of the queue.&lt;/p&gt;

&lt;p&gt;dequeue() -&amp;gt; Remove and return the element from the front (or head) of the queue.&lt;/p&gt;

&lt;p&gt;peek() -&amp;gt; Return the element from the front of the queue without removing it.&lt;/p&gt;

&lt;p&gt;isEmpty() -&amp;gt; Check if the queue is empty.&lt;/p&gt;

&lt;p&gt;Linked List An ADT that defines the contract for a sequence of elements where each element points to the next one. This ADT can be implemented using either a singly or doubly linked list model.&lt;/p&gt;

&lt;p&gt;insertFirst(element) -&amp;gt; Add an element to the beginning of the list.&lt;/p&gt;

&lt;p&gt;insertLast(element) -&amp;gt; Add an element to the end of the list.&lt;/p&gt;

&lt;p&gt;removeFirst() -&amp;gt; Remove and return the element at the beginning of the list.&lt;/p&gt;

&lt;p&gt;removeLast() -&amp;gt; Remove and return the element at the end of the list.&lt;/p&gt;

&lt;p&gt;size() -&amp;gt; Get the number of elements in the list.&lt;/p&gt;

&lt;p&gt;isEmpty() -&amp;gt; Check if the list is empty.&lt;/p&gt;

&lt;p&gt;Tree An ADT that defines the contract for a hierarchical data structure with a root node and child nodes. A tree has no cycles and a single path between any two nodes.&lt;/p&gt;

&lt;p&gt;insert(element) -&amp;gt; Add an element to the tree in the correct position based on its value (for a Binary Search Tree) or a specific constraint.&lt;/p&gt;

&lt;p&gt;remove(element) -&amp;gt; Remove an element from the tree.&lt;/p&gt;

&lt;p&gt;search(element) -&amp;gt; Find and return a node containing the specified element.&lt;/p&gt;

&lt;p&gt;traverse() -&amp;gt; Visit all nodes in the tree in a specific order (e.g., in-order, pre-order, post-order).&lt;/p&gt;

&lt;p&gt;Graph An ADT that defines the contract for a collection of nodes (vertices) and the connections (edges) between them. Unlike a tree, a graph can contain cycles.&lt;/p&gt;

&lt;p&gt;addVertex(vertex) -&amp;gt; Add a vertex to the graph.&lt;/p&gt;

&lt;p&gt;addEdge(from, to) -&amp;gt; Add an edge connecting a from vertex to a to vertex. This can be a directed or undirected edge.&lt;/p&gt;

&lt;p&gt;removeVertex(vertex) -&amp;gt; Remove a vertex and all associated edges from the graph.&lt;/p&gt;

&lt;p&gt;removeEdge(from, to) -&amp;gt; Remove the edge connecting the from and to vertices.&lt;/p&gt;

&lt;p&gt;hasPath(from, to) -&amp;gt; Determine if a path exists between two vertices.&lt;/p&gt;

&lt;p&gt;Heap A Heap is an ADT that defines the contract for a specialized tree-based data structure where the parent node is either always greater than or equal to (a Max-Heap) or less than or equal to (a Min-Heap) its children.&lt;/p&gt;

&lt;p&gt;The heap is special because its underlying logical structure as a "complete" binary tree allows it to be efficiently implemented using an index-based data structure, like an array, even though its conceptual contract is pointer-based.&lt;/p&gt;

&lt;p&gt;insert(element) -&amp;gt; Add an element to the heap and rebalance it.&lt;/p&gt;

&lt;p&gt;peek() -&amp;gt; Return the root element of the heap (the maximum in a Max-Heap or the minimum in a Min-Heap) without removing it.&lt;/p&gt;

&lt;p&gt;extractMax() or extractMin() -&amp;gt; Remove and return the root element of the heap, then reorganize the heap to maintain the heap invariant.&lt;/p&gt;

&lt;p&gt;isEmpty() -&amp;gt; Check if the heap has any elements.&lt;/p&gt;

&lt;p&gt;size() -&amp;gt; Get the number of elements in the heap.&lt;/p&gt;

&lt;p&gt;build(array) -&amp;gt; Create a heap from an unsorted array of elements in an efficient manner.&lt;/p&gt;

&lt;p&gt;In addition to those above, we also have definitions for other ADTs which add additonal constraints. For example, a Binary Tree is an ADT that basically has the contract of a Tree but also enforces that each node can have at most two children. We can make definitions for AVL Trees, Red-Black Trees, and so on and so forth. I don't want to get bogged down here, but the key idea is to build upon this. So let's move on to the third part of this mental model.&lt;/p&gt;

&lt;p&gt;Algorithmic Techniques&lt;/p&gt;

&lt;p&gt;In this mental model, we can define algorithmic techniques as an ordered set of computational operations we perform directly on the underlying data of an Abstract Data Type to produce a new value.&lt;/p&gt;

&lt;p&gt;So that this definition holds, I like to think of it as all abstract data types are immutable. So even when you "sort an array" for example, you're not sorting the original array, you're creating a new sorted array from your original array. Just for the purposes of the mental model, though I'm open to hear any criticism on this.&lt;/p&gt;

&lt;p&gt;Algorithmic techniques broadly fall into four categories.&lt;/p&gt;

&lt;p&gt;Navigation Techniques&lt;br&gt;
Navigation is the process of moving through a data structure to access its elements. This is the most fundamental of all techniques.&lt;/p&gt;

&lt;p&gt;Examples:&lt;/p&gt;

&lt;p&gt;Array Traversal: Iterating through an array using a for loop from index 0 to n-1. This is a classic example of index-based navigation.&lt;/p&gt;

&lt;p&gt;Linked List Traversal: Starting at the head of a linked list and following the next pointers until you reach the end. This is a primary example of pointer-based navigation.&lt;/p&gt;

&lt;p&gt;Tree Search: Performing a Depth-First Search (DFS) or Breadth-First Search (BFS) to visit every node in a tree or graph.&lt;/p&gt;

&lt;p&gt;Precomputation Techniques&lt;br&gt;
Precomputation is doing work ahead of time to make future operations faster. It's an investment of time now for a return of speed later.&lt;/p&gt;

&lt;p&gt;Examples:&lt;/p&gt;

&lt;p&gt;Sorting: Arranging the elements of a list or array in a specific order. Once sorted, operations like searching become much faster.&lt;/p&gt;

&lt;p&gt;Hashing: Creating a hash table from a list of items to allow for near-constant-time querying. - Prefix Sum Array: Creating a new array where each element stores the sum of all elements before it in the original array. This allows you to compute the sum of a range in constant time.&lt;/p&gt;

&lt;p&gt;Querying Techniques&lt;br&gt;
Querying is the act of answering a question about the underlying data. The answer is typically a boolean (true/false) or a specific value or range of values.&lt;/p&gt;

&lt;p&gt;Examples:&lt;/p&gt;

&lt;p&gt;contains(element): Checking if a data structure holds a specific element.&lt;/p&gt;

&lt;p&gt;find(element): Locating and returning the index or position of an element.&lt;/p&gt;

&lt;p&gt;isEmpty(): A query that checks if the data structure has any elements.&lt;/p&gt;

&lt;p&gt;min() or max(): Finding the smallest or largest value in a data structure.&lt;/p&gt;

&lt;p&gt;Computation Techniques&lt;br&gt;
Computation is the process of creating a new value from the existing data. This can be a simple calculation or a complex aggregation.&lt;/p&gt;

&lt;p&gt;Examples:&lt;/p&gt;

&lt;p&gt;sum(): Calculating the sum of all elements in an array.&lt;/p&gt;

&lt;p&gt;average(): Computing the mean value of a set of numbers.&lt;/p&gt;

&lt;p&gt;transpose(matrix): Creating a new matrix by flipping the rows and columns of an original.&lt;/p&gt;

&lt;p&gt;merge(list1, list2): Creating a single new list by combining the elements of two lists.&lt;/p&gt;

&lt;p&gt;Each "algorithm" is essentially a collection of navigations, precomputations, queries, and/or computations that you perform on abstract data types until you produce the value you want.&lt;/p&gt;

&lt;p&gt;Common Algorithms Using the Index-Pointer Mental Model&lt;/p&gt;

&lt;p&gt;Here are some well-known algorithms kind of broken down using this mental model:&lt;/p&gt;

&lt;p&gt;Binary Search Underlying Data Model: Index-based (most typically an array, could be a hashmap too).&lt;/p&gt;

&lt;p&gt;Techniques:&lt;/p&gt;

&lt;p&gt;Precomputation: The algorithm assumes the array is already sorted. If not, sorting is a necessary precomputation step.&lt;/p&gt;

&lt;p&gt;Navigation: It uses two "pointers" (low and high indices) to navigate the array. The pointers are not physically stored in the data model but are computational artifacts.&lt;/p&gt;

&lt;p&gt;Querying: It performs a query at the midpoint of the current search space (is the target greater than the middle element?).&lt;/p&gt;

&lt;p&gt;Computation: Based on the query, it computes the new values for low or high to reduce the search space.&lt;/p&gt;

&lt;p&gt;Breadth-First Search (BFS) BFS is a traversal algorithm that finds the shortest path between nodes in an unweighted graph or tree.&lt;/p&gt;

&lt;p&gt;Underlying Data Model: Pointer-based (nodes and edges).&lt;/p&gt;

&lt;p&gt;Techniques:&lt;/p&gt;

&lt;p&gt;Data Structures: It uses a Queue ADT to manage the nodes it needs to visit. This ADT is often implemented with a pointer-based data model (a linked list).&lt;/p&gt;

&lt;p&gt;Navigation: It starts at a source node and navigates to all of its immediate neighbors, then all of their neighbors, and so on.&lt;/p&gt;

&lt;p&gt;Querying: It performs a crucial query: has this node already been visited? to avoid cycles.&lt;/p&gt;

&lt;p&gt;Precomputation: It precomputes a visited set to store nodes it has already processed, which is a form of caching.&lt;/p&gt;

&lt;p&gt;Merge Sort Underlying Data Model: Index-based (the arrays).&lt;/p&gt;

&lt;p&gt;Techniques: Precomputation: The algorithm's core is a recursive precomputation. It continuously splits the original array and "precomputes" sorted subarrays until it reaches the base case of a single element.&lt;/p&gt;

&lt;p&gt;Computation: The core of the algorithm is the merge function, which takes two sorted subarrays and creates a brand new, single sorted array from them. It computes a new value from two existing values.&lt;/p&gt;

&lt;p&gt;Navigation: It performs navigation within two separate subarrays simultaneously, using two pointers to compare and select elements for the new, merged array.&lt;/p&gt;

&lt;p&gt;Summary&lt;/p&gt;

&lt;p&gt;So yeah, that is the gist of the mental model for algorithms that I've been cooking up in my head. I hope this has been an interesting read for you. I'm still learning more about data structures and algorithms, and while I'm on my journey, I gravitated towards this taxonomy as a better way of being introduced to data structures and algorithms if you want to understand what exactly is going on with algorithms before you start thinking about time-complexity and space-complexity and all that stuff.&lt;/p&gt;

&lt;p&gt;If you've made it this far, thank you very much. I'd love to hear your feedback on this. I'm planning on turning this mental model into an ebook or a website, and would love to hear any feedback if you've got any criticisms or would like to collaborate. If you like the article please also give it a like at my blog: &lt;a href="https://projectsayo.hashnode.dev/leap-before-you-look-a-mental-model-for-data-structures-and-algorithms" rel="noopener noreferrer"&gt;https://projectsayo.hashnode.dev/leap-before-you-look-a-mental-model-for-data-structures-and-algorithms&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Have a great weekend!&lt;/p&gt;

</description>
      <category>datastructures</category>
      <category>algorithms</category>
      <category>learning</category>
      <category>interview</category>
    </item>
    <item>
      <title>An Intuition-First Approach to Learning and Teaching Data Structures and Algorithms</title>
      <dc:creator>lusayo_ny</dc:creator>
      <pubDate>Sat, 09 Aug 2025 04:13:42 +0000</pubDate>
      <link>https://dev.to/lusayo_ny/an-intuition-first-approach-to-learning-and-teaching-data-structures-and-algorithms-489e</link>
      <guid>https://dev.to/lusayo_ny/an-intuition-first-approach-to-learning-and-teaching-data-structures-and-algorithms-489e</guid>
      <description>&lt;p&gt;As the post says, I've written an article on an alternative approach to learning about data structures and algorithms that may come more intituively to some (it came more intutively to me). I tried to post the full article here, but I keep running into some JSON error so I assume it's too long. I'll give a brief summary and encourage you to read the rest on my blog page if you're interested.&lt;/p&gt;

&lt;p&gt;So basically, I've developed a personal mental model for approaching data structures and algorithms that's divided into the three sections:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Foundational Data Models&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Abstract Data Types&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Algorithmic Techniques&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These three serve as the building blocks for the way I understand data structures and algorithms and the way that I would teach someone if I had to tutor them. Let's get into what each of these actually mean.&lt;/p&gt;

&lt;p&gt;Foundational Data Models are basically indexed data structures, and pointer based data structures. Every other data structure that you would learn about falls under Abstract Data Types. And  I've also classified the algorithmic techniques we use for DSA questions into four broad categories.&lt;/p&gt;

&lt;p&gt;If this sounds like something you're interested in, here's the link to my blog post: &lt;a href="https://projectsayo.hashnode.dev/leap-before-you-look-a-mental-model-for-data-structures-and-algorithms" rel="noopener noreferrer"&gt;https://projectsayo.hashnode.dev/leap-before-you-look-a-mental-model-for-data-structures-and-algorithms&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Please provide feedback if you found the article interesting.&lt;/p&gt;

&lt;p&gt;Thank you.&lt;/p&gt;

</description>
      <category>datastructures</category>
      <category>algorithms</category>
      <category>learning</category>
    </item>
    <item>
      <title>Why You Should Care About Sneaky Elon Buying Twitter Out</title>
      <dc:creator>lusayo_ny</dc:creator>
      <pubDate>Tue, 19 Apr 2022 13:15:44 +0000</pubDate>
      <link>https://dev.to/lusayo_ny/why-you-should-care-about-sneaky-elon-buying-twitter-out-d27</link>
      <guid>https://dev.to/lusayo_ny/why-you-should-care-about-sneaky-elon-buying-twitter-out-d27</guid>
      <description>&lt;p&gt;It’s 19 April, 2022. The Web3 cults are growing, NFT enthusiasts are fighting intense bidding wars to see who goes broke the fastest, a sovereign country is being invaded, Trump still hasn’t lost the election, and a sneaky billionaire has pulled the Twitter rug out from under the public’s bottom. Being swept up in the times yourself, it might be difficult to detach yourself from your everyday grind to see what events deserve your attention and why. Good thing you don’t have to, because I’ve done that for you. I took a closer look at what’s currently happening with the social media giant, Twitter. I wanted to find out if the events surrounding Twitter could impact regular developers, tech companies that rely on it, or content creators that are within the tech space, and these are my conclusions so far.&lt;/p&gt;

&lt;h1&gt;
  
  
  What Happened?
&lt;/h1&gt;

&lt;p&gt;Since the 31st of January, sneaky Elon Musk has been chipping off and stashing twitter stocks in little batches almost every single day. Regardless of why he did so in such a shady manner, as of 4th April, he became the largest shareholder of Twitter with a 9% stake. That automatically granted him a seat on the board. One of his first moves in his newfound role was to initiate a massive hostile take-over that’ll make him 100% owner of Twitter. Classic Elon Musk.&lt;/p&gt;

&lt;p&gt;His motivations seem to be purely political and ethical in nature, citing that Twitter’s moderation of hate-speech is somehow a war on free-speech. I’m not inclined to comment on that. The key takeaway is that Musk wants to revise Twitter as a platform to make it more conformed to his definition of free-speech, and that is the driving factor behind his policy changes, which we’re about to get into.&lt;/p&gt;

&lt;p&gt;I’ve combed through the tweets and various news outlets to find if there’s anything remotely relevant to developers that make use of Twitter’s APIs, content creators that use it to promote their brands, or business models that rely on it, and I’ve only really found 3 potential policy changes that matter&lt;/p&gt;

&lt;h1&gt;
  
  
  Why Should It Matter to You?
&lt;/h1&gt;

&lt;h2&gt;
  
  
  1.Making Twitter’s Algorithm Public
&lt;/h2&gt;

&lt;p&gt;In a poll that sneaky Elon conducted on his Twitter account, he asked his followers if Twitter’s algorithm should be made public and open source. 82.7% of his followers who voted on the pole said yes, which should fairly express the will of Twitter users in general seeing as how Elon Musks’s account is the 8th most popular account on Twitter coming out at around 81M followers.&lt;/p&gt;

&lt;p&gt;Whether making Twitter’s algorithm open source would affect the tech world as much as similar moves done by NaN with the 3D editing software Blender, Twitter with Bootstrap, or Meta (Facebook) with React, is actually very questionable though. First of all, most of the people who agreed to make the algorithm open source wouldn’t be able to understand it in the first place. And second of all, Twitter doesn’t really have a single “algorithm”.&lt;/p&gt;

&lt;p&gt;Anyone with programming knowledge would know that an “algorithm” is really just a computational and/or mathematical approach taken to solve a very specific computing problem. They usually deal with the methodology to handle, recognize, classify, and optimize data, not business goals.&lt;/p&gt;

&lt;p&gt;The “algorithm” that people want made public is the one that Twitter uses to show content to its users. The only issue is, Twitter does not use a single “algorithm” to make sure content gets to it’s users. It employs a multitude of various heuristics, algorithms, and artificial intelligence to make sure content gets to particular users based on their locations, friends, search history, tags explored, interests, likes, retweets, etc. It would be a herculean read for any single developer, and it wouldn’t really serve a clear purpose that isn’t academic or corporate. If you add to that, the fact that those “algorithms” are really only functional within Twitter’s ecosystem, Twitter would have to expose some implementation details about their platform to make sure readers get the right context.&lt;/p&gt;

&lt;p&gt;In my opinion, I would say not a lot of developers would be interested in this reveal at all, but Twitter’s competitors, other tech giants, and venture capitalists would certainly dig out a business model from it. However, if you’re that type of developer, maybe it’ll be like reading a good book.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Reducing the number of bots
&lt;/h2&gt;

&lt;p&gt;This one deserves much more concern from the broad spectrum of developers directly. Elon Musk has suggested intensifying procedures that Twitter uses to detect and remove bots. He cited that bots are the biggest problem with Twitter, and that he would employ stricter authentication, verification, and screening of Twitter accounts to determine which ones should be removed.&lt;/p&gt;

&lt;p&gt;If you’re a developer that has or relies on Twitter bots to offer some sort of service, this could impact the way you have to write your code. You could also have to modify the way your bot makes use of Twitter to make sure it isn’t flagged.&lt;/p&gt;

&lt;p&gt;Potentially this might lead to some code-base rewrites for companies whose businesses are centered around twitter content generation and engagement or for developers who just like making bots in general. You might have to re-factor in a few months, so keep a heads up.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Removing ad-based revenue
&lt;/h2&gt;

&lt;p&gt;This one doesn’t affect developers directly, but it does change the ecosystem of twitter as a whole for entrepreneurs and content creators in any industry. That of course includes software and tech. For Twitter to remove ad-based revenue would probably mean the end of sponsored tweets, and that could significantly impact some businesses.&lt;/p&gt;

&lt;p&gt;This is a major flag that entrepreneurs and content creators have to address.&lt;/p&gt;

&lt;h1&gt;
  
  
  Finishing Thoughts?
&lt;/h1&gt;

&lt;p&gt;All in all, this is just my assessment of the situation given what I can see. On top of influencing Twitter developers, content creators, and business owners, I feel like this purchase could prove to be politically shaking as well. What are your thoughts about what might happen if Elon Musk successfully buys Twitter out?&lt;/p&gt;




&lt;p&gt;P.S: I'm new at content creation, so criticism is welcome. If you're interested in my coverage, more content on my new blog: &lt;a href="https://cassaden.com/blogs/curated" rel="noopener noreferrer"&gt;https://cassaden.com/blogs/curated&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>watercooler</category>
      <category>news</category>
    </item>
    <item>
      <title>React JS Isn’t Actually A Web Framework But Why Are There So Many Others?</title>
      <dc:creator>lusayo_ny</dc:creator>
      <pubDate>Mon, 18 Apr 2022 23:31:05 +0000</pubDate>
      <link>https://dev.to/lusayo_ny/react-js-isnt-actually-a-web-framework-but-why-are-there-so-many-others-27fd</link>
      <guid>https://dev.to/lusayo_ny/react-js-isnt-actually-a-web-framework-but-why-are-there-so-many-others-27fd</guid>
      <description>&lt;p&gt;There’s a running joke among the developer community that for every tree that’s planted in Australia, a new JavaScript framework is born. Okay, I made that up, but it’s true that there’s a widespread proliferation of JavaScript frameworks, more so than with any other programming language. Stack Overflow’s annual developer surveys for 2021 established that JavaScript frameworks dominated the most wanted and most loved sections in the web development space yet again:&lt;/p&gt;

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

&lt;p&gt;Nine of the eighteen frameworks cited in that poll are written in JavaScript, representing the fact that 50% of web developers would rather use various JavaScript frameworks than any other programming language. That’s an interesting fact on its own, but it’s a topic for later.&lt;/p&gt;

&lt;p&gt;Over the years, we’ve come to take it for granted that JavaScript is the most popular language today. It boasts the widest ecosystem, therefore it makes sense that it has a lot of web frameworks, right? But have you ever stopped to ask yourself why JavaScript has so many different web frameworks in the first place, as opposed to maybe just one or two or at most three that everybody can build camps around and get behind like every other programming language?&lt;/p&gt;

&lt;p&gt;Well, today I asked myself that question, and based on what I’ve seen so far, I think the most compelling arguments are the following.&lt;/p&gt;

&lt;h1&gt;
  
  
  1. JavaScript’s ecosystem of developers have a wider gap in technical backgrounds than other languages.
&lt;/h1&gt;

&lt;p&gt;I think all developers can generally agree that most self-taught programmers fall into the JavaScript/PHP/Python bucket, with JavaScript taking a strong lead. Don’t just take my word for it though. Data driven research¹ that cites the most popular online learning platforms as data sources clearly showed that among self-enrolled programming courses, JavaScript was the highest up the list, followed by Python. That’s because JavaScript is the easiest language to become a full-stack developer with.&lt;/p&gt;

&lt;p&gt;Why this is relevant now is that these self-taught programmers have different backgrounds, and thus different preexisting skill-sets and technical know-how. Some come from backgrounds in graphics design, some in pure sciences, and some in economics or business related courses; some are even war veterans². Depending on such technical background, it might be easier to use one framework over the other.&lt;/p&gt;

&lt;h1&gt;
  
  
  2. JavaScript can run on your back-end, front-end, or both.
&lt;/h1&gt;

&lt;p&gt;This, I think, is the second most compelling reason for why there are multiple JavaScript frameworks. It is a problem that is unique to JavaScript, and no other language can share the weight of this burden.&lt;/p&gt;

&lt;p&gt;JavaScript was built for front-end development, but then was eventually extended for back-end development. Some developers are accustomed to using other languages and frameworks for the back-end of an application. Other developers would like to use JavaScript for both front and back-end. And here in is where a major problem lies. It would be difficult to develop an all-encompassing framework that handles both those situations adequately without adding unnecessary bulk and logical complexity to the web application.&lt;/p&gt;

&lt;h1&gt;
  
  
  3. Most JavaScript developers just call anything that looks fancy a framework when it’s not really a framework.
&lt;/h1&gt;

&lt;p&gt;Yes. This is the biggest reason why JavaScript has so many frameworks: most of them aren’t actually frameworks. A framework in programming is a tool that provides ready-made components or solutions that are customized in order to speed up development. A framework may include a library, but is defined by the principle of inversion of control (IoC)³.&lt;/p&gt;

&lt;p&gt;The important thing to understand here is “inversion of control”. A computer library is composed of reusable components that your custom code calls in order to make use of a particular functionality. If you import code you downloaded from a repository and use it in your code, that’s a library. A framework, however, is when your program is structured such that the reusable, imported code within your program is the one that’s responsible for calling your custom code only when it’s needed. The framework controls the flow of the program, not the custom code.&lt;/p&gt;

&lt;p&gt;Now given that explanation, it may come as a shock to some that the popular React framework isn’t actually strictly a framework. It leaves too much structural and logical control over the individual program to be really considered one.&lt;/p&gt;

&lt;p&gt;What do you guys think about why there are so many JavaScript FrameWorks?&lt;/p&gt;




&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Shuwa, D. (2021). “The Top 100 Free University Courses of the Year (Ranked by Popularity)”. Free Code Camp, 22 Dec. Available at: &lt;a href="https://www.freecodecamp.org/news/most-popular-free-online-courses/" rel="noopener noreferrer"&gt;https://www.freecodecamp.org/news/most-popular-free-online-courses/&lt;/a&gt; (Accessed: 18 Apr 2022).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;In 2014, an organization was started to teach war veterans how to reenter regular society as effective software developers: &lt;a href="https://vetswhocode.io/" rel="noopener noreferrer"&gt;https://vetswhocode.io/&lt;/a&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Ranjan, R. (2021). “What is a Framework in Programming &amp;amp; Why You Should Use One”. Insights about Product Development, 7 Oct. Available at: &lt;a href="https://www.netsolutions.com/insights/what-is-a-framework-in-programming/#:%7E:text=A%20framework%20in%20programming%20is,inversion%20of%20control%20(IoC)" rel="noopener noreferrer"&gt;https://www.netsolutions.com/insights/what-is-a-framework-in-programming/#:~:text=A%20framework%20in%20programming%20is,inversion%20of%20control%20(IoC)&lt;/a&gt;. (Accessed: 18 Apr 2022).&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;




&lt;p&gt;P.S. Please subscribe to my blog for more detailed, thought provoking content: &lt;a href="https://cassaden.com/blogs/curated" rel="noopener noreferrer"&gt;https://cassaden.com/blogs/curated&lt;/a&gt;&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>discuss</category>
      <category>blog</category>
      <category>webdev</category>
    </item>
    <item>
      <title>The Software Bug That Created a Bomb</title>
      <dc:creator>lusayo_ny</dc:creator>
      <pubDate>Mon, 18 Apr 2022 01:57:46 +0000</pubDate>
      <link>https://dev.to/lusayo_ny/the-software-bug-that-created-a-bomb-3f5b</link>
      <guid>https://dev.to/lusayo_ny/the-software-bug-that-created-a-bomb-3f5b</guid>
      <description>&lt;p&gt;Software bugs are pretty common, but very few of them could lead to an explosion that went on record as being the fourth largest non-nuclear explosion of all time. According to some sources, this incident was so catastrophically large, the explosion could be seen from outer space, shaking the Earth at a whopping three kilotons of raw destructive power. Thankfully, not a single person was harmed, which is interesting given the scale of this explosion. While that’s shocking enough on it’s own, it isn’t as shocking as the fact that this malicious “bug” was introduced to systems on purpose, and was part of a much larger struggle between two world powers. To fully understand this incident, we need to go back to the 70’s.&lt;/p&gt;

&lt;p&gt;In the 70’s, Russia was fairly advanced in pure sciences and was caught in a fierce space race against the USA, but it had to play catch-up to other developed countries in areas of technology where it lacked. Russia’s solution to that problem was simple: it would pillage what it could not make.&lt;/p&gt;

&lt;p&gt;For a little over a decade, the KGB took advantage of labor exchange programs that had been established to improve relations with other developed countries. They inserted spies into their delegates with the sole purpose of gathering privileged know-how from other countries and reporting back to the KGB.&lt;/p&gt;

&lt;p&gt;Throughout this operation, there was a man named Vetrov working for the KGB in France. He was an engineer with the responsibility of evaluating the technology gathered through these acts of espionage.&lt;/p&gt;

&lt;p&gt;In 1981, Vetrov defected from the KGB for ideological reasons and provided the French government with a list of all of the active spies he knew, as well as all of the active technology targets that the KGB was going for. Among this list of targets was a Canadian gas pipeline company that had a fairly sophisticated system for managing their gas plants and distribution lines. The French president at the time, François Mitterrand, shared this information with the freshly sworn in 40th president of the United States, Ronald Reagen, and that was what set the ball rolling for the fourth largest non-nuclear explosion of all time.&lt;/p&gt;

&lt;p&gt;Having gathered this critical piece of information, the Reagan administration chose to not round up the spies they had uncovered, but instead feed them with misinformation. They tampered with software and doctored facts in an effort to foster instability within Russia’s economy. This proved to be particularly deadly when the Russians stole the software to manage their gas pipelines from the Canadian company. What the Russians got was a modified version of the software with a purposeful bug that would only affect their systems after a set amount of time, or after certain conditions have been met. In the world of computer science, this is what’s called a logic bomb.&lt;/p&gt;

&lt;p&gt;The logic bomb reset the valves within the gas facilities so that they valves reported a lower pressure than they were actually under. As you can imagine, repressing what they were really feeling was as bad for those pipes as it is for us humans. They exploded in a cathartic chain reaction that shook the Earth and was visible from space.&lt;/p&gt;

&lt;p&gt;This whole incident was documented by the CIA as the “Farewell Affair”, named after the assigned codename of Vetrov, the key informant to the west in the operation. There are voices of skepticism over the event due to the lack of corroborating contemporary sources. The only two sources that document it directly are a book by Thomas Reeds, and a published CIA report. Various skeptics also question if Russian pipelines were sophisticated enough to run software during the time, which, in my humble opinion, they probably were given that they used PCLs to run factories ever since the 50s.&lt;/p&gt;

&lt;p&gt;Either way, this situation goes to show the power that software has on our lives. And how sometimes, one bug is all it takes to literally change the face the Earth.&lt;/p&gt;

&lt;p&gt;P.S. I wrote this to try to get better at writing about tech. It was supposed to be an article about bugs, but this story really interested me so I looked into it more and ended up writing this. Anyway, I would appreciate criticism about my writing, though I'm not sure if this is the best space for that. For references to sources that this article used, please refer to my blog: &lt;a href="https://cassaden.com/blogs/curated/the-software-bug-that-created-a-bomb" rel="noopener noreferrer"&gt;https://cassaden.com/blogs/curated/the-software-bug-that-created-a-bomb&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>blog</category>
      <category>bug</category>
      <category>discuss</category>
    </item>
  </channel>
</rss>
