<?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: Pavitha P</title>
    <description>The latest articles on DEV Community by Pavitha P (@pavi10).</description>
    <link>https://dev.to/pavi10</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%2F3298788%2Fe9a4a36a-70cd-4ded-9b32-6a6f5c629979.jpg</url>
      <title>DEV Community: Pavitha P</title>
      <link>https://dev.to/pavi10</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/pavi10"/>
    <language>en</language>
    <item>
      <title>That One Python List Bug That Wasted My Time 😅</title>
      <dc:creator>Pavitha P</dc:creator>
      <pubDate>Wed, 24 Dec 2025 02:29:38 +0000</pubDate>
      <link>https://dev.to/pavi10/that-one-python-list-bug-that-wasted-my-time-2hh3</link>
      <guid>https://dev.to/pavi10/that-one-python-list-bug-that-wasted-my-time-2hh3</guid>
      <description>&lt;p&gt;I recently ran into a weird Python bug while solving a problem that needed a 2D list.&lt;br&gt;
Everything &lt;em&gt;looked&lt;/em&gt; correct, but the output was completely wrong.&lt;/p&gt;

&lt;p&gt;Turns out, it was &lt;strong&gt;this one line&lt;/strong&gt;:&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;index&lt;/span&gt; &lt;span class="o"&gt;=&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="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]]&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you’ve written Python for a while, you might already know where this is going.&lt;/p&gt;




&lt;h2&gt;
  
  
  What I Thought This Did
&lt;/h2&gt;

&lt;p&gt;I thought this would create &lt;code&gt;n&lt;/code&gt; rows, each with &lt;code&gt;[0, 0]&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Something like:&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="p"&gt;[&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="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;],&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="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;],&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="mi"&gt;0&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;Reasonable assumption.&lt;br&gt;
Totally wrong assumption.&lt;/p&gt;


&lt;h2&gt;
  
  
  What It Actually Does
&lt;/h2&gt;

&lt;p&gt;Python doesn’t create &lt;code&gt;n&lt;/code&gt; separate lists here.&lt;/p&gt;

&lt;p&gt;It creates &lt;strong&gt;one list&lt;/strong&gt; &lt;code&gt;[0, 0]&lt;/code&gt;&lt;br&gt;
and then repeats the &lt;strong&gt;reference&lt;/strong&gt; to it &lt;code&gt;n&lt;/code&gt; times.&lt;/p&gt;

&lt;p&gt;So all rows point to the &lt;strong&gt;same object&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Here’s the proof:&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;index&lt;/span&gt; &lt;span class="o"&gt;=&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="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]]&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;
&lt;span class="n"&gt;index&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="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;7&lt;/span&gt;
&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;index&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Output:&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="p"&gt;[[&lt;/span&gt;&lt;span class="mi"&gt;7&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="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;7&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="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;7&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;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I changed one value… and every row changed.&lt;br&gt;
That’s when I knew something was off.&lt;/p&gt;


&lt;h2&gt;
  
  
  Why This Happens
&lt;/h2&gt;

&lt;p&gt;The &lt;code&gt;*&lt;/code&gt; operator does a &lt;strong&gt;shallow copy&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Internally, Python is basically doing:&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;index&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;same_list&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;same_list&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;same_list&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;So modifying one row means modifying all of them.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Fix (And the Right Way)
&lt;/h2&gt;

&lt;p&gt;The correct way is using a list comprehension:&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;index&lt;/span&gt; &lt;span class="o"&gt;=&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="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;_&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="nf"&gt;range&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="p"&gt;)]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This creates &lt;strong&gt;new lists every time&lt;/strong&gt;, not shared ones.&lt;/p&gt;

&lt;p&gt;Quick check:&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;index&lt;/span&gt; &lt;span class="o"&gt;=&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="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;_&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="nf"&gt;range&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;)]&lt;/span&gt;
&lt;span class="n"&gt;index&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="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;7&lt;/span&gt;
&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;index&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Output:&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="p"&gt;[[&lt;/span&gt;&lt;span class="mi"&gt;7&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="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="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;],&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="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Exactly what we want.&lt;/p&gt;




&lt;h2&gt;
  
  
  When &lt;code&gt;*&lt;/code&gt; Is Actually Fine
&lt;/h2&gt;

&lt;p&gt;Using &lt;code&gt;*&lt;/code&gt; is totally okay with &lt;strong&gt;immutable values&lt;/strong&gt;:&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;arr&lt;/span&gt; &lt;span class="o"&gt;=&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="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;   &lt;span class="c1"&gt;# perfectly fine
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The problem only starts when you use it with &lt;strong&gt;nested mutable objects&lt;/strong&gt; like lists.&lt;/p&gt;

</description>
      <category>programming</category>
      <category>datastructures</category>
      <category>coding</category>
      <category>bug</category>
    </item>
    <item>
      <title>🚀 StoryCloak – Looking for Developer Feedback &amp; Suggestions 🙌</title>
      <dc:creator>Pavitha P</dc:creator>
      <pubDate>Sun, 10 Aug 2025 08:29:36 +0000</pubDate>
      <link>https://dev.to/pavi10/storycloak-looking-for-developer-feedback-suggestions-23fl</link>
      <guid>https://dev.to/pavi10/storycloak-looking-for-developer-feedback-suggestions-23fl</guid>
      <description>&lt;p&gt;Hey Dev Community! 👋&lt;/p&gt;

&lt;p&gt;I just finished building my very first Flask project StoryCloak — a secure, full-featured web app for sharing microstories.&lt;br&gt;
While I’m super excited about it, I know there’s always room for improvement, and that’s why I’m here:&lt;/p&gt;

&lt;p&gt;I’d love to get feedback from fellow developers — on the code, structure, features, or even the UI/UX.&lt;/p&gt;




&lt;p&gt;🌐 Try it here:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://storycloak.onrender.com" rel="noopener noreferrer"&gt;https://storycloak.onrender.com&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;📂 GitHub Repo: &lt;a href="https://github.com/pavithapari/StoryCloak" rel="noopener noreferrer"&gt;https://github.com/pavithapari/StoryCloak&lt;/a&gt;&lt;/p&gt;




&lt;p&gt;🔹 What’s Inside&lt;/p&gt;

&lt;p&gt;User authentication with email confirmation&lt;/p&gt;

&lt;p&gt;Secure password hashing &amp;amp; login system&lt;/p&gt;

&lt;p&gt;Flask-Migrate for smooth DB migrations&lt;/p&gt;

&lt;p&gt;Organized, scalable project structure&lt;/p&gt;

&lt;p&gt;Bootstrap + HTML + CSS for frontend&lt;/p&gt;

&lt;p&gt;SQLAlchemy ORM for database handling&lt;/p&gt;

&lt;p&gt;PostgreSQL for production (hosted on Render)&lt;/p&gt;

&lt;p&gt;Deployed on Render’s free tier&lt;/p&gt;




&lt;p&gt;🎯 What I’m Looking for Feedback On&lt;/p&gt;

&lt;p&gt;Code structure: Is it organized enough for long-term scaling?&lt;/p&gt;

&lt;p&gt;Database design: Any optimizations or pitfalls you see?&lt;/p&gt;

&lt;p&gt;Security: Did I miss any best practices?&lt;/p&gt;

&lt;p&gt;UI/UX: Is it smooth and user-friendly?&lt;/p&gt;

&lt;p&gt;Feature suggestions: What would make the app more engaging?&lt;/p&gt;




&lt;p&gt;💬 I’m open to any constructive criticism — the goal is to make StoryCloak better while also leveling up my own skills as a backend developer.&lt;/p&gt;

&lt;p&gt;If you have a moment, please:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Try the app&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Share a story or note&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Let me know what you think in the comments!&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;#flask #python #backend #webdevelopment #projectfeedback #learninginpublic&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>beginners</category>
      <category>sideprojects</category>
      <category>programming</category>
    </item>
    <item>
      <title>PRG pattern</title>
      <dc:creator>Pavitha P</dc:creator>
      <pubDate>Sat, 12 Jul 2025 14:17:44 +0000</pubDate>
      <link>https://dev.to/pavi10/prg-pattern-5g8i</link>
      <guid>https://dev.to/pavi10/prg-pattern-5g8i</guid>
      <description>&lt;h1&gt;
  
  
  🌀 Demystifying POST–REDIRECT–GET in Flask
&lt;/h1&gt;

&lt;p&gt;Ever submitted a form in your Flask app and then hit refresh—only to get a browser warning about resending data? Welcome to the world of &lt;strong&gt;POST resubmission&lt;/strong&gt;, a sneaky little side effect that’s solved beautifully by the &lt;strong&gt;Post–Redirect–Get (PRG)&lt;/strong&gt; pattern.&lt;/p&gt;

&lt;p&gt;Let’s break it down 👇&lt;/p&gt;




&lt;h2&gt;
  
  
  📬 The Problem with POST: Form Resubmission
&lt;/h2&gt;

&lt;p&gt;Imagine this flow:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;User fills out a form (e.g., update profile).&lt;/li&gt;
&lt;li&gt;You handle the form with &lt;code&gt;POST&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;You use &lt;code&gt;render_template()&lt;/code&gt; to show the dashboard directly.&lt;/li&gt;
&lt;li&gt;Then... the user &lt;strong&gt;refreshes&lt;/strong&gt; the page.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;🔁 Result: The browser &lt;strong&gt;resubmits the form&lt;/strong&gt;, triggering a second POST!&lt;/p&gt;

&lt;p&gt;This can:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Cause duplicate database writes&lt;/li&gt;
&lt;li&gt;Repeat email or username changes&lt;/li&gt;
&lt;li&gt;Show misleading flash messages again&lt;/li&gt;
&lt;li&gt;Annoy users with &lt;em&gt;“Confirm form resubmission”&lt;/em&gt; alerts&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  ✅ Enter the Hero: Post–Redirect–Get (PRG)
&lt;/h2&gt;

&lt;p&gt;Instead of rendering the updated page right after the &lt;code&gt;POST&lt;/code&gt;, PRG introduces a &lt;strong&gt;redirect step&lt;/strong&gt; so the browser only refreshes with a safe &lt;code&gt;GET&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;PRG flow:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;POST → Redirect → GET
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  ✨ Example: Updating Profile
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="nd"&gt;@app.route&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;/account&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;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;GET&lt;/span&gt;&lt;span class="sh"&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;POST&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;
&lt;span class="nd"&gt;@login_required&lt;/span&gt;
&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;account&lt;/span&gt;&lt;span class="p"&gt;():&lt;/span&gt;
    &lt;span class="n"&gt;form&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;UpdateProfileForm&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;form&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;validate_on_submit&lt;/span&gt;&lt;span class="p"&gt;():&lt;/span&gt;
        &lt;span class="n"&gt;current_user&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;username&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;form&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;username&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;data&lt;/span&gt;
        &lt;span class="n"&gt;current_user&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;email&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;form&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;email&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;data&lt;/span&gt;
        &lt;span class="n"&gt;db&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;session&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;commit&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
        &lt;span class="nf"&gt;flash&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;Your account has been updated!&lt;/span&gt;&lt;span class="sh"&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;success&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nf"&gt;redirect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;url_for&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;account&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;  &lt;span class="c1"&gt;# 🔄 Redirect fixes refresh bug
&lt;/span&gt;    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nf"&gt;render_template&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;dashboard.html&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;form&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;form&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;user&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;current_user&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  📌 Why This Works
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;User submits form → &lt;code&gt;POST&lt;/code&gt; runs and updates DB&lt;/li&gt;
&lt;li&gt;Server sends a &lt;strong&gt;redirect to &lt;code&gt;/account&lt;/code&gt;&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Browser follows redirect → does a &lt;strong&gt;GET&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Refreshing now re-runs the &lt;strong&gt;GET&lt;/strong&gt;, not the form submission&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  🧪 Bonus Tip: Use DevTools to Watch the Flow
&lt;/h2&gt;

&lt;p&gt;In your browser's developer tools:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Check the &lt;strong&gt;Network tab&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Watch for the &lt;code&gt;POST&lt;/code&gt; request, followed by a &lt;code&gt;302 Found&lt;/code&gt; redirect&lt;/li&gt;
&lt;li&gt;The next request will be &lt;code&gt;GET&lt;/code&gt;—clean and safe for refreshes&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>webdev</category>
      <category>programming</category>
      <category>backenddevelopment</category>
      <category>learning</category>
    </item>
    <item>
      <title>Data Types, Data Structures, and Abstract Data Types – What’s the Difference</title>
      <dc:creator>Pavitha P</dc:creator>
      <pubDate>Fri, 27 Jun 2025 03:49:57 +0000</pubDate>
      <link>https://dev.to/pavi10/data-types-data-structures-and-abstract-data-types-whats-the-difference-392n</link>
      <guid>https://dev.to/pavi10/data-types-data-structures-and-abstract-data-types-whats-the-difference-392n</guid>
      <description>&lt;p&gt;🔹 &lt;strong&gt;Data Types — “What Kind of Data?”&lt;/strong&gt;&lt;br&gt;
Data types define what kind of data a variable can hold. They form the most basic units of any program.&lt;br&gt;
Examples:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;int — whole numbers&lt;/li&gt;
&lt;li&gt;float — decimal numbers&lt;/li&gt;
&lt;li&gt;char — single characters
💡 Think of these as the building blocks of data.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;🔹 &lt;strong&gt;Data Structures — “How Is Data Organized?”&lt;/strong&gt;&lt;br&gt;
Data structures define how data is arranged and stored in memory. They allow for efficient access and manipulation.&lt;br&gt;
Examples:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Arrays&lt;/li&gt;
&lt;li&gt;Linked Lists&lt;/li&gt;
&lt;li&gt;Trees
💡 These are the containers that hold and structure the building blocks.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;🔹 &lt;strong&gt;Abstract Data Types (ADTs) — “What Can You Do With It?”&lt;/strong&gt;&lt;br&gt;
ADTs describe the behavior and operations that can be performed on data, without specifying how they’re implemented. They’re more about what you can do rather than how it’s done.&lt;br&gt;
Examples:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Stack (push(), pop())&lt;/li&gt;
&lt;li&gt;Queue (enqueue(), dequeue())
💡 Think of ADTs as blueprints—they define expected behavior while leaving implementation details open.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;✨ Wrap-Up&lt;br&gt;
In short:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Data Types 🧱 define the kind of data&lt;/li&gt;
&lt;li&gt;Data Structures 📦 organize the data&lt;/li&gt;
&lt;li&gt;ADTs 🛠️ define operations you can perform
Together, these form the foundation of how we model, store, and manipulate information in programming.
Have thoughts or questions? Let’s connect in the comments! 💬&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>programming</category>
      <category>developers</category>
      <category>coding</category>
      <category>computerscience</category>
    </item>
  </channel>
</rss>
