<?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: Jakub Stetz</title>
    <description>The latest articles on DEV Community by Jakub Stetz (@jakubstetz).</description>
    <link>https://dev.to/jakubstetz</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%2F3073835%2F2710f66d-4b88-422a-8c18-bf60cc237e5a.jpeg</url>
      <title>DEV Community: Jakub Stetz</title>
      <link>https://dev.to/jakubstetz</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/jakubstetz"/>
    <language>en</language>
    <item>
      <title>Productivity with AI: A Double-Edged Boost</title>
      <dc:creator>Jakub Stetz</dc:creator>
      <pubDate>Thu, 12 Jun 2025 16:06:50 +0000</pubDate>
      <link>https://dev.to/jakubstetz/productivity-with-ai-a-double-edged-boost-3a9j</link>
      <guid>https://dev.to/jakubstetz/productivity-with-ai-a-double-edged-boost-3a9j</guid>
      <description>&lt;p&gt;Over the past few months, I've become increasingly effective at using ChatGPT as a coding partner. My productivity has skyrocketed, and I've been learning new things at a rapid pace.&lt;/p&gt;

&lt;p&gt;A few days ago, based on a friend's recommendation, I downloaded and started using &lt;a href="https://www.cursor.com/" rel="noopener noreferrer"&gt;Cursor&lt;/a&gt;. I've been playing around with it, and having deep AI integration right in my code editor has been a game changer. The speed at which I can scaffold projects, add features, and iterate has surged once again.&lt;/p&gt;

&lt;p&gt;But this has also reinforced a principle that’s already become deeply ingrained in me from my work with ChatGPT:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;AI is a powerful tool, but it doesn't replace genuine knowledge, skills, and thoughtfulness.&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  ⚠️ The Limitations of AI
&lt;/h2&gt;

&lt;p&gt;Often, when I ask Cursor to generate code, that code looks polished and impressive — but:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;...it’s poorly integrated with the rest of my project,&lt;/li&gt;
&lt;li&gt;...it’s redundant or overengineered,&lt;/li&gt;
&lt;li&gt;...or it introduces subtle bugs that didn’t exist before.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This isn't a dig at Cursor. I actually appreciate these moments. They give me a chance to notice flaws, refine logic, and sharpen my critical thinking.&lt;/p&gt;

&lt;p&gt;Reviewing my own code is one thing. But reviewing 50 lines of beautiful AI-generated code — and resisting the urge to just accept it — requires even more discipline and discernment because of how easy it is to simply leave it as is and move on.&lt;/p&gt;




&lt;h2&gt;
  
  
  🧠 The Real Multiplier: Staying Engaged
&lt;/h2&gt;

&lt;p&gt;Over time, I’ve come to see there’s a massive difference between using GenAI passively and using it &lt;em&gt;collaboratively&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;If I use AI passively, I   get a 5x productivity gain — I can deploy faster, finish tickets quicker, and move on to the next task.&lt;/p&gt;

&lt;p&gt;But even that 5x is often deceptive. The code might compile and the features might work, but the foundations are fragile. Rushed output often hides subtle bugs, poor structure, and short-sighted decisions — cracks I won’t notice until they cause friction later on, or worse, break in production.&lt;/p&gt;

&lt;p&gt;On the other hand, when I stay fully engaged — reading critically, reviewing suggestions carefully, questioning the structure — that 5x productivity boost becomes 10x. I not only move faster but also greatly reduce how much debugging and backtracking I need to do later on.&lt;/p&gt;

&lt;p&gt;The key is to keep my brain in the loop — and to keep learning. Whether it’s brushing up on design patterns, understanding performance tradeoffs, or deepening my knowledge of the frameworks I’m working with, skill development is what turns AI from a shortcut into a force multiplier.&lt;/p&gt;




&lt;h2&gt;
  
  
  🔍 Learning By Example
&lt;/h2&gt;

&lt;p&gt;One of my friends, a senior software engineer, told me she’s often slower than her peers in submitting code, because they use GenAI to fly through tickets whereas she works more carefully.&lt;/p&gt;

&lt;p&gt;But when code reviews come, their pull requests get kicked back, and hers glide through. By stepping through logic, checking for edge cases, and making sure everything aligns cleanly with the existing codebase, she does more work in the moment but eliminates unproductive back-and-forth and iteration down the line.&lt;/p&gt;

&lt;p&gt;Her reflection stuck with me. Productivity isn’t just about shipping fast. It’s about how much rework I avoid, and the long-term quality of my contributions.&lt;/p&gt;




&lt;h2&gt;
  
  
  🧘‍♂️ Where I Stand
&lt;/h2&gt;

&lt;p&gt;So that’s where I am today: deeply appreciative of GenAI, but even more grateful for the thoughtfulness, discipline, and wisdom that I’ve developed through using it with intention — and through actively building my own knowledge and skills along the way.&lt;/p&gt;

&lt;p&gt;I’m a big fan of AI-assisted development. I could talk for hours about how transformative it’s been. But I never let AI overshadow the values that guide my software practice: clarity, care, and craft.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>programming</category>
      <category>productivity</category>
      <category>cursor</category>
    </item>
    <item>
      <title>Not All CORS Errors Are CORS Errors</title>
      <dc:creator>Jakub Stetz</dc:creator>
      <pubDate>Tue, 22 Apr 2025 16:27:37 +0000</pubDate>
      <link>https://dev.to/jakubstetz/not-all-cors-errors-are-cors-errors-njn</link>
      <guid>https://dev.to/jakubstetz/not-all-cors-errors-are-cors-errors-njn</guid>
      <description>&lt;p&gt;&lt;strong&gt;The Debugging Tale of a Backend Crash Disguised as a Frontend Mystery&lt;/strong&gt;&lt;/p&gt;




&lt;p&gt;Last night, I lost three hours of my life to a single error message:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;code&gt;...blocked by CORS policy: No ‘Access-Control-Allow-Origin’ header is present...&lt;/code&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;If you’ve worked with frontend-backend communication across origins, you’ve probably met the dreaded CORS error. It’s like a rite of passage—an error message that usually means you forgot to set the right headers or misconfigured CORS middleware.&lt;/p&gt;

&lt;p&gt;Except… sometimes it &lt;em&gt;doesn’t&lt;/em&gt; mean that.&lt;/p&gt;




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

&lt;p&gt;I was building out a résumé analysis app using a &lt;strong&gt;React frontend&lt;/strong&gt; (Vite) and a &lt;strong&gt;FastAPI backend&lt;/strong&gt;, with a couple of AI models running under the hood. The backend was fully implemented and the UI laid out—I was just wiring up the frontend to hit my API.&lt;/p&gt;

&lt;p&gt;I had three API endpoints that I wanted to reach with my frontend:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;POST /upload-resume
POST /upload-job
POST /analyze
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Also, I'd already configured CORS in FastAPI:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;add_middleware&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;CORSMiddleware&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;allow_origins&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;http://localhost:5173&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
    &lt;span class="n"&gt;allow_credentials&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="bp"&gt;True&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;allow_methods&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;*&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
    &lt;span class="n"&gt;allow_headers&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;*&lt;/span&gt;&lt;span class="sh"&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;I tested my upload endpoints, and everything worked fine. I could see in my server console that I was getting &lt;code&gt;200 OK&lt;/code&gt; responses from my API, and I could see in DevTools that my React components were properly storing the returned data.&lt;/p&gt;

&lt;p&gt;When I implemented an API call to my &lt;code&gt;/analyze&lt;/code&gt; route however, I got a CORS error. When that happened, I assumed I’d messed up the config.&lt;/p&gt;

&lt;p&gt;But everything &lt;em&gt;looked right&lt;/em&gt;. Through a litany of console log statements and DevTools analysis I triple-checked:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Allowed origins were properly listed.&lt;/li&gt;
&lt;li&gt;Middleware was active.&lt;/li&gt;
&lt;li&gt;My request was well-formed.&lt;/li&gt;
&lt;li&gt;The network tab even showed the request reaching the server and being processed.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Still: &lt;em&gt;CORS error&lt;/em&gt;.&lt;/p&gt;




&lt;h3&gt;
  
  
  🕵️ The Clue
&lt;/h3&gt;

&lt;p&gt;What eventually tipped me off was this: &lt;strong&gt;other endpoints worked&lt;/strong&gt;. Same domain. Same headers. Only &lt;code&gt;/analyze&lt;/code&gt; was choking.&lt;/p&gt;

&lt;p&gt;I was baffled—why would only some routes throw a CORS error? That inconsistency turned out to be the key. Once I had triple-checked that my CORS middleware was set up properly, I honed in on the backend implementation of the &lt;code&gt;/analyze&lt;/code&gt; endpoint.&lt;/p&gt;

&lt;p&gt;I tried a simple experiment. I stripped out all the logic from &lt;code&gt;/analyze&lt;/code&gt; and replaced it with a plain string return.&lt;/p&gt;

&lt;p&gt;It worked. No CORS error.&lt;/p&gt;

&lt;p&gt;Interesting.&lt;/p&gt;




&lt;h3&gt;
  
  
  💥 The Real Problem
&lt;/h3&gt;

&lt;p&gt;I felt a thrill and relief from getting closer to the issue. Turns out the issue had &lt;em&gt;nothing&lt;/em&gt; to do with CORS, but rather had something to do with my function implementation.&lt;/p&gt;

&lt;p&gt;Specifically, my handler was returning a dictionary that included an &lt;strong&gt;embedding from a machine learning model&lt;/strong&gt;. This embedding was a NumPy array, which—unbeknownst to me—contained &lt;code&gt;numpy.float32&lt;/code&gt; and &lt;code&gt;numpy.int64&lt;/code&gt; values.&lt;/p&gt;

&lt;p&gt;What surprised me is that NumPy floats and ints &lt;em&gt;look&lt;/em&gt; like native Python floats and ints, but they aren’t. FastAPI (via &lt;code&gt;JSONResponse&lt;/code&gt; or its default encoder) expects standard Python types—and NumPy’s versions aren’t JSON-serializable out of the box, meaning they can’t be converted into JSON.&lt;/p&gt;

&lt;p&gt;Therefore, when FastAPI encountered these NumPy-specific numeric types, it quietly failed to serialize them. The result? A &lt;code&gt;500 Internal Server Error&lt;/code&gt;, which aborted the response entirely.&lt;/p&gt;

&lt;p&gt;Because the response never completed, the browser didn’t receive any CORS headers—so it flagged the issue as a CORS error, even though the real problem was deep in the backend.&lt;/p&gt;

&lt;p&gt;Once I converted the NumPy floats and ints to standard Python types using &lt;code&gt;float(x)&lt;/code&gt; and &lt;code&gt;int(x)&lt;/code&gt;, everything worked fine.&lt;/p&gt;




&lt;h3&gt;
  
  
  ‼️ The Core Takeaway
&lt;/h3&gt;

&lt;p&gt;&lt;em&gt;Not all CORS errors are CORS errors.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;When FastAPI is unable to serialize data into JSON, the server crashes.&lt;/p&gt;

&lt;p&gt;When the server crashes, no response is returned to the frontend.&lt;/p&gt;

&lt;p&gt;And when no response is returned, naturally the frontend never receives the CORS headers that it expects. Therefore it registers a CORS error, even though CORS has nothing to do with the issue.&lt;/p&gt;

&lt;p&gt;In summary: &lt;strong&gt;A backend server crash may register as a CORS error in the frontend.&lt;/strong&gt;&lt;/p&gt;




&lt;h3&gt;
  
  
  📚 Lessons Learned
&lt;/h3&gt;

&lt;h4&gt;
  
  
  ✍️ &lt;em&gt;Not all CORS errors are CORS errors&lt;/em&gt;
&lt;/h4&gt;

&lt;p&gt;Sometimes they're just backend failures with a CORS costume.&lt;/p&gt;

&lt;h4&gt;
  
  
  ✍️ &lt;em&gt;Isolate ruthlessly&lt;/em&gt;
&lt;/h4&gt;

&lt;p&gt;Strip endpoints down to echoes. Meticulously track what's been verified to work. Rebuild upward until it breaks again.&lt;/p&gt;

&lt;h4&gt;
  
  
  ✍️ &lt;em&gt;DevTools and print statements beat intuition&lt;/em&gt;
&lt;/h4&gt;

&lt;p&gt;Real data &amp;gt; vibes-based debugging.&lt;/p&gt;

&lt;h4&gt;
  
  
  ✍️ &lt;em&gt;ChatGPT is a powerful tool, but never replaces thoughtful debugging&lt;/em&gt;
&lt;/h4&gt;

&lt;p&gt;It’s great for rubber-ducking, research, and writing helpers—but when it comes to debugging gnarly issues in a live system, you’re better off with print statements, DevTools, and your own patience. There's no shortcut to robust development.&lt;/p&gt;

&lt;h4&gt;
  
  
  ✍️ &lt;em&gt;Serialization matters&lt;/em&gt;
&lt;/h4&gt;

&lt;p&gt;NumPy floats and ints &lt;em&gt;look&lt;/em&gt; like native Python types, but they aren’t—and FastAPI can’t serialize them. This subtle mismatch caused the backend to crash without warning. Always convert NumPy types before returning them in a response.&lt;/p&gt;

&lt;h4&gt;
  
  
  ✍️ &lt;em&gt;Experience is a brutal but effective teacher&lt;/em&gt;
&lt;/h4&gt;

&lt;p&gt;I felt totally drained by this debugging session, but I also feel grateful for having learned a subtle lesson that I'll never forget. This is the kind of wisdom and experience that's hard-fought, and which distinguishes hobbyist programmers from true &lt;em&gt;engineers&lt;/em&gt;.&lt;/p&gt;




&lt;h3&gt;
  
  
  🧠 Reflections
&lt;/h3&gt;

&lt;p&gt;I’ve been learning software development seriously for just over a year now, and moments like this remind me how much of engineering is earned through experience—not tutorials. There was no trick, no clever insight—just me, a browser console, and a backend silently crashing.&lt;/p&gt;

&lt;p&gt;The whole saga was humbling and mentally draining—but honestly, I feel grateful. This kind of grind is where real engineering experience is forged.&lt;/p&gt;

&lt;p&gt;Now that I’ve got this scar, maybe someone else won’t need to get the same one.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>fastapi</category>
      <category>react</category>
      <category>learning</category>
    </item>
  </channel>
</rss>
