<?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: Christian Luis Paskalis Ginting</title>
    <description>The latest articles on DEV Community by Christian Luis Paskalis Ginting (@christianluis07).</description>
    <link>https://dev.to/christianluis07</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.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4119589%2Fc6f707eb-15ee-466c-8f08-2d9002853656.jpg</url>
      <title>DEV Community: Christian Luis Paskalis Ginting</title>
      <link>https://dev.to/christianluis07</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/christianluis07"/>
    <language>en</language>
    <item>
      <title>Why Big O Notation Matters More Than You Think</title>
      <dc:creator>Christian Luis Paskalis Ginting</dc:creator>
      <pubDate>Thu, 10 Sep 2026 15:49:28 +0000</pubDate>
      <link>https://dev.to/christianluis07/why-big-o-notation-matters-more-than-you-think-5d88</link>
      <guid>https://dev.to/christianluis07/why-big-o-notation-matters-more-than-you-think-5d88</guid>
      <description>&lt;h2&gt;
  
  
  "It Works On My Machine" Is a Trap
&lt;/h2&gt;

&lt;p&gt;You build a feature. You test it on &lt;code&gt;localhost&lt;/code&gt; with 5 mock users in your seed data. It's instant. You ship it.&lt;/p&gt;

&lt;p&gt;Three weeks later, an on-call alert wakes you up at 2 AM. The endpoint that used to respond in 12ms is now timing out at 30 seconds. Production has 50,000 real records now, not 5. Your database CPU is pegged at 100%, your AWS bill has a weird spike, and somewhere a product manager is asking &lt;em&gt;"did we get hacked?"&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;You didn't get hacked. You got &lt;strong&gt;Big O'd&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;This is the part junior developers often miss: Big O notation isn't an academic ritual you perform to pass a coding interview and then forget. It's the engineering tool that tells you, &lt;em&gt;before&lt;/em&gt; you ship, whether your code will survive contact with real production data — or quietly detonate in production.&lt;/p&gt;

&lt;p&gt;Let's be clear about what Big O actually predicts. It's &lt;strong&gt;not&lt;/strong&gt; about exact milliseconds. Your code's real-world execution speed depends on your CPU, your network, your JIT compiler, and whatever else is running on the server. Big O doesn't care about any of that. What it predicts is &lt;strong&gt;the shape of the curve&lt;/strong&gt; — how your workload scales as your input grows. And that shape is exactly what separates a boring Tuesday from a critical production incident.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Shape of the Curve
&lt;/h2&gt;

&lt;p&gt;Here's the mental model to internalize: as &lt;code&gt;n&lt;/code&gt; (your input size) grows, how does your work grow with it?&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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F78hcrute71evc6f1pt81.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.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F78hcrute71evc6f1pt81.png" alt=" " width="800" height="675"&gt;&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Caption: The steeper the curve, the faster your app degrades as data grows. O(1) and O(log n) stay flat. O(n²) and beyond go vertical — fast.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Notice that some of these lines barely move as &lt;code&gt;n&lt;/code&gt; increases. Others go nearly straight up. The difference between those two shapes, at scale, is the difference between a snappy application and a pager alert.&lt;/p&gt;


&lt;h2&gt;
  
  
  The Core Complexities, Translated for Web Devs
&lt;/h2&gt;

&lt;p&gt;Forget the pure theoretical math for a second. Here's what each complexity class actually looks like in everyday web development code:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Notation&lt;/th&gt;
&lt;th&gt;Name&lt;/th&gt;
&lt;th&gt;Practical Web-Dev Example&lt;/th&gt;
&lt;th&gt;Behavior at Scale&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;O(1)&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Constant&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;array.push()&lt;/code&gt;, &lt;code&gt;Map.get(key)&lt;/code&gt;, accessing &lt;code&gt;obj.prop&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;Flat. 10 items or 10 million — same cost.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;O(log n)&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Logarithmic&lt;/td&gt;
&lt;td&gt;Binary search, balanced BST lookup, most DB &lt;strong&gt;index&lt;/strong&gt; lookups&lt;/td&gt;
&lt;td&gt;Barely rises. Doubling data adds one extra "step."&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;O(n)&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Linear&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;array.map()&lt;/code&gt;, &lt;code&gt;array.filter()&lt;/code&gt;, a single &lt;code&gt;for&lt;/code&gt; loop, unindexed DB scan&lt;/td&gt;
&lt;td&gt;Grows proportionally. 2x data = 2x time.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;O(n log n)&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Linearithmic&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;Array.prototype.sort()&lt;/code&gt;, merge sort, efficient sorting algorithms&lt;/td&gt;
&lt;td&gt;Slightly worse than linear, but very manageable.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;O(n²)&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Quadratic&lt;/td&gt;
&lt;td&gt;Nested loops — checking every item against every other item&lt;/td&gt;
&lt;td&gt;Grows fast. 2x data = 4x time. Danger zone starts here.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;O(2ⁿ)&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Exponential&lt;/td&gt;
&lt;td&gt;Naive recursive Fibonacci, brute-force subset generation&lt;/td&gt;
&lt;td&gt;Explodes almost immediately. Unusable past small &lt;code&gt;n&lt;/code&gt;.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;O(n!)&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Factorial&lt;/td&gt;
&lt;td&gt;Brute-force "try every permutation" (traveling salesman, naive routing)&lt;/td&gt;
&lt;td&gt;Dead on arrival for any real dataset.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The practical takeaway: &lt;strong&gt;O(1) through O(n log n) are generally safe defaults.&lt;/strong&gt; The moment you write nested loops or nested &lt;code&gt;.find()&lt;/code&gt; calls inside &lt;code&gt;.map()&lt;/code&gt;, you should stop and ask: &lt;em&gt;"How big can &lt;code&gt;n&lt;/code&gt; actually get in production?"&lt;/em&gt;&lt;/p&gt;


&lt;h2&gt;
  
  
  The Before &amp;amp; After: Nested Loops vs. Hash Maps
&lt;/h2&gt;

&lt;p&gt;This is the single most common performance bottleneck I encounter: finding matches or duplicates across two lists using a nested loop.&lt;/p&gt;
&lt;h3&gt;
  
  
  The Problem: O(n²)
&lt;/h3&gt;

&lt;p&gt;Say you're matching users from one array against orders from another, looking for an ID match:&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;// don't do this O(n²) — a nested loop over two lists&lt;/span&gt;
&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;findMatchingUsers&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;users&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;orders&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;matches&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[];&lt;/span&gt;

  &lt;span class="k"&gt;for &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;user&lt;/span&gt; &lt;span class="k"&gt;of&lt;/span&gt; &lt;span class="nx"&gt;users&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;for &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;order&lt;/span&gt; &lt;span class="k"&gt;of&lt;/span&gt; &lt;span class="nx"&gt;orders&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;user&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;id&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="nx"&gt;order&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;userId&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nx"&gt;matches&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;push&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;user&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
        &lt;span class="k"&gt;break&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
      &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;

  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;matches&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 reads &lt;em&gt;fine&lt;/em&gt;. It passes PR reviews easily. It works in microseconds with your 5-item mock fixture. The problem is invisible until real volume hits.&lt;/p&gt;

&lt;h3&gt;
  
  
  The Arithmetic That Should Scare You
&lt;/h3&gt;

&lt;p&gt;If &lt;code&gt;users&lt;/code&gt; has 1,000 items and &lt;code&gt;orders&lt;/code&gt; has 1,000 items, that inner loop runs up to:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;1,000 × 1,000 = 1,000,000 iterations
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;One million operations&lt;/strong&gt;, for what feels like "just matching two lists." Now imagine &lt;code&gt;users&lt;/code&gt; grows to 50,000 and &lt;code&gt;orders&lt;/code&gt; to 50,000, which is a normal production dataset:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;50,000 × 50,000 = 2,500,000,000 iterations
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That's &lt;strong&gt;2.5 billion operations&lt;/strong&gt;. Your event loop blocks. Your serverless Lambda times out. Your users see an infinite spinner and then a 504 Gateway Timeout.&lt;/p&gt;

&lt;h3&gt;
  
  
  The Solution: O(n)
&lt;/h3&gt;

&lt;p&gt;The fix isn't clever trickery — it's a fundamental data structure change. Trade the nested loop for a &lt;code&gt;Map&lt;/code&gt; or &lt;code&gt;Set&lt;/code&gt;, which gives you &lt;strong&gt;O(1)&lt;/strong&gt; lookups:&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;// do this instead O(n) — build a lookup set once, then scan once&lt;/span&gt;
&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;findMatchingUsers&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;users&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;orders&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;orderUserIds&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Set&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;orders&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;map&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;order&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;order&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;userId&lt;/span&gt;&lt;span class="p"&gt;));&lt;/span&gt;

  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;users&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;filter&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;user&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;orderUserIds&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;has&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;user&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;id&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;Now walk through the arithmetic again with the same 1,000 + 1,000 inputs:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Building the Set:       1,000 operations
Filtering the users:    1,000 operations
Total:                  2,000 operations
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;2,000 operations instead of 1,000,000.&lt;/strong&gt; At the 50,000-record scale, this version does roughly 100,000 operations instead of 2.5 billion. That's not a minor optimization — it's the difference between "instant response" and "the site crashed."&lt;/p&gt;




&lt;h2&gt;
  
  
  The Hidden Business Costs Nobody Puts in the Ticket
&lt;/h2&gt;

&lt;p&gt;Big O feels purely academic until you connect it to infrastructure costs and downtime. Here is where it actually hurts:&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Your Cloud Bill Is a Big O Bill
&lt;/h3&gt;

&lt;p&gt;Modern serverless platforms like &lt;strong&gt;AWS Lambda&lt;/strong&gt;, &lt;strong&gt;Google Cloud Run&lt;/strong&gt;, and &lt;strong&gt;Vercel&lt;/strong&gt; bill you by &lt;strong&gt;execution duration × memory allocated&lt;/strong&gt;. An O(n²) function isn't just "slower" — it is directly, linearly more expensive every time your database grows.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A function that takes 200ms at low volume but degrades to 8 seconds under real production traffic doesn't just annoy users — it &lt;strong&gt;multiplies your compute costs by 40x&lt;/strong&gt; for the exact same request.&lt;/li&gt;
&lt;li&gt;Worse, slow functions often get "band-aided" by throwing more RAM or configuring longer timeouts. That treats the symptom while the root cause (a bad algorithmic curve) keeps compounding your bill every month.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  2. Database Disasters: The Missing Index
&lt;/h3&gt;

&lt;p&gt;This is the O(n) vs O(log n) problem wearing a database costume.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A query on an &lt;strong&gt;indexed column&lt;/strong&gt; uses a B-tree lookup: &lt;strong&gt;O(log n)&lt;/strong&gt;. Even with 10 million rows, that's roughly 23 comparisons.&lt;/li&gt;
&lt;li&gt;A query on an &lt;strong&gt;unindexed column&lt;/strong&gt; forces a full table scan: &lt;strong&gt;O(n)&lt;/strong&gt;. With 10 million rows, that's 10 million disk/memory row reads every single time that query fires.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="c1"&gt;-- No index on email? This is an expensive O(n) full table scan.&lt;/span&gt;
&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;users&lt;/span&gt; &lt;span class="k"&gt;WHERE&lt;/span&gt; &lt;span class="n"&gt;email&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'someone@example.com'&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 why a query that felt instant in staging can bring your production database to its knees at 5 million rows. Nobody changed the query code. The &lt;strong&gt;data grew&lt;/strong&gt;, and the algorithmic reality of "no index" was always O(n).&lt;/p&gt;

&lt;h3&gt;
  
  
  3. The "Clean Code" Fallacy
&lt;/h3&gt;

&lt;p&gt;Here's an uncomfortable truth: &lt;strong&gt;readable code and performant code are not always the same thing&lt;/strong&gt;, and clean code principles alone won't prevent scale failures.&lt;/p&gt;

&lt;p&gt;You can write a beautifully named, well-commented, single-responsibility function that is still O(n²) because it's built on the wrong data structure. Clean Code guides will tell you to extract helper functions. They won't warn you that calling &lt;code&gt;.find()&lt;/code&gt; inside a &lt;code&gt;.map()&lt;/code&gt; quietly turns a linear operation into a quadratic disaster:&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;// Clean, readable, well-named... and still dangerously O(n²)&lt;/span&gt;
&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;enrichOrdersWithUserNames&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;orders&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;users&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;orders&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;map&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;order&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;({&lt;/span&gt;
    &lt;span class="p"&gt;...&lt;/span&gt;&lt;span class="nx"&gt;order&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;userName&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;users&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;find&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;u&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;u&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;id&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="nx"&gt;order&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;userId&lt;/span&gt;&lt;span class="p"&gt;)?.&lt;/span&gt;&lt;span class="nx"&gt;name&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 easily sails through code reviews focused solely on syntax elegance. It will still fall over under load. &lt;strong&gt;Readability helps humans understand code. Big O helps machines survive code.&lt;/strong&gt; You need both.&lt;/p&gt;




&lt;h2&gt;
  
  
  Making Big O Part of Your Daily Workflow
&lt;/h2&gt;

&lt;p&gt;You don't need a mathematical whiteboard proof on every commit. You just need three engineering habits:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Ask "What is &lt;code&gt;n&lt;/code&gt; in production?"&lt;/strong&gt; before you ship. Five mock rows and five million production rows obey completely different physics.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Treat nested iterations and nested &lt;code&gt;.find()&lt;/code&gt; / &lt;code&gt;.includes()&lt;/code&gt; calls as a code smell.&lt;/strong&gt; Whenever you iterate inside an iteration, ask if a &lt;code&gt;Map&lt;/code&gt; or &lt;code&gt;Set&lt;/code&gt; gets you there in one linear pass.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Run &lt;code&gt;EXPLAIN ANALYZE&lt;/code&gt; on your database queries.&lt;/strong&gt; If you see a sequential table scan (&lt;code&gt;Seq Scan&lt;/code&gt;) where an index was expected, that's your O(n) red alert.&lt;/li&gt;
&lt;/ol&gt;




&lt;p&gt;Big O isn't interview trivia you tolerate and forget. It's the difference between an application that scales effortlessly and one that silently accumulates technical debt until it collapses under user demand.&lt;/p&gt;

&lt;p&gt;What's the worst O(n²) performance trap you've caught in code review or production? Drop your war stories in the comments! 👇&lt;/p&gt;




&lt;h3&gt;
  
  
  About the Author
&lt;/h3&gt;

&lt;p&gt;Hi, I'm &lt;strong&gt;Christian Luis Paskalis Ginting&lt;/strong&gt; — a cybersecurity engineering student and software developer passionate about building scalable, secure backend systems, DevSecOps pipelines, and high-performance web applications.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;GitHub:&lt;/strong&gt; &lt;a href="https://github.com/christianLuis07" rel="noopener noreferrer"&gt;Christian Luis Paskalis Ginting on GitHub (@christianLuis07)&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Interactive DevSecOps Portfolio:&lt;/strong&gt; &lt;a href="https://clean-code.my.id" rel="noopener noreferrer"&gt;clean-code.my.id&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;LinkedIn:&lt;/strong&gt; &lt;a href="https://www.linkedin.com/in/christian-luis-paskalis-ginting-85abbb2a2/" rel="noopener noreferrer"&gt;Christian Luis Paskalis Ginting&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>webdev</category>
      <category>programming</category>
      <category>performance</category>
      <category>computerscience</category>
    </item>
  </channel>
</rss>
