<?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: Million Ways To Code</title>
    <description>The latest articles on DEV Community by Million Ways To Code (@mwc).</description>
    <link>https://dev.to/mwc</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%2F3823305%2F555c2058-b5bb-46b1-9839-dc3fba3ab711.png</url>
      <title>DEV Community: Million Ways To Code</title>
      <link>https://dev.to/mwc</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/mwc"/>
    <language>en</language>
    <item>
      <title>I Rendered 10,000 Dots So You Don’t Have To (But You Probably Will Anyway)</title>
      <dc:creator>Million Ways To Code</dc:creator>
      <pubDate>Sun, 29 Mar 2026 04:41:05 +0000</pubDate>
      <link>https://dev.to/mwc/i-rendered-10000-dots-so-you-dont-have-to-but-you-probably-will-anyway-109</link>
      <guid>https://dev.to/mwc/i-rendered-10000-dots-so-you-dont-have-to-but-you-probably-will-anyway-109</guid>
      <description>&lt;p&gt;Last time I said I’d build something simple—a scatter plot with a few thousand points. Just to feel the difference between SVG and canvas in my fingers.&lt;/p&gt;

&lt;p&gt;So I did.&lt;/p&gt;

&lt;p&gt;And of course, “simple” turned into “why is my fan spinning so loud” pretty quickly.&lt;/p&gt;

&lt;h3&gt;
  
  
  The Setup
&lt;/h3&gt;

&lt;p&gt;I made two versions. Same data, same visual. One SVG, one canvas. A thousand random points at first, then ten thousand, then fifty thousand—because I clearly enjoy watching browsers suffer.&lt;/p&gt;

&lt;p&gt;If you’ve ever wondered where the line is between “SVG is fine” and “your tab is now a jet engine,” here’s what I found.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;SVG&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Up to about 500–800 points, everything is smooth. DOM inspector is happy, hover effects work out of the box, tooltips just work. It’s almost too easy.&lt;/p&gt;

&lt;p&gt;At 3,000 points, the DOM starts to feel heavy. Inspecting elements becomes sluggish. Mouse interactions still work, but you can feel the browser working harder.&lt;/p&gt;

&lt;p&gt;At 10,000 points, scrolling is a slideshow. The browser’s layout engine is basically crying. If you try to attach individual click handlers to each circle, your computer will politely ask you to reconsider your life choices.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Canvas&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
At 1,000 points, I couldn’t tell the difference. At 10,000 points, still smooth. At 50,000 points, it started to breathe a little heavier, but it was still usable.&lt;/p&gt;

&lt;p&gt;The trade-off? Nothing is an element. No built-in hover, no automatic tooltips, no inspector magic. You’re in charge of &lt;em&gt;everything&lt;/em&gt;: hit detection, redrawing on zoom, making sure the right thing highlights when someone hovers. It’s not harder, it’s just… more.&lt;/p&gt;

&lt;h3&gt;
  
  
  The Weird Place In Between
&lt;/h3&gt;

&lt;p&gt;What surprised me was how nice it felt to combine them. Background grid and axes in SVG (sharp, scalable, zero redraw hassle). Data points in canvas (fast, even when there are thousands of them). Then a separate canvas for hover interactions, or an absolutely positioned SVG for tooltips.&lt;/p&gt;

&lt;p&gt;It sounds over-engineered, but honestly it was the most pleasant to work with. Each layer did what it’s good at. SVG handled the static stuff. Canvas handled the chaotic swarm of dots. My sanity stayed mostly intact.&lt;/p&gt;

&lt;h3&gt;
  
  
  AI Wrote None of This (But It Tried)
&lt;/h3&gt;

&lt;p&gt;I’m still using AI tools every day—they’re great for generating the first draft of a chart component or remembering canvas API syntax I keep forgetting. But when I asked an AI to “optimize this scatter plot for 10,000 points,” it gave me code that &lt;em&gt;technically worked&lt;/em&gt; but had zero understanding of the actual constraints.&lt;/p&gt;

&lt;p&gt;It didn’t know that my users would be on 13-inch laptops with integrated graphics. It didn’t know I needed accessible labels for screen readers. It didn’t know I wanted smooth zooming without tearing my hair out.&lt;/p&gt;

&lt;p&gt;AI gave me code. I still had to make the decisions.&lt;/p&gt;

&lt;p&gt;That’s the part that doesn’t come from a prompt. It comes from building things, watching them break, and figuring out &lt;em&gt;why&lt;/em&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  What’s Next
&lt;/h3&gt;

&lt;p&gt;I’m still messing with this scatter plot thing. Next I want to add zoom and pan, because that’s where canvas really gets interesting (and frustrating). Probably going to write a small library of my own—not to publish, just to see where the abstraction leaks.&lt;/p&gt;

&lt;p&gt;If you’ve ever tried to render thousands of things on the web, I’d honestly love to know: what broke for you? Did you start with SVG and regret it? Or did you jump straight to canvas and miss having real elements?&lt;/p&gt;

&lt;p&gt;Reply, comment, yell into the void—I’ll probably read it.&lt;/p&gt;

&lt;p&gt;This stuff is still weird and messy and I’m glad we’re figuring it out together.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>ai</category>
      <category>javascript</category>
      <category>canvas</category>
    </item>
    <item>
      <title>The Canvas Revolution: When Pixels Took Over the Web</title>
      <dc:creator>Million Ways To Code</dc:creator>
      <pubDate>Sun, 15 Mar 2026 13:13:48 +0000</pubDate>
      <link>https://dev.to/mwc/the-canvas-revolution-when-pixels-took-over-the-web-51bl</link>
      <guid>https://dev.to/mwc/the-canvas-revolution-when-pixels-took-over-the-web-51bl</guid>
      <description>&lt;h2&gt;
  
  
  Canvas vs. SVG: The Trade-Offs That Matter
&lt;/h2&gt;

&lt;p&gt;I still remember the first time I messed around with &lt;code&gt;&amp;lt;canvas&amp;gt;&lt;/code&gt;. It was 2019, and I was building some dumb interactive animation—probably one of those particles-follow-the-mouse things everyone makes when they're learning. Back then, if you wanted custom graphics on the web, your options were basically: wrestle with SVG until it does what you want, or use Flash and immediately lose all credibility. Canvas felt like cheating. A blank rectangle where I could just... paint stuff with JavaScript. No weird XML syntax. No fighting with the DOM. Just pixels and math.&lt;/p&gt;

&lt;p&gt;Turns out that little HTML tag would go on to power half the apps I use daily. Google Maps? Canvas. Figma? Canvas. Those fancy data dashboards that plot millions of points without melting your laptop? Also canvas.&lt;/p&gt;

&lt;p&gt;But before we go all-in on canvas, we gotta talk about the stuff it sits on top of. You know, the boring but important foundation: &lt;strong&gt;semantic HTML&lt;/strong&gt;.&lt;/p&gt;




&lt;h2&gt;
  
  
  Why Semantic HTML Still Matters (Yes, Even for Graphics)
&lt;/h2&gt;

&lt;p&gt;Look, I get it. Semantic HTML isn't exciting. Nobody gets hyped about &lt;code&gt;&amp;lt;article&amp;gt;&lt;/code&gt; tags. But here's the thing—writing code that actually &lt;em&gt;means&lt;/em&gt; something matters more than you think.&lt;/p&gt;

&lt;p&gt;When you use &lt;code&gt;&amp;lt;button&amp;gt;&lt;/code&gt; instead of &lt;code&gt;&amp;lt;div class="button"&amp;gt;&lt;/code&gt;, you're not just being pedantic. You're telling the browser, screen readers, and random developers who will maintain your code in three years that this thing is clickable and does something. A &lt;code&gt;&amp;lt;nav&amp;gt;&lt;/code&gt; says "this is navigation," not "this is a container with links inside."&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;header&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;h1&amp;gt;&lt;/span&gt;My Blog&lt;span class="nt"&gt;&amp;lt;/h1&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;nav&amp;gt;&lt;/span&gt;&lt;span class="c"&gt;&amp;lt;!-- actual links here --&amp;gt;&lt;/span&gt;&lt;span class="nt"&gt;&amp;lt;/nav&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/header&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;main&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;article&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;h2&amp;gt;&lt;/span&gt;Post Title&lt;span class="nt"&gt;&amp;lt;/h2&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;p&amp;gt;&lt;/span&gt;Content goes here...&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/article&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/main&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This stuff builds the &lt;strong&gt;DOM&lt;/strong&gt;—that tree structure browsers use to make sense of your page. Every element becomes a node you can poke at with JavaScript, style with CSS, or query with dev tools when something breaks at 2 AM.&lt;/p&gt;

&lt;p&gt;Why should you care about this when we're supposed to be talking about graphics? Because SVG and canvas live in this same world, but they treat it completely differently. SVG elements become part of that DOM tree—every circle, every path, every rectangle shows up as a node you can inspect and manipulate. Canvas? It's just one lonely &lt;code&gt;&amp;lt;canvas&amp;gt;&lt;/code&gt; tag hiding a whole universe of pixels that the DOM knows nothing about.&lt;/p&gt;




&lt;h2&gt;
  
  
  SVG vs. Canvas: Pick Your Poison
&lt;/h2&gt;

&lt;p&gt;Here's a scenario: You're building a dashboard. Simple line chart, tooltips on hover, the usual. Easy, right? Now imagine your boss comes back and says "cool, now make it handle 100,000 data points and let users zoom around in real time." Suddenly the easy solution isn't so easy.&lt;/p&gt;

&lt;h3&gt;
  
  
  SVG: When You Want Your Graphics in the DOM
&lt;/h3&gt;

&lt;p&gt;SVG is basically XML for drawing. It feels familiar because you're writing tags like HTML:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;svg&lt;/span&gt; &lt;span class="na"&gt;width=&lt;/span&gt;&lt;span class="s"&gt;"500"&lt;/span&gt; &lt;span class="na"&gt;height=&lt;/span&gt;&lt;span class="s"&gt;"300"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;circle&lt;/span&gt; &lt;span class="na"&gt;cx=&lt;/span&gt;&lt;span class="s"&gt;"100"&lt;/span&gt; &lt;span class="na"&gt;cy=&lt;/span&gt;&lt;span class="s"&gt;"100"&lt;/span&gt; &lt;span class="na"&gt;r=&lt;/span&gt;&lt;span class="s"&gt;"40"&lt;/span&gt; &lt;span class="na"&gt;fill=&lt;/span&gt;&lt;span class="s"&gt;"steelblue"&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;rect&lt;/span&gt; &lt;span class="na"&gt;x=&lt;/span&gt;&lt;span class="s"&gt;"200"&lt;/span&gt; &lt;span class="na"&gt;y=&lt;/span&gt;&lt;span class="s"&gt;"60"&lt;/span&gt; &lt;span class="na"&gt;width=&lt;/span&gt;&lt;span class="s"&gt;"80"&lt;/span&gt; &lt;span class="na"&gt;height=&lt;/span&gt;&lt;span class="s"&gt;"80"&lt;/span&gt; &lt;span class="na"&gt;fill=&lt;/span&gt;&lt;span class="s"&gt;"coral"&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/svg&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Every circle, every rectangle becomes a real DOM element. You can attach click handlers directly, update attributes with JavaScript, style them with CSS. The browser remembers everything you drew—this is called &lt;strong&gt;retained mode&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;The catch? Memory. Each shape costs something. Render 5,000 circles and suddenly your DOM tree is a bloated mess. Interaction gets sluggish, scrolling feels like wading through molasses, and users start complaining about your "laggy dashboard" on Twitter.&lt;/p&gt;

&lt;h3&gt;
  
  
  Canvas: When You Just Want to Draw Pixels
&lt;/h3&gt;

&lt;p&gt;Canvas is the opposite. You get a rectangle, a drawing context, and that's it. Nothing persists—you just tell it what to draw, and it draws it:&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;canvas&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getElementById&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;myCanvas&lt;/span&gt;&lt;span class="dl"&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;ctx&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;canvas&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;getContext&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;2d&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="nx"&gt;ctx&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;fillStyle&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;steelblue&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nx"&gt;ctx&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;beginPath&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="nx"&gt;ctx&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;arc&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;40&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="nb"&gt;Math&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;PI&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="nx"&gt;ctx&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;fill&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

&lt;span class="nx"&gt;ctx&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;fillStyle&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;coral&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nx"&gt;ctx&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;fillRect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;200&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;60&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;80&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;80&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 &lt;strong&gt;immediate mode&lt;/strong&gt;. The browser draws your circle, then immediately forgets it ever happened. Want to move that circle? Gotta clear the whole canvas and redraw everything. It's more work on your end, but there's zero DOM overhead. You can draw hundreds of thousands of shapes because the GPU does the heavy lifting.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Two Things People Actually Mean When They Say "Scalable"
&lt;/h2&gt;

&lt;p&gt;I've noticed that when developers talk about "scalable graphics," they're usually talking about two completely different things. Mixing them up leads to bad decisions and regret.&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Resolution Scalability (How It Looks When You Zoom)
&lt;/h3&gt;

&lt;p&gt;&lt;em&gt;Does your graphic look like garbage on a 4K monitor?&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;SVG wins this one hands down. Vector math means infinite scaling—no pixels, no blur. Canvas is pixel-based by default. Draw something at 100×100 and scale it with CSS? Congrats, you now have a blurry mess. You can fix this by setting the canvas dimensions to match the device pixel ratio, but it's not automatic.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Application Scalability (How Much Stuff You Can Throw At It)
&lt;/h3&gt;

&lt;p&gt;&lt;em&gt;How many elements before your browser starts sweating?&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Canvas destroys SVG here. No scene graph, no DOM nodes, just raw drawing commands pushed through the GPU. Games, real-time simulations, massive data visualizations—all canvas territory.&lt;/p&gt;




&lt;h2&gt;
  
  
  Where Canvas Actually Changed the Game
&lt;/h2&gt;

&lt;p&gt;Let's look at some real examples where canvas didn't just make things slightly better—it made things possible that weren't before.&lt;/p&gt;

&lt;h3&gt;
  
  
  🗺️ Google Maps: How Do You Make Millions of Things Clickable?
&lt;/h3&gt;

&lt;p&gt;Old web maps used static image tiles. Then came interactive maps with SVG markers, which worked fine until you tried to show more than a few hundred points. Google Maps took a different approach: render everything in canvas (actually WebGL, which is canvas on steroids).&lt;/p&gt;

&lt;p&gt;But here's the problem—if everything is just pixels, how do you know which restaurant someone clicked on? Google uses this sneaky technique called "color picking":&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Draw an invisible off-screen buffer where every data point gets a unique RGB color (basically its ID).&lt;/li&gt;
&lt;li&gt;When the user clicks, check what color is at that pixel in the invisible buffer.&lt;/li&gt;
&lt;li&gt;Look up which data point has that color.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This happens in milliseconds and works for millions of objects. Google even lets developers use this via their &lt;code&gt;WebglOverlayView&lt;/code&gt; API now.&lt;/p&gt;

&lt;h3&gt;
  
  
  🎨 Figma: What If the Whole UI Was One Canvas?
&lt;/h3&gt;

&lt;p&gt;Figma took a crazy bet: render the entire design interface in WebGL. No DOM elements for shapes, text layers, or frames—just one giant canvas and a ton of math.&lt;/p&gt;

&lt;p&gt;This is why real-time collaboration works. When you move a layer, Figma sends a tiny message and everyone's canvas redraws that layer. No DOM diffing, no reflows, no framework fighting itself. Just pixels updating.&lt;/p&gt;

&lt;h3&gt;
  
  
  📊 Data Visualization: When D3 Grew Up
&lt;/h3&gt;

&lt;p&gt;D3 used to be the king of SVG visualizations. Still is, for small-to-medium datasets. But for huge data, D3 can now use canvas renderers. Observable Plot even lets you decide based on data size:&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="nx"&gt;Plot&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;plot&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
  &lt;span class="na"&gt;marks&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
    &lt;span class="nx"&gt;Plot&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;dot&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="na"&gt;x&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;revenue&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="na"&gt;y&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;profit&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="na"&gt;renderer&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;length&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;10000&lt;/span&gt; &lt;span class="p"&gt;?&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;canvas&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;svg&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
    &lt;span class="p"&gt;})&lt;/span&gt;
  &lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="p"&gt;})&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The library makes the call for you. That's the kind of pragmatism I respect.&lt;/p&gt;




&lt;h2&gt;
  
  
  How I Decide (After Making All the Wrong Choices First)
&lt;/h2&gt;

&lt;p&gt;I've built enough things that crashed browsers to have some rules of thumb now.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Use SVG when:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;You need perfect sharpness at any size (logos, icons, diagrams)&lt;/li&gt;
&lt;li&gt;You want to attach click handlers without writing hit detection logic&lt;/li&gt;
&lt;li&gt;Accessibility matters (screen readers can actually describe SVG)&lt;/li&gt;
&lt;li&gt;You have less than like 500 elements&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Use canvas when:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;You're rendering thousands of things&lt;/li&gt;
&lt;li&gt;Performance is actually important (animations, games, real-time)&lt;/li&gt;
&lt;li&gt;You need pixel-level control (image filters, video effects)&lt;/li&gt;
&lt;li&gt;You don't mind managing redraws yourself&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;And if you're somewhere in between? Layer them. Static background in SVG, dynamic stuff in canvas. Or heavy lifting in canvas, tooltips and overlays in SVG. Nobody says you have to pick just one.&lt;/p&gt;




&lt;h2&gt;
  
  
  Random Thoughts on AI and All That
&lt;/h2&gt;

&lt;p&gt;I've been thinking a lot about AI tools lately, mostly because I use them constantly. It's wild what you can generate with a prompt now—whole particle systems, chart components, even simple games. But here's the thing: AI doesn't know your actual problem.&lt;/p&gt;

&lt;p&gt;It doesn't know that your boss wants tooltips on every single data point. It doesn't know that half your users are on five-year-old phones with integrated graphics. It doesn't know that accessibility isn't optional for your project.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Writing the code was never the hard part.&lt;/strong&gt; The hard part is figuring out which trade-offs to make. SVG or canvas? Retained mode or immediate mode? DOM convenience or GPU performance? Those decisions don't come from prompts—they come from understanding the problem and the people who have it.&lt;/p&gt;

&lt;p&gt;That's honestly why I started Million Ways to Code. Not to show off clever implementations, but to think out loud about the &lt;em&gt;why&lt;/em&gt; behind choices. Ten developers, same problem, ten solutions. That's not a bug—that's the whole point.&lt;/p&gt;




&lt;h2&gt;
  
  
  What's Next?
&lt;/h2&gt;

&lt;p&gt;The web keeps changing. WebGPU is coming. New frameworks every week. But the core questions stay the same: what are we building, who's it for, and what breaks if we do it wrong?&lt;/p&gt;

&lt;p&gt;Next time I'm gonna build something simple—maybe a scatter plot with a few thousand points. Nothing fancy, just enough to feel the difference between SVG and canvas in my fingers. I'll probably break stuff and complain about it.&lt;/p&gt;

&lt;p&gt;If you've hit performance walls in your own projects, I'd genuinely love to hear about them. What did you try? What worked? What made you want to throw your laptop across the room?&lt;/p&gt;

&lt;p&gt;Drop a comment or whatever. No pressure either way.&lt;/p&gt;

&lt;p&gt;Thanks for reading. This stuff is messy and human and I'm glad you're here.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>javascript</category>
      <category>performance</category>
      <category>canvas</category>
    </item>
    <item>
      <title>Launching "Million Ways to Code" — Building Software in the Age of AI</title>
      <dc:creator>Million Ways To Code</dc:creator>
      <pubDate>Sat, 14 Mar 2026 03:38:14 +0000</pubDate>
      <link>https://dev.to/mwc/launching-million-ways-to-code-building-software-in-the-age-of-ai-19nn</link>
      <guid>https://dev.to/mwc/launching-million-ways-to-code-building-software-in-the-age-of-ai-19nn</guid>
      <description>&lt;p&gt;It’s funny how software engineering works. You can give ten different developers the same problem, and you'll probably get ten different solutions. Not because anyone is wrong, but because we all think differently. We weigh performance, maintainability, and complexity in our own way. That variety has always fascinated me.&lt;/p&gt;

&lt;p&gt;That’s actually why I started &lt;em&gt;Million Ways to Code&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;I wanted a place to capture that idea. A space where I can experiment with different approaches to building real software—not just toy examples, but things people might actually use. And along the way, share what I learn from building products and making mistakes.&lt;/p&gt;

&lt;p&gt;Lately, I’ve been thinking a lot about AI tools and how they’re changing the way we write code. It's incredible what you can do now—generate entire functions, get implementation suggestions, even spin up small apps with a prompt. But here's the thing: writing code has never really been the hard part.&lt;/p&gt;

&lt;p&gt;The hard part is everything else.&lt;/p&gt;

&lt;p&gt;It’s understanding how systems fit together. It’s deciding between trade-offs when there’s no perfect answer. It’s figuring out what problem you're actually solving in the first place. Syntax comes and goes. Frameworks change. But being able to think through a system? That stays.&lt;/p&gt;

&lt;p&gt;If you only know how to write code, the AI era might be rough. But if you understand &lt;strong&gt;systems and problem-solving&lt;/strong&gt;, you're going to be fine. More than fine, probably.&lt;/p&gt;

&lt;p&gt;So with this blog, I want to dig into the &lt;em&gt;how&lt;/em&gt; and the &lt;em&gt;why&lt;/em&gt; behind building software. Different approaches, same problems. Here’s what I’ll mostly be writing about:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;JavaScript patterns and what’s actually happening under the hood&lt;/li&gt;
&lt;li&gt;React architecture and state management&lt;/li&gt;
&lt;li&gt;Performance optimizations that actually matter in production&lt;/li&gt;
&lt;li&gt;Building real products and developer tools—the messy, non-glamorous parts&lt;/li&gt;
&lt;li&gt;How engineering thinking evolves when AI is part of the team&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Some upcoming posts I’m planning:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Different ways to implement debounce in JavaScript&lt;/li&gt;
&lt;li&gt;Rolling your own state management library—just to see what breaks&lt;/li&gt;
&lt;li&gt;Performance patterns used in production applications&lt;/li&gt;
&lt;li&gt;Exploring different architectural approaches to common frontend problems&lt;/li&gt;
&lt;li&gt;What it means to grow as an engineer when AI can write half your code&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If that sounds like your kind of thing, I’d love to have you along.&lt;/p&gt;

&lt;p&gt;Welcome to &lt;strong&gt;Million Ways to Code&lt;/strong&gt;.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>ai</category>
      <category>programming</category>
      <category>javascript</category>
    </item>
  </channel>
</rss>
