<?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: Anish Basnet</title>
    <description>The latest articles on DEV Community by Anish Basnet (@anishbasnetab).</description>
    <link>https://dev.to/anishbasnetab</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%2F4006981%2F9b686216-859e-4427-8fea-2db3ab54cd85.jpg</url>
      <title>DEV Community: Anish Basnet</title>
      <link>https://dev.to/anishbasnetab</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/anishbasnetab"/>
    <language>en</language>
    <item>
      <title>[Boost]</title>
      <dc:creator>Anish Basnet</dc:creator>
      <pubDate>Tue, 07 Jul 2026 16:06:48 +0000</pubDate>
      <link>https://dev.to/anishbasnetab/-oo1</link>
      <guid>https://dev.to/anishbasnetab/-oo1</guid>
      <description>&lt;div class="ltag__link--embedded"&gt;
  &lt;div class="crayons-story "&gt;
  &lt;a href="https://dev.to/anishbasnetab/big-tech-is-spending-725-billion-on-ai-this-year-who-actually-pays-for-it-4b46" class="crayons-story__hidden-navigation-link"&gt;Big Tech is spending $725 billion on AI this year. Who actually pays for it?&lt;/a&gt;


  &lt;div class="crayons-story__body crayons-story__body-full_post"&gt;
    &lt;div class="crayons-story__top"&gt;
      &lt;div class="crayons-story__meta"&gt;
        &lt;div class="crayons-story__author-pic"&gt;

          &lt;a href="/anishbasnetab" class="crayons-avatar  crayons-avatar--l  "&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%2Fuser%2Fprofile_image%2F4006981%2F9b686216-859e-4427-8fea-2db3ab54cd85.jpg" alt="anishbasnetab profile" class="crayons-avatar__image" width="460" height="460"&gt;
          &lt;/a&gt;
        &lt;/div&gt;
        &lt;div&gt;
          &lt;div&gt;
            &lt;a href="/anishbasnetab" class="crayons-story__secondary fw-medium m:hidden"&gt;
              Anish Basnet
            &lt;/a&gt;
            &lt;div class="profile-preview-card relative mb-4 s:mb-0 fw-medium hidden m:inline-block"&gt;
              
                Anish Basnet
                
              
              &lt;div id="story-author-preview-content-4082452" class="profile-preview-card__content crayons-dropdown branded-7 p-4 pt-0"&gt;
                &lt;div class="gap-4 grid"&gt;
                  &lt;div class="-mt-4"&gt;
                    &lt;a href="/anishbasnetab" class="flex"&gt;
                      &lt;span class="crayons-avatar crayons-avatar--xl mr-2 shrink-0"&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%2Fuser%2Fprofile_image%2F4006981%2F9b686216-859e-4427-8fea-2db3ab54cd85.jpg" class="crayons-avatar__image" alt="" width="460" height="460"&gt;
                      &lt;/span&gt;
                      &lt;span class="crayons-link crayons-subtitle-2 mt-5"&gt;Anish Basnet&lt;/span&gt;
                    &lt;/a&gt;
                  &lt;/div&gt;
                  &lt;div class="print-hidden"&gt;
                    
                      Follow
                    
                  &lt;/div&gt;
                  &lt;div class="author-preview-metadata-container"&gt;&lt;/div&gt;
                &lt;/div&gt;
              &lt;/div&gt;
            &lt;/div&gt;

          &lt;/div&gt;
          &lt;a href="https://dev.to/anishbasnetab/big-tech-is-spending-725-billion-on-ai-this-year-who-actually-pays-for-it-4b46" class="crayons-story__tertiary fs-xs"&gt;&lt;time&gt;Jul 6&lt;/time&gt;&lt;span class="time-ago-indicator-initial-placeholder"&gt;&lt;/span&gt;&lt;/a&gt;
        &lt;/div&gt;
      &lt;/div&gt;

    &lt;/div&gt;

    &lt;div class="crayons-story__indention"&gt;
      &lt;h2 class="crayons-story__title crayons-story__title-full_post"&gt;
        &lt;a href="https://dev.to/anishbasnetab/big-tech-is-spending-725-billion-on-ai-this-year-who-actually-pays-for-it-4b46" id="article-link-4082452"&gt;
          Big Tech is spending $725 billion on AI this year. Who actually pays for it?
        &lt;/a&gt;
      &lt;/h2&gt;
        &lt;div class="crayons-story__tags"&gt;
            &lt;a class="crayons-tag crayons-tag--filled  " href="/t/discuss"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;discuss&lt;/a&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/ai"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;ai&lt;/a&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/machinelearning"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;machinelearning&lt;/a&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/business"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;business&lt;/a&gt;
        &lt;/div&gt;
      &lt;div class="crayons-story__bottom"&gt;
        &lt;div class="crayons-story__details"&gt;
          &lt;a href="https://dev.to/anishbasnetab/big-tech-is-spending-725-billion-on-ai-this-year-who-actually-pays-for-it-4b46" class="crayons-btn crayons-btn--s crayons-btn--ghost crayons-btn--icon-left"&gt;
            &lt;div class="multiple_reactions_aggregate"&gt;
              &lt;span class="multiple_reactions_icons_container"&gt;
                  &lt;span class="crayons_icon_container"&gt;
                    &lt;img src="https://assets.dev.to/assets/sparkle-heart-5f9bee3767e18deb1bb725290cb151c25234768a0e9a2bd39370c382d02920cf.svg" width="24" height="24"&gt;
                  &lt;/span&gt;
              &lt;/span&gt;
              &lt;span class="aggregate_reactions_counter"&gt;1&lt;span class="hidden s:inline"&gt;&amp;nbsp;reaction&lt;/span&gt;&lt;/span&gt;
            &lt;/div&gt;
          &lt;/a&gt;
            &lt;a href="https://dev.to/anishbasnetab/big-tech-is-spending-725-billion-on-ai-this-year-who-actually-pays-for-it-4b46#comments" class="crayons-btn crayons-btn--s crayons-btn--ghost crayons-btn--icon-left flex items-center"&gt;
              

              &lt;span class="hidden s:inline"&gt;Add&amp;nbsp;Comment&lt;/span&gt;
            &lt;/a&gt;
        &lt;/div&gt;
        &lt;div class="crayons-story__save"&gt;
          &lt;small class="crayons-story__tertiary fs-xs mr-2"&gt;
            4 min read
          &lt;/small&gt;
            
              &lt;span class="bm-initial crayons-icon c-btn__icon"&gt;
                

              &lt;/span&gt;
              &lt;span class="bm-success crayons-icon c-btn__icon"&gt;
                

              &lt;/span&gt;
            
        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;/div&gt;


</description>
    </item>
    <item>
      <title>Bubble or not? The money loop, the token revolt, and why the AI demand is still real</title>
      <dc:creator>Anish Basnet</dc:creator>
      <pubDate>Mon, 06 Jul 2026 19:56:44 +0000</pubDate>
      <link>https://dev.to/anishbasnetab/bubble-or-not-the-money-loop-the-token-revolt-and-why-the-ai-demand-is-still-real-1o49</link>
      <guid>https://dev.to/anishbasnetab/bubble-or-not-the-money-loop-the-token-revolt-and-why-the-ai-demand-is-still-real-1o49</guid>
      <description>&lt;p&gt;In &lt;a href="https://dev.to/anishbasnetab/big-tech-is-spending-725-billion-on-ai-this-year-who-actually-pays-for-it-4b46"&gt;part one&lt;/a&gt; I laid out the two numbers that make this whole AI buildout feel like a dare. Big Tech spending around $725 billion in a single year, and JP Morgan's math saying the industry needs $650 billion in fresh revenue every year, forever, just to earn a 10 percent return. If you have not read that one, start there, because it sets up the stakes.&lt;/p&gt;

&lt;p&gt;This is the half where I stop describing the bet and start poking at whether it holds.&lt;/p&gt;

&lt;h2&gt;
  
  
  The money that keeps going in circles
&lt;/h2&gt;

&lt;p&gt;Here is where the bubble comparison gets sharp.&lt;/p&gt;

&lt;p&gt;A cluster of the biggest names in AI are investing in each other in ways that make demand look larger than it might actually be. Nvidia has committed money to OpenAI. OpenAI commits enormous sums to cloud providers like Oracle. Those providers turn around and buy Nvidia chips to build the capacity. Amazon invests in Anthropic, which runs heavily on Amazon's own cloud. By 2026, analysts had counted more than &lt;strong&gt;$800 billion&lt;/strong&gt; of these interlocking arrangements.&lt;/p&gt;

&lt;p&gt;Supporters call it a virtuous circle that locks in scarce supply. That is a fair reading. If you know demand is coming, tying up chips and capacity early is smart.&lt;/p&gt;

&lt;p&gt;Critics, including the investment firm GMO, see something else. It looks a lot like the vendor financing that inflated the internet bubble, where companies bought each other's services to make growth look organic right up until it did not. The deciding question is easy to say and hard to measure: how much of the revenue comes from real customers outside the circle?&lt;/p&gt;

&lt;p&gt;When one hundred billion dollars can show up as a chipmaker's revenue, a lab's funding, and a cloud's backlog all at once, the headline numbers stop meaning what they appear to mean. And when a single stalled negotiation between Nvidia and OpenAI rattled three of the largest companies in the world back in February, it was a reminder of how tightly wound this all is.&lt;/p&gt;

&lt;h2&gt;
  
  
  Enterprises noticed the bill
&lt;/h2&gt;

&lt;p&gt;Now the part that I think matters more than people realize.&lt;/p&gt;

&lt;p&gt;Through the first half of 2026, the companies actually buying AI at scale started saying out loud that it costs too much.&lt;/p&gt;

&lt;p&gt;The unit of AI is the token, the small chunk of text a model reads and writes. Agentic tools that plan and write code and click around burn through tokens frighteningly fast. As vendors move toward metered pricing, where you pay for exactly what you use, those bills started to sting.&lt;/p&gt;

&lt;p&gt;Then DeepSeek showed up. The Chinese lab's V4 Flash model runs at about $0.14 per million input tokens and $0.28 per million output tokens. In May it made a roughly 75 percent price cut to its heavier V4 Pro model permanent. At comparable context lengths, that lands somewhere between &lt;strong&gt;20 and 100 times cheaper&lt;/strong&gt; than the flagship Western models.&lt;/p&gt;

&lt;p&gt;The moment it got real was June, when reports surfaced that Microsoft was weighing a self hosted version of DeepSeek's V4 for parts of its Copilot lineup, specifically because token costs were pressuring the economics. When the company most deeply tied to OpenAI is quietly pricing a Chinese alternative, the cost problem is not hypothetical anymore.&lt;/p&gt;

&lt;h2&gt;
  
  
  But the demand is not imaginary
&lt;/h2&gt;

&lt;p&gt;It would be easy to stack all this up and call it a bubble. That would also be wrong, or at least incomplete, because the counterevidence is strong.&lt;/p&gt;

&lt;p&gt;Cloud revenue is genuinely surging. Google's cloud business grew more than 60 percent year over year in early 2026. Nvidia's data center revenue keeps setting records on real orders. And on the software side, the money is arriving faster than almost anyone guessed.&lt;/p&gt;

&lt;p&gt;Anthropic, the company behind Claude, passed OpenAI on annualized run rate in April 2026, reaching about $30 billion, up from roughly $9 billion at the end of 2025. Around 80 percent of that comes from enterprises and developers, not free consumers. The company projected its first operating profit as early as the second quarter. More than a thousand companies reportedly spend over a million dollars each, per year, on it.&lt;/p&gt;

&lt;p&gt;That is not the profile of hype. That is real workflows getting replaced by software that pays for itself.&lt;/p&gt;

&lt;p&gt;Meanwhile OpenAI is the counterweight. It booked about $13 billion in revenue in 2025 and hit roughly a $25 billion run rate by February 2026, which is impressive, and yet it is projected to lose around $14 billion this year, does not expect positive free cash flow until near the end of the decade, and has committed to enormous infrastructure obligations. It filed confidentially for an IPO in June. A business losing more than a dollar for every dollar it earns is asking public markets to fund years more of exactly that.&lt;/p&gt;

&lt;p&gt;Both things are true at the same time. The technology works, the revenue is real and growing fast, and the spending may still be running ahead of what near term returns can justify. Reality does not owe anyone a clean verdict.&lt;/p&gt;

&lt;h2&gt;
  
  
  So, where do I land?
&lt;/h2&gt;

&lt;p&gt;The most honest answer is the one JP Morgan buried in the same report with the eye watering numbers. Even if everything works, they wrote, there will be spectacular winners and probably equally spectacular losers, given the sheer amount of capital involved and the winner takes all nature of parts of this market.&lt;/p&gt;

&lt;p&gt;That is not a bubble call. It is something more useful. It says the real question is not whether AI is real. It is who survives the race to build it.&lt;/p&gt;

&lt;p&gt;History rhymes here. The railroads were transformative and also bankrupted a generation of the companies that laid the track. The fiber optic boom of the late 1990s wired the world for the internet age and wiped out the firms that overbuilt it. The internet itself changed everything, exactly as promised, several years after the market that bet on it crashed. Transformative technology and a brutal financial reckoning are not opposites. They tend to show up together.&lt;/p&gt;

&lt;p&gt;So here is what I would actually watch, as a developer and not a trader:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Free cash flow at the hyperscalers, as capex eats into it.&lt;/li&gt;
&lt;li&gt;Debt loads and credit spreads at the companies leaning hardest on borrowed money.&lt;/li&gt;
&lt;li&gt;Whether enterprise revenue keeps compounding once the novelty wears off and the token bills come due.&lt;/li&gt;
&lt;li&gt;How much of the demand comes from genuine outside customers, rather than the same dollars circling a small group of firms.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The tech is real. The revenue is real. Whether they justify $725 billion in a single year is the trillion dollar dare, and nobody actually knows the answer yet, not JP Morgan, not the CEOs, not the people writing confident takes in either direction.&lt;/p&gt;

&lt;p&gt;What we will find out, probably sooner than the timelines suggest, is not whether AI matters. It is which of the giants placing this bet are still standing when the bill comes.&lt;/p&gt;




&lt;p&gt;If you jumped straight here, go back and read &lt;strong&gt;&lt;a href="https://dev.to/anishbasnetab/big-tech-is-spending-725-billion-on-ai-this-year-who-actually-pays-for-it-4b46"&gt;part one&lt;/a&gt;&lt;/strong&gt; for the two numbers this whole thing rests on. It is the setup that makes this half land.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>machinelearning</category>
      <category>business</category>
      <category>discuss</category>
    </item>
    <item>
      <title>Big Tech is spending $725 billion on AI this year. Who actually pays for it?</title>
      <dc:creator>Anish Basnet</dc:creator>
      <pubDate>Mon, 06 Jul 2026 19:54:57 +0000</pubDate>
      <link>https://dev.to/anishbasnetab/big-tech-is-spending-725-billion-on-ai-this-year-who-actually-pays-for-it-4b46</link>
      <guid>https://dev.to/anishbasnetab/big-tech-is-spending-725-billion-on-ai-this-year-who-actually-pays-for-it-4b46</guid>
      <description>&lt;p&gt;There is a number going around tech right now that I genuinely cannot fit in my head.&lt;/p&gt;

&lt;p&gt;Amazon, Microsoft, Google and Meta plan to spend somewhere around &lt;strong&gt;$725 billion&lt;/strong&gt; on capital expenditure in 2026. Most of that is data centers, chips, and the power to run them. That figure is up roughly 77 percent from about $410 billion the year before, based on earnings figures compiled by the Financial Times.&lt;/p&gt;

&lt;p&gt;Read that again. It is not a plan for the decade. It is one year.&lt;/p&gt;

&lt;p&gt;I want to walk through where this money is going and who is supposed to pay it back, because once you sit with the second number in this story, the whole thing starts to feel less like a strategy and more like a dare.&lt;/p&gt;

&lt;h2&gt;
  
  
  A bet the size of a small economy
&lt;/h2&gt;

&lt;p&gt;The easy assumption is that spending like this cools off. It has not. If anything it is speeding up.&lt;/p&gt;

&lt;p&gt;JP Morgan's base case has more than &lt;strong&gt;$5 trillion&lt;/strong&gt; flowing into data centers and AI infrastructure worldwide over about five years. Annual funding needs climb from around $700 billion in 2026 toward roughly $1.4 trillion by 2030. Goldman Sachs has spent the whole year revising its own numbers upward and now models the four largest US hyperscalers spending on the order of $5.3 trillion between fiscal 2025 and 2030, up from an earlier $4.5 trillion.&lt;/p&gt;

&lt;p&gt;Here is the part that actually changes the story for me.&lt;/p&gt;

&lt;p&gt;For most of the last twenty years, the whole appeal of big software companies was that they made money without building much. Code scales for almost nothing. You write it once and ship it to a billion people. That was the magic.&lt;/p&gt;

&lt;p&gt;Now the model has flipped. These same companies are pouring hundreds of billions into concrete, transformers, cooling systems, and Nvidia chips. Amazon's free cash flow is projected to go negative this year because of it. When Meta raised its capex guidance in the spring, its stock dropped more than 9 percent in a single day. That was the first real moment where you could see investors flinch.&lt;/p&gt;

&lt;p&gt;So the spending is not in doubt. What happens next is.&lt;/p&gt;

&lt;h2&gt;
  
  
  The bill nobody wants to hold
&lt;/h2&gt;

&lt;p&gt;In late 2025, JP Morgan's strategists ran the math on the entire buildout. Their conclusion is the second number that makes the first one scary.&lt;/p&gt;

&lt;p&gt;To earn a modest 10 percent return on all this money going in, the industry would need about &lt;strong&gt;$650 billion of new revenue every single year&lt;/strong&gt;. Not once. On repeat, forever.&lt;/p&gt;

&lt;p&gt;The bank put it in terms you can actually feel. That is roughly 58 basis points of global GDP. It is the equivalent of every current iPhone user paying an extra $35 a month, or every Netflix subscriber handing over $180 a month, in perpetuity.&lt;/p&gt;

&lt;p&gt;Now, before anyone panics about their streaming bill, that is not the prediction. JP Morgan is clear that consumers will not foot this directly. The iPhone and Netflix lines are there to show you the scale, not to warn you that Netflix is about to cost two hundred bucks.&lt;/p&gt;

&lt;p&gt;The real theory is that businesses pay. Enterprises fold AI into healthcare, finance, manufacturing, and customer service, their workers and systems get productive enough to justify the cost, and that productivity becomes revenue that flows back to the people who built the infrastructure.&lt;/p&gt;

&lt;p&gt;That is the plan. It is a reasonable plan. It might even work.&lt;/p&gt;

&lt;p&gt;But there is a hole in it, and JP Morgan admits it themselves.&lt;/p&gt;

&lt;h2&gt;
  
  
  The gap they cannot close
&lt;/h2&gt;

&lt;p&gt;Even after counting everything on the table today, hyperscaler cash flow, high grade bonds, leveraged finance, and data center securitizations, the bank still finds a &lt;strong&gt;$1.4 trillion funding gap&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;That gap has to be filled by private credit, and possibly by government support if AI ends up folded into national defense spending.&lt;/p&gt;

&lt;p&gt;Sit with that for a second. The plan does not fund itself. The people modeling the plan know the plan does not fund itself. The bet is that the money will show up, that enterprises will turn AI into enough profit fast enough, and that private lenders will keep the taps open while everyone waits.&lt;/p&gt;

&lt;p&gt;That is a lot of faith stacked on top of a lot of concrete.&lt;/p&gt;

&lt;h2&gt;
  
  
  So is it a bubble?
&lt;/h2&gt;

&lt;p&gt;If you stop reading here, the honest answer is that it looks shaky. Free cash flow going negative, a trillion dollar hole, a return that depends entirely on a productivity story that has not fully arrived yet.&lt;/p&gt;

&lt;p&gt;But stopping here would be lazy, and it would give you the wrong picture.&lt;/p&gt;

&lt;p&gt;Because there is a whole other side to this. The revenue is genuinely showing up in places, faster than most people predicted. Enterprises are also starting to revolt over how much AI costs to actually run, and a cheap Chinese model is quietly reshaping the math. And there is a strange loop of money flowing between a small handful of companies that makes all this demand look bigger than it might really be.&lt;/p&gt;

&lt;p&gt;That is where this gets interesting, and honestly where I land on the whole bubble question.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;I broke that out into part two: &lt;a href="https://dev.to/anishbasnetab/bubble-or-not-the-money-loop-the-token-revolt-and-why-the-ai-demand-is-still-real-1o49"&gt;Bubble or not? The money loop, the token revolt, and why the demand is still real&lt;/a&gt;.&lt;/strong&gt; If part one convinced you this is doomed, part two is going to complicate that. And if it convinced you everything is fine, part two will complicate that too.&lt;/p&gt;

&lt;p&gt;Go read it. That is the half where I actually make up my mind.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>machinelearning</category>
      <category>business</category>
      <category>discuss</category>
    </item>
    <item>
      <title>I've relied on AI coding tools for a year. Here's the honest version.</title>
      <dc:creator>Anish Basnet</dc:creator>
      <pubDate>Mon, 06 Jul 2026 17:29:00 +0000</pubDate>
      <link>https://dev.to/anishbasnetab/ive-relied-on-ai-coding-tools-for-a-year-heres-the-honest-version-dhf</link>
      <guid>https://dev.to/anishbasnetab/ive-relied-on-ai-coding-tools-for-a-year-heres-the-honest-version-dhf</guid>
      <description>&lt;p&gt;Junior to junior. No hype, no doom. Just what a year of actually using these tools taught me.&lt;/p&gt;

&lt;h2&gt;
  
  
  Where they're great
&lt;/h2&gt;

&lt;p&gt;Boilerplate I've written a hundred times. Syntax in a language I barely know. The "wait, what's that method called again" moments. First drafts of tests. And the best one for me: taking a terrifying stack trace and explaining it back in plain English so I can stop panicking and start reading.&lt;/p&gt;

&lt;p&gt;For that stuff they save real time, and I'd fight to keep them.&lt;/p&gt;

&lt;h2&gt;
  
  
  Where they quietly cost me
&lt;/h2&gt;

&lt;p&gt;This one took a while to notice. I started accepting code that worked without understanding why it worked. It compiled, the tests passed, I moved on.&lt;/p&gt;

&lt;p&gt;Then a few weeks later a bug showed up in that same feature, and I sat there staring at code I technically wrote but couldn't actually reason about. It was never really mine. I'd shipped a stranger's solution with my name on the commit.&lt;/p&gt;

&lt;p&gt;That's the trap. On day one it doesn't feel like a problem. It feels like speed.&lt;/p&gt;

&lt;h2&gt;
  
  
  The rule I use now
&lt;/h2&gt;

&lt;p&gt;I don't paste anything I can't explain out loud.&lt;/p&gt;

&lt;p&gt;The AI can write the first draft. I have to earn the second one. If I can't walk through a block of code, line by line, in my own words, it doesn't go in. Sometimes that means I retype it slower. Sometimes it means I keep asking the AI to explain it until it clicks. Either way, the thinking stays with me.&lt;/p&gt;

&lt;h2&gt;
  
  
  The part people get wrong
&lt;/h2&gt;

&lt;p&gt;Companies are paying real money for these tools, somewhere in the $100 to $200 a month per developer range once you stack the premium seats. They're not a fad, and I'm not here to tell you to quit them.&lt;/p&gt;

&lt;p&gt;But for a junior, the danger was never that the AI writes bad code. The danger is that it lets you skip the exact thinking that turns you into an engineer. The struggling, the "why does this break," the slow build of a mental model in your head. That is the job. That's the part that makes you good.&lt;/p&gt;

&lt;p&gt;AI is great at handing you answers. It's bad at making you understand them. That gap is still yours to close.&lt;/p&gt;

&lt;p&gt;So I'm curious how other juniors are handling this. Where are you drawing the line for yourself?&lt;/p&gt;

&lt;h2&gt;
  
  
  ArtificialIntelligence #SoftwareDevelopment #Coding #JuniorDeveloper
&lt;/h2&gt;

</description>
      <category>ai</category>
      <category>beginners</category>
      <category>productivity</category>
      <category>programming</category>
    </item>
    <item>
      <title>A Banking API Is Not Just CRUD: What Building a Money-Movement Ledger Taught Me</title>
      <dc:creator>Anish Basnet</dc:creator>
      <pubDate>Sun, 28 Jun 2026 21:00:49 +0000</pubDate>
      <link>https://dev.to/anishbasnetab/a-banking-api-is-not-just-crud-what-building-a-money-movement-ledger-taught-me-4f7d</link>
      <guid>https://dev.to/anishbasnetab/a-banking-api-is-not-just-crud-what-building-a-money-movement-ledger-taught-me-4f7d</guid>
      <description>&lt;p&gt;I thought a banking API would be mostly CRUD.&lt;/p&gt;

&lt;p&gt;Make an account. Read a balance. Update a row. I had that working in a weekend with Spring Boot and Postgres, and for a moment I figured the project was basically done.&lt;/p&gt;

&lt;p&gt;Then I tried to actually move money from one account to another, and the easy part was over.&lt;/p&gt;

&lt;p&gt;This post is about the gap between &lt;em&gt;storing data&lt;/em&gt; and &lt;em&gt;moving money safely&lt;/em&gt;. That gap is the whole reason I built a personal project called &lt;strong&gt;Ledger-Core&lt;/strong&gt;, a money-movement REST API I made to learn backend correctness properly. It's not production software and I'm not going to pretend it is. But I wanted it to behave the way a real system has to, because that's where the interesting problems showed up.&lt;/p&gt;

&lt;p&gt;I'm a junior developer. I didn't know most of this when I started. Here are the problems that taught me, roughly in the order they punched me in the face.&lt;/p&gt;

&lt;h2&gt;
  
  
  Problem 1: Money and floating point don't mix
&lt;/h2&gt;

&lt;p&gt;The first thing I got wrong was the type I used for money.&lt;/p&gt;

&lt;p&gt;If you've never hit this, open a REPL in almost any language and try &lt;code&gt;0.1 + 0.2&lt;/code&gt;. You get &lt;code&gt;0.30000000000000004&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;That's not a bug. Floating point numbers (&lt;code&gt;float&lt;/code&gt;, &lt;code&gt;double&lt;/code&gt;) are just binary approximations, and a lot of normal decimal values can't be stored exactly. The errors are tiny. But they pile up, and "tiny error on someone's balance" is not a sentence you want to be explaining later.&lt;/p&gt;

&lt;p&gt;In Java the fix is &lt;code&gt;BigDecimal&lt;/code&gt; with a fixed scale. I store money as &lt;code&gt;NUMERIC(19,2)&lt;/code&gt; in Postgres and &lt;code&gt;BigDecimal&lt;/code&gt; with scale 2 in Java, the same way everywhere.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="nd"&gt;@Column&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"balance"&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="n"&gt;nullable&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="n"&gt;precision&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;19&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="n"&gt;scale&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
&lt;span class="kd"&gt;private&lt;/span&gt; &lt;span class="nc"&gt;BigDecimal&lt;/span&gt; &lt;span class="n"&gt;balance&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Two things bit me here.&lt;/p&gt;

&lt;p&gt;First, you compare with &lt;code&gt;compareTo&lt;/code&gt;, not &lt;code&gt;equals&lt;/code&gt;. &lt;code&gt;new BigDecimal("1.0").equals(new BigDecimal("1.00"))&lt;/code&gt; is &lt;code&gt;false&lt;/code&gt;, because &lt;code&gt;equals&lt;/code&gt; cares about scale. &lt;code&gt;compareTo&lt;/code&gt; returns &lt;code&gt;0&lt;/code&gt;. That one cost me a confusing afternoon staring at a failing test before I understood why.&lt;/p&gt;

&lt;p&gt;Second, pick your scale once and pin it. I call &lt;code&gt;.setScale(2)&lt;/code&gt; after every add and subtract, so a balance can't quietly drift to some other scale behind my back.&lt;/p&gt;

&lt;p&gt;Small stuff. But this was the first moment Ledger-Core stopped feeling like a CRUD app and started feeling like a system with rules.&lt;/p&gt;

&lt;h2&gt;
  
  
  Problem 2: Two requests at once can make money disappear
&lt;/h2&gt;

&lt;p&gt;This one humbled me, because every test I'd written was green.&lt;/p&gt;

&lt;p&gt;Picture an account with $100 in it, and two withdrawals of $80 landing at the exact same moment.&lt;/p&gt;

&lt;p&gt;With no concurrency control, both transactions read the balance as &lt;code&gt;100&lt;/code&gt;. Both ask "is 100 at least 80?" and both say yes. Both subtract and write back &lt;code&gt;20&lt;/code&gt;. One whole withdrawal just vanished, the account is now wrong, and $80 left the system that nothing can account for.&lt;/p&gt;

&lt;p&gt;This is the classic &lt;strong&gt;lost update&lt;/strong&gt; problem. The reason my tests never caught it is a little embarrassing: I was only ever sending one request at a time. Green tests told me nothing about what happens under pressure, because I'd never written the test that mattered.&lt;/p&gt;

&lt;p&gt;The fix I went with is &lt;strong&gt;optimistic locking&lt;/strong&gt;, and in JPA it's almost too easy to turn on. You add a version column to the entity:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="nd"&gt;@Version&lt;/span&gt;
&lt;span class="kd"&gt;private&lt;/span&gt; &lt;span class="nc"&gt;Long&lt;/span&gt; &lt;span class="n"&gt;version&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now every update checks the version. When Hibernate writes, it basically runs &lt;code&gt;UPDATE account SET balance = ?, version = version + 1 WHERE id = ? AND version = ?&lt;/code&gt;, where that last version is the one the transaction first read. If another transaction already changed the row, this update matches zero rows, and Hibernate throws an optimistic lock exception. The stale write gets thrown out instead of silently winning.&lt;/p&gt;

&lt;p&gt;What clicked for me is that there's no clever Java doing the detection. It's just SQL. An update with an old version matches nothing, and "zero rows updated" is the whole signal. The database does the work.&lt;/p&gt;

&lt;p&gt;I picked optimistic over pessimistic locking (&lt;code&gt;SELECT ... FOR UPDATE&lt;/code&gt;) on purpose. Optimistic assumes conflicts are rare and only costs you something when one actually happens, which fits a system that isn't getting hammered. Pessimistic holds a lock for the whole transaction, which is safer when one row is under constant fire but slows everything down. For this project, optimistic was the lighter choice.&lt;/p&gt;

&lt;p&gt;Then I wrote the test I should've written from day one: ten withdrawals fired at the same instant at an account that can only cover a few of them, lined up with a latch so they genuinely race instead of going one by one. When I ran it, exactly one succeeded, the rest got rejected, and the balance never went negative. Watching that pass taught me more than any blog post about isolation levels ever did.&lt;/p&gt;

&lt;p&gt;A green test is only as good as the cases it covers. Obvious when you write it down. Not obvious to me while I was happily watching my happy-path tests go green.&lt;/p&gt;

&lt;h2&gt;
  
  
  Problem 3: A retry can run the same transfer twice
&lt;/h2&gt;

&lt;p&gt;Here's a sequence that looks harmless until you actually think about it.&lt;/p&gt;

&lt;p&gt;A client sends a transfer. The server does the work. But the response gets lost on the way back, maybe a dropped connection or a timeout. The client never hears "success," so it does the reasonable thing and retries. Now the same transfer might run twice.&lt;/p&gt;

&lt;p&gt;This part surprised me the most. On a network, a request arriving &lt;em&gt;more than once&lt;/em&gt; is the normal case, not the weird edge case. You can't assume something happens exactly once, so the server has to be able to say "I've already done this one."&lt;/p&gt;

&lt;p&gt;The pattern is an &lt;strong&gt;idempotency key&lt;/strong&gt;. The client makes up a unique key and sends it as a header:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight http"&gt;&lt;code&gt;&lt;span class="err"&gt;POST /api/transfers
Idempotency-Key: 9f1c0a3e-1b77-4f2a-9b1e-2c4d5e6f7a8b
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;First time I see that key, I do the transfer and save the result against it. Next time the same key shows up, I skip the work entirely and just hand back the saved result. Money moves once.&lt;/p&gt;

&lt;p&gt;Two details I didn't get right the first time.&lt;/p&gt;

&lt;p&gt;The first was the race. Two copies of a retry can land at almost the same instant, both check "seen this key before?", both see no, and both go ahead. I fixed it the same way as the lost update: let the database referee it. The key has a unique constraint, so when two identical requests race, one insert wins and the other blows up on the constraint. Since that insert lives in the same transaction as the money movement, the loser's whole transaction rolls back. The money never moves twice, and I never had to babysit any of it in Java.&lt;/p&gt;

&lt;p&gt;The second detail was sneakier, and I'm a little proud I caught it. What if a client reuses the same key for a genuinely different request, same key but a different amount? If I just returned the saved result, I'd be reporting success for a transfer that never happened. So along with the key, I store a hash of the request itself. Same key plus same request means a real retry, so I replay the saved result. Same key plus a &lt;em&gt;different&lt;/em&gt; request means something is off, so I reject it loudly instead of guessing. The key on its own isn't enough. The key plus a fingerprint of what it was for is what makes it safe.&lt;/p&gt;

&lt;h2&gt;
  
  
  Problem 4: A &lt;code&gt;balance&lt;/code&gt; column can't tell you the truth
&lt;/h2&gt;

&lt;p&gt;My first instinct was one &lt;code&gt;balance&lt;/code&gt; column I could read and update. It's the obvious move, and it works right up until someone asks a question you can't answer: how did this balance get to this number?&lt;/p&gt;

&lt;p&gt;A column has no memory. It holds today's value and nothing about how it got there. If a balance looks wrong, there's no trail to follow and nothing to audit.&lt;/p&gt;

&lt;p&gt;So I moved Ledger-Core to an &lt;strong&gt;append-only, double-entry ledger&lt;/strong&gt;, and it's the decision I'm most glad I made.&lt;/p&gt;

&lt;p&gt;The idea is that money never just "moves." Every transfer is two entries, a debit on one account and a credit on another, that add up to zero. A $50 transfer from A to B writes a &lt;code&gt;DEBIT&lt;/code&gt; of 50 against A and a &lt;code&gt;CREDIT&lt;/code&gt; of 50 against B. Entries are append-only, so nothing ever gets updated or deleted. A correction is a brand new entry, never an edit.&lt;/p&gt;

&lt;p&gt;This caused a problem I didn't see coming, and figuring it out is where I feel like I finally got double-entry. A transfer between two of my accounts balances on its own, one debit and one credit. But what about a deposit? Money shows up from outside, so the customer gets a credit, but where does the matching debit go? If there's no other side, the books don't balance and the whole idea falls apart.&lt;/p&gt;

&lt;p&gt;The answer real ledgers use is a &lt;strong&gt;system settlement account&lt;/strong&gt;. A deposit is really a transfer &lt;em&gt;from&lt;/em&gt; the bank's settlement account &lt;em&gt;to&lt;/em&gt; the customer. The customer is credited, the settlement account is debited, and the books stay balanced. That settlement account is allowed to go negative, because a negative there isn't a bug, it's the bank correctly tracking how much it owes its depositors in total. Modeling that was the moment double-entry stopped being a thing I'd read about and became a thing I understood.&lt;/p&gt;

&lt;p&gt;To actually make the ledger untouchable, I dropped below the application. I added a Postgres trigger that rejects any &lt;code&gt;UPDATE&lt;/code&gt; or &lt;code&gt;DELETE&lt;/code&gt; on the ledger table. Inserts still work, so history can grow, but nothing can be changed or erased, not from a raw &lt;code&gt;psql&lt;/code&gt; session, not even by me. Append-only stops being a promise I make and becomes a rule the database enforces on everyone, including its author.&lt;/p&gt;

&lt;p&gt;The payoff is auditability. The ledger is the source of truth, and the balance is just a fast cached view of it that I keep in sync inside the same transaction. If the two ever disagree, the ledger wins, and I can rebuild any balance from scratch by replaying its entries.&lt;/p&gt;

&lt;h2&gt;
  
  
  Problem 5: How do you actually know the books are right?
&lt;/h2&gt;

&lt;p&gt;Keeping a cached balance and a ledger in sync sounds fine until you ask the obvious next question. What if they drift apart anyway, because of a bug I haven't found yet?&lt;/p&gt;

&lt;p&gt;So I built a &lt;strong&gt;reconciliation job&lt;/strong&gt;. It's a scheduled task that walks every account, recomputes the real balance from the ledger, compares it to the stored balance, and records a "break" for any account where the two don't match. It doesn't quietly fix anything, because quietly fixing a mismatch would erase the evidence that something went wrong. It detects and it reports. That's what a real end-of-day reconciliation does.&lt;/p&gt;

&lt;p&gt;And then it caught something real.&lt;/p&gt;

&lt;p&gt;The first time I ran it against my own dev database, it flagged seventeen accounts whose stored balance didn't match their ledger. For a second I thought the job was broken. It wasn't. Those accounts were leftovers from early in the project, before the double-entry refactor, when my deposit code was still writing balances without full ledger entries. The job was correctly catching damage left behind by an older, buggier version of my own code.&lt;/p&gt;

&lt;p&gt;That was the moment the whole project clicked for me. I'd built the thing that catches wrong numbers, and it caught &lt;em&gt;my&lt;/em&gt; wrong numbers before I even went looking. A break doesn't tell you which number is right, only that two of them disagree, and working out which one to trust is its own little investigation. That's the real job reconciliation does, and I got to do it for real, on my own data.&lt;/p&gt;

&lt;h2&gt;
  
  
  What actually ties all of this together: invariants
&lt;/h2&gt;

&lt;p&gt;Looking back, every one of these was the same problem in a different outfit.&lt;/p&gt;

&lt;p&gt;CRUD is about storing data correctly. Moving money is about protecting invariants when things go wrong: when requests retry, when they land at the same instant, when a connection dies halfway through.&lt;/p&gt;

&lt;p&gt;The invariants Ledger-Core protects are small and specific. A balance is always exact, no floating-point drift. The same transfer never applies twice. A withdrawal never reads a stale balance and overdraws. Every transfer's entries sum to zero, the ledger can never be altered, and a separate job keeps checking that the books still balance.&lt;/p&gt;

&lt;p&gt;Once I started thinking in invariants instead of features, the design got easier, because every new feature now had to answer one thing: what could go wrong here, and what keeps this true?&lt;/p&gt;

&lt;h2&gt;
  
  
  Where I'm at, and what's next
&lt;/h2&gt;

&lt;p&gt;I built Ledger-Core slowly, one guarantee at a time, and I wouldn't let myself move on from a piece until I had a test that actually proved the property held. The slow pace was the point. I didn't want to assemble a system I couldn't explain. I wanted to understand one.&lt;/p&gt;

&lt;p&gt;There's stuff I've deliberately left for later, and knowing what you &lt;em&gt;haven't&lt;/em&gt; done yet feels like part of the job too. The big one is auth. Right now the endpoints are open, which is fine for a demo I label as a demo, but a real money API has to know who you are and stop you from touching accounts that aren't yours. That's the next phase I'm building.&lt;/p&gt;

&lt;p&gt;If you've worked on payment, ledger, or banking systems for real, I'd genuinely like to hear how you handle retries and concurrency in production, and anything I got subtly wrong above. I'm a junior dev learning this on purpose, and a correction from someone who's actually shipped it is worth more to me than any tutorial.&lt;/p&gt;

&lt;p&gt;This is the kind of backend work I want to grow into. The kind where correctness isn't a nice-to-have. It's the whole product.&lt;/p&gt;

</description>
      <category>java</category>
      <category>fintech</category>
      <category>springboot</category>
    </item>
  </channel>
</rss>
