<?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: Paras</title>
    <description>The latest articles on DEV Community by Paras (@parasdev-finance).</description>
    <link>https://dev.to/parasdev-finance</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%2F3838282%2F999638af-eb88-4b73-97d1-75423e7e3d1b.jpg</url>
      <title>DEV Community: Paras</title>
      <link>https://dev.to/parasdev-finance</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/parasdev-finance"/>
    <language>en</language>
    <item>
      <title>Rust Unlocked (Ch 2): The Stack, The Heap, and the Golden Rule of Ownership</title>
      <dc:creator>Paras</dc:creator>
      <pubDate>Wed, 25 Mar 2026 06:48:31 +0000</pubDate>
      <link>https://dev.to/parasdev-finance/rust-unlock-the-human-language-guidechapter-2-2gp6</link>
      <guid>https://dev.to/parasdev-finance/rust-unlock-the-human-language-guidechapter-2-2gp6</guid>
      <description>&lt;p&gt;&lt;strong&gt;Chapter 2: The Rules of the Record (Data &amp;amp; Ownership)&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
​In Chapter 1, we learned how to write a single note. But as you start writing more, you need a way to keep your "Record Book" organized. To keep your notes from getting mixed up or lost, Rust has a few "Golden Rules" for how information is handled.&lt;br&gt;&lt;br&gt;
&lt;strong&gt;​1. The "Full Stop" Rule (The Semicolon ;)&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
​In English, you end a sentence with a period so the reader knows you’re done talking. In Rust, you must end almost every instruction with a &lt;strong&gt;semicolon ( ; )&lt;/strong&gt;.&lt;br&gt;&lt;br&gt;
​Think of this as the &lt;strong&gt;Official Stamp&lt;/strong&gt;. It tells the computer: _"This sentence  is finished. Move to the next line."&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight rust"&gt;&lt;code&gt;&lt;span class="k"&gt;fn&lt;/span&gt; &lt;span class="nf"&gt;main&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="n"&gt;shares&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;18&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// ✅ Correct: The sentence is stamped and finished.&lt;/span&gt;
    &lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="n"&gt;price&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;341&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// ✅ Correct.&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Did you notice the&lt;/strong&gt; &lt;strong&gt;//&lt;/strong&gt; &lt;strong&gt;in the code above?&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
This is called a &lt;strong&gt;Comment&lt;/strong&gt;.&lt;br&gt;&lt;br&gt;
• ​The &lt;strong&gt;"Invisible Note":&lt;/strong&gt; Anything you write after // is ignored by the computer.&lt;br&gt;&lt;br&gt;
• ​&lt;strong&gt;Why use it?&lt;/strong&gt; It’s like writing a small note to yourself (or a teammate) to explain what the code is doing without the computer getting confused.  &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The Mistake:&lt;/strong&gt; If you forget the semicolon, your &lt;strong&gt;rust-analyzer&lt;/strong&gt; will turn the line red. It’s like a teacher rejecting your homework because you didn't finish your sentences.&lt;br&gt;
&lt;strong&gt;2. The "Megaphone" Rule (Comma &amp;amp; Order)&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
When you use println! to shout out your results, you use {} as an &lt;strong&gt;Empty Seat&lt;/strong&gt; for your data. But how does the computer know which data sits in which seat?&lt;br&gt;&lt;br&gt;
​&lt;br&gt;&lt;br&gt;
&lt;strong&gt;The Comma ( , ) is the separator.&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Think of it like a line of people waiting to sit down. The first person after the comma takes the first seat {}. The second person takes the second seat {}.&lt;br&gt;&lt;br&gt;
​The "Transaction" Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight rust"&gt;&lt;code&gt;&lt;span class="k"&gt;fn&lt;/span&gt; &lt;span class="nf"&gt;main&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="n"&gt;balance&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;6000&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="n"&gt;withdrawn&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1000&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

    &lt;span class="c1"&gt;// The order matters!&lt;/span&gt;
    &lt;span class="c1"&gt;// 'balance' goes to the 1st {}, 'withdrawn' goes to the 2nd {}.&lt;/span&gt;
    &lt;span class="nd"&gt;println!&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Balance is {} and amount withdrawn is {}"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;balance&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;withdrawn&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;&lt;strong&gt;Output:&lt;/strong&gt; Balance is &lt;strong&gt;6000&lt;/strong&gt; and amount withdrawn is &lt;strong&gt;1000&lt;/strong&gt;  &lt;/p&gt;

&lt;p&gt;​&lt;strong&gt;Key Rule:&lt;/strong&gt; If you have two seats {} {}, you &lt;strong&gt;must&lt;/strong&gt; have two names after the comma, separated by another comma. If the order is wrong, your sentence won't make sense!  &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;​3. Telling the Difference: Numbers vs. Sentences&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
​Imagine you are writing a message to a friend:&lt;br&gt;&lt;br&gt;
​"Your current balance is 5000 rupees. I am giving you 1000 rupees, so your total will be 6000."&lt;/p&gt;

&lt;p&gt;​In English, that is just one long sentence. But in Rust, if we want the computer to actually &lt;strong&gt;calculate&lt;/strong&gt; that total (add, subtract, or divide), we have to separate the "Label" from the "Math."&lt;br&gt;&lt;br&gt;
​The Code Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight rust"&gt;&lt;code&gt;&lt;span class="k"&gt;fn&lt;/span&gt; &lt;span class="nf"&gt;main&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="k"&gt;mut&lt;/span&gt; &lt;span class="n"&gt;balance&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;5000&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// This is a number we can do math with&lt;/span&gt;
    &lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="n"&gt;incoming_cash&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;1000&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

    &lt;span class="n"&gt;balance&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;balance&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;incoming_cash&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// The computer adds them up!&lt;/span&gt;

    &lt;span class="nd"&gt;println!&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Your total will be {}"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;balance&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;In the code we just wrote, we used: let mut balance = 5000;. Here we let the computer guess the data type—quite convenient, right?&lt;br&gt;&lt;br&gt;
​&lt;strong&gt;But there is a catch.&lt;/strong&gt; In real programming, we almost never recommend relying on the guess. Let’s take a look at why automatic guessing is dangerous through a &lt;strong&gt;serious question&lt;/strong&gt;:&lt;br&gt;&lt;br&gt;
​&lt;strong&gt;Can a physical cash balance ever be negative?&lt;/strong&gt; No. You either have money, or you have zero. But since the computer just sees 5000 as a generic number, its "guess" will allow a mistake like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight rust"&gt;&lt;code&gt;&lt;span class="k"&gt;fn&lt;/span&gt; &lt;span class="nf"&gt;main&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="k"&gt;mut&lt;/span&gt; &lt;span class="n"&gt;balance&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;5000&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="n"&gt;withdrawn&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;6000&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// Oops, we withdrew more than we have!&lt;/span&gt;

    &lt;span class="n"&gt;balance&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;balance&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;withdrawn&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

    &lt;span class="nd"&gt;println!&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Current Balance: {}"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;balance&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// This will print -1000!&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In the real world of Finance, a "negative" cash record is a disaster. If we let the computer just guess, it creates a security hole where "ghost" negative numbers can ruin your records.&lt;/p&gt;

&lt;p&gt;​But why did the computer allow a negative number in the first place? Because when Rust guesses, its default choice is a flexible container called &lt;strong&gt;i32&lt;/strong&gt;, which allows both positive &lt;em&gt;and&lt;/em&gt; negative numbers. (We will look at exactly what i32 means in just a moment in &lt;strong&gt;Point 4: Choosing the Right "Box"&lt;/strong&gt;). While i32 is great for tracking debt or freezing temperatures, using it for a strict physical cash balance is exactly how mistakes happen!&lt;/p&gt;

&lt;p&gt;​&lt;strong&gt;How do we solve this? (The Explicit Guardrail)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;​This is exactly why Rust is famous for being a Safe Language. To prevent these "ghost" numbers, we use a feature called the Explicit Guardrail.&lt;/p&gt;

&lt;p&gt;​Instead of letting the computer guess its default i32, you become the boss. We add a "Category" or "Data Type" right after the name to set the strict rules. In this case, we use a positive-only "Safe" called &lt;strong&gt;u32&lt;/strong&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight rust"&gt;&lt;code&gt;&lt;span class="k"&gt;fn&lt;/span&gt; &lt;span class="nf"&gt;main&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="c1"&gt;// We add ': u32' to tell Rust this is a POSITIVE-ONLY safe&lt;/span&gt;
    &lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="k"&gt;mut&lt;/span&gt; &lt;span class="n"&gt;balance&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;u32&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;5000&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

    &lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="n"&gt;withdrawn&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;6000&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

    &lt;span class="c1"&gt;// Rust will now STOP the program before it ever saves a negative number!&lt;/span&gt;
    &lt;span class="n"&gt;balance&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;balance&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;withdrawn&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;What exactly is a u32?&lt;br&gt;&lt;br&gt;
​Think of it as a label on a storage box that tells you two things:&lt;br&gt;&lt;br&gt;
• ​&lt;strong&gt;The&lt;/strong&gt; &lt;strong&gt;u&lt;/strong&gt; &lt;strong&gt;(Unsigned):&lt;/strong&gt; This means "No Minus Sign allowed." It is a positive-only box.&lt;br&gt;&lt;br&gt;
• ​&lt;strong&gt;The&lt;/strong&gt; &lt;strong&gt;32&lt;/strong&gt; &lt;strong&gt;(Bits):&lt;/strong&gt; This is the size of the box. A 32-bit box is a standard "Safe" that can hold any whole number from &lt;strong&gt;0 up to 4,294,967,295&lt;/strong&gt; (over 4 billion!).&lt;br&gt;&lt;br&gt;
​​By using &lt;strong&gt;u32&lt;/strong&gt;, you are setting a guardrail. If a calculation tries to go below zero, Rust will literally &lt;strong&gt;crash the program&lt;/strong&gt; on purpose rather than letting a dishonest or wrong number enter your record book.  &lt;/p&gt;

&lt;p&gt;​&lt;strong&gt;Important Note:&lt;/strong&gt; In a real bank, if you try to transfer more money than you have, the whole bank doesn't "crash"—it just sends you a message saying &lt;strong&gt;"Insufficient Funds."&lt;/strong&gt; &amp;gt;&lt;br&gt;&lt;br&gt;
Currently, our simple code is like a very strict security guard who shuts down the whole building if he sees a mistake. Don't worry, though! Later in this book, we will learn how to handle these errors gracefully (using a tool called the &lt;strong&gt;Match&lt;/strong&gt; function) so your program can stay running while simply saying "Transaction Declined."  &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. Choosing the Right "Box" (Numbers)&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
​Depending on how many "zeros" your transaction needs, you can pick different sizes of these positive-only (u) or flexible (i) safes:&lt;br&gt;&lt;br&gt;
• ​&lt;strong&gt;u8&lt;/strong&gt; &lt;strong&gt;(The Tiny Drawer):&lt;/strong&gt; Holds positive numbers from &lt;strong&gt;0 to 255&lt;/strong&gt;. (Great for small things like age or your &lt;strong&gt;18 shares&lt;/strong&gt;).&lt;br&gt;&lt;br&gt;
• ​&lt;strong&gt;u32&lt;/strong&gt; &lt;strong&gt;(The Standard box):&lt;/strong&gt; Holds positive numbers up to &lt;strong&gt;4 Billion&lt;/strong&gt;. (Perfect for bank balances).&lt;br&gt;&lt;br&gt;
• ​&lt;strong&gt;i32&lt;/strong&gt; &lt;strong&gt;(The Flexible Wallet):&lt;/strong&gt; The &lt;strong&gt;i&lt;/strong&gt; stands for "Integer," but you can think of it as "Inclusive." It allows for both positive &lt;strong&gt;and&lt;/strong&gt; negative numbers. It can hold any number from &lt;strong&gt;-2,147,483,648 to 2,147,483,647&lt;/strong&gt;. Use this if you need to record a loss or a debt!&lt;br&gt;&lt;br&gt;
​&lt;strong&gt;Note:&lt;/strong&gt; Just like in a hardware store, these boxes come in all sizes! We also have &lt;strong&gt;i8&lt;/strong&gt;, &lt;strong&gt;i16&lt;/strong&gt;, &lt;strong&gt;i64&lt;/strong&gt;, and &lt;strong&gt;u16&lt;/strong&gt;, &lt;strong&gt;u64&lt;/strong&gt;. The bigger the number in the name, the more "zeros" the box can hold.&lt;br&gt;&lt;br&gt;
&lt;strong&gt;​&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
&lt;strong&gt;5. Choosing the Right "Box" (Text)&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
​Now that we know how to store numbers, how do we store words? In English, a word is just a word. But in Rust, we have two main types of "Text Boxes" depending on whether the text is &lt;strong&gt;Fixed&lt;/strong&gt; or &lt;strong&gt;Flexible&lt;/strong&gt;.&lt;br&gt;&lt;br&gt;
​&lt;br&gt;&lt;br&gt;
A. The "Printed Label" (&amp;amp;str)&lt;br&gt;&lt;br&gt;
​Think of this as a label that is printed directly onto a physical object. Once it’s printed, you can't add more letters to it or change the font.  &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;• The Rule:&lt;/strong&gt; It is a fixed piece of text. It stays exactly as it was written when the program started.  &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;• Code:&lt;/strong&gt; let greeting = "Hello"; (Rust automatically makes this a &amp;amp;str).  &lt;/p&gt;

&lt;p&gt;​B. The "Writing Notebook" (String)&lt;br&gt;&lt;br&gt;
​This is for text that needs to be flexible. It’s like a notebook where you can keep writing more lines, erase things, or tear pages out. This box can grow as large as you need it to.  &lt;/p&gt;

&lt;p&gt;• ​&lt;strong&gt;Code:&lt;/strong&gt; let mut name = String::from("my balance");&lt;br&gt;&lt;br&gt;
&lt;strong&gt;• The Rule:&lt;/strong&gt; Notice the &lt;strong&gt;Capital S&lt;/strong&gt; in String. In Rust, a String is a "Big Deal"—it's a complex structure, so it gets a capital letter to show its importance.&lt;br&gt;&lt;br&gt;
• ​&lt;strong&gt;The&lt;/strong&gt; &lt;strong&gt;::&lt;/strong&gt; &lt;strong&gt;(The Menu Path):&lt;/strong&gt; Why String::from? Think of the :: as navigating a menu in your favorite app. ​It’s exactly like opening your &lt;strong&gt;Notes App&lt;/strong&gt; -&amp;gt; clicking the &lt;strong&gt;3 dots&lt;/strong&gt; at the top -&amp;gt; and selecting the &lt;strong&gt;"Create New Note"&lt;/strong&gt; option. ​You are telling Rust: &lt;em&gt;"Go to the&lt;/em&gt; &lt;em&gt;&lt;strong&gt;String&lt;/strong&gt;&lt;/em&gt; &lt;em&gt;category -&amp;gt; open the&lt;/em&gt; &lt;em&gt;&lt;strong&gt;from&lt;/strong&gt;&lt;/em&gt; &lt;em&gt;tool -&amp;gt; and create a new notebook using these words."&lt;/em&gt;&lt;br&gt;&lt;br&gt;
​It’s exactly like opening your &lt;strong&gt;Notes App&lt;/strong&gt; -&amp;gt; clicking the &lt;strong&gt;3 dots&lt;/strong&gt; at the top -&amp;gt; and selecting the &lt;strong&gt;"Create New Note"&lt;/strong&gt; option.  &lt;/p&gt;

&lt;p&gt;​You are telling Rust: &lt;em&gt;"Go to the&lt;/em&gt; &lt;em&gt;&lt;strong&gt;String&lt;/strong&gt;&lt;/em&gt; &lt;em&gt;category -&amp;gt; open the&lt;/em&gt; &lt;em&gt;&lt;strong&gt;from&lt;/strong&gt;&lt;/em&gt; &lt;em&gt;tool -&amp;gt; and create a new notebook using these words."&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;🛠️ Try it Yourself!&lt;/strong&gt;  &lt;/p&gt;

&lt;p&gt;​Open your &lt;strong&gt;VS Code&lt;/strong&gt; and try to create your own "Digital Record." Copy this code and see if you can change the values. Try to make the balance a negative number and see if the "Guardrail" we talked about actually stops you!&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight rust"&gt;&lt;code&gt;&lt;span class="k"&gt;fn&lt;/span&gt; &lt;span class="nf"&gt;main&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="c1"&gt;// 1. Create a positive-only number for your balance&lt;/span&gt;
    &lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="n"&gt;balance&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;u32&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;10000&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

    &lt;span class="c1"&gt;// 2. Create a flexible String for your name&lt;/span&gt;
    &lt;span class="c1"&gt;// Remember: Capital 'S' and '::' to call the tool!&lt;/span&gt;
    &lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nn"&gt;String&lt;/span&gt;&lt;span class="p"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;from&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Your Name"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

    &lt;span class="c1"&gt;// 3. Shout it out!&lt;/span&gt;
    &lt;span class="nd"&gt;println!&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Hello {}, your current balance is {} rupees."&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;balance&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;&lt;strong&gt;6. Where is the Data Stored? (The Warehouse)&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
​Now that you know what kind of &lt;strong&gt;Boxes&lt;/strong&gt; we use (u32 for numbers, String for text, etc.), we need to look at &lt;strong&gt;where&lt;/strong&gt; these boxes are actually kept.&lt;br&gt;&lt;br&gt;
​When you run a program, the computer doesn't put your active data on the &lt;strong&gt;SSD&lt;/strong&gt; (the slow, long-term storage like a filing cabinet). It puts it in the &lt;strong&gt;RAM&lt;/strong&gt; (the fast, short-term storage like your desk).&lt;br&gt;&lt;br&gt;
​However, even inside the &lt;strong&gt;RAM&lt;/strong&gt;, Rust is very picky about organization. It divides your desk into two sections:&lt;br&gt;&lt;br&gt;
​  &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;The Custom Bookshelf (The Stack)&lt;br&gt;&lt;br&gt;
• ​&lt;strong&gt;What goes here?&lt;/strong&gt; Small, fixed-size items like your &lt;strong&gt;u32&lt;/strong&gt; &lt;strong&gt;or&lt;/strong&gt; &lt;strong&gt;u8&lt;/strong&gt; &lt;strong&gt;numbers&lt;/strong&gt;, and your &lt;strong&gt;Printed Labels&lt;/strong&gt; (&amp;amp;str).&lt;br&gt;&lt;br&gt;
• ​&lt;strong&gt;Why?&lt;/strong&gt; Imagine you are designing a custom cupboard or a bookshelf. If you know exactly how thick every single book is, you can build the shelves to fit them perfectly. In Rust, because a u8 box has a strict maximum limit (255), the computer knows exactly how much space to carve out. It stacks them back-to-back perfectly. Because there are no surprises and no wasted space, finding and grabbing these items is lightning-fast! It’s like picking up a book directly from the shelf right next to your desk to study. It’s quick, isn't it?  &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;The College Bag (The Heap)&lt;br&gt;&lt;br&gt;
• ​&lt;strong&gt;What goes here?&lt;/strong&gt; Large, flexible items like your &lt;strong&gt;String&lt;/strong&gt; &lt;strong&gt;notebooks&lt;/strong&gt;.&lt;br&gt;&lt;br&gt;
• ​&lt;strong&gt;Why?&lt;/strong&gt; Think of this like your college bag or a big storage cupboard. You don't know exactly how many books you will need to carry until you get your timetable for the day. Some days your bag is packed with heavy textbooks, and other days it's almost empty. Because the size is always changing, you can't shove it into a strict, perfectly measured custom shelf—it would break! Instead, Rust finds a big, open space on the "Main Floor" (the Heap) to store it, where it has plenty of flexible room to grow or shrink safely based on your timetable.  &lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;7. "Where is my Bag?" (Connecting the Shelf to the Floor)&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
​We have a slight problem. Your heavy &lt;strong&gt;College Bag&lt;/strong&gt; (the flexible String) is sitting somewhere on the massive main floor of the RAM (The Heap). But when you are sitting at your desk, how do you find it instantly without searching the whole room? You might logically ask the computer: &lt;em&gt;"Where is my bag?"&lt;/em&gt;&lt;br&gt;&lt;br&gt;
​Rust solves this using a tiny &lt;strong&gt;Index Card&lt;/strong&gt; (in programming, this is called a &lt;em&gt;Pointer&lt;/em&gt;).&lt;br&gt;&lt;br&gt;
​How the Index Card Works&lt;br&gt;&lt;br&gt;
​Even though the big, flexible bag is out on the floor, Rust writes a tiny, fixed-size Index Card and places it right on your fast &lt;strong&gt;Custom Bookshelf&lt;/strong&gt; (The Stack).&lt;br&gt;&lt;br&gt;
​This Index Card contains three crucial pieces of information:&lt;br&gt;&lt;br&gt;
• ​&lt;strong&gt;The Address:&lt;/strong&gt; Where exactly is the bag located on the main floor?&lt;br&gt;&lt;br&gt;
• ​&lt;strong&gt;The Length:&lt;/strong&gt; How many books are currently in it?&lt;br&gt;&lt;br&gt;
• ​&lt;strong&gt;The Capacity:&lt;/strong&gt; How many books can the bag hold before it tears?&lt;br&gt;&lt;br&gt;
​Because this Index Card is small and its size never changes, it fits perfectly on your fast bookshelf. When your code says, &lt;em&gt;"Print my String!"&lt;/em&gt;, the computer quickly grabs the Index Card from the shelf, follows the address to the heavy bag on the floor, and reads what's inside.  &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;8. The Golden Rule: "One Manager" (Ownership)&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
​This brings us to the ultimate boss level of Rust. This is the exact feature that makes it a top-tier "Safe Language" for cybersecurity and finance.&lt;br&gt;&lt;br&gt;
​Imagine you and your brother are sharing that College Bag. If you &lt;em&gt;both&lt;/em&gt; have an Index Card pointing to the exact same bag, chaos happens:&lt;br&gt;&lt;br&gt;
• ​What if you try to pull a book out while he is trying to put one in?&lt;br&gt;&lt;br&gt;
• ​What if he decides to empty the whole bag and throw it away, but your Index Card still says it's there?&lt;br&gt;&lt;br&gt;
​In the computer world, if two parts of a program try to change or delete the same bag at the same time, it causes a massive crash (hackers actually use this exact confusion to break into systems!).&lt;br&gt;&lt;br&gt;
​To prevent this, Rust enforces the strict &lt;strong&gt;Rule of Ownership&lt;/strong&gt;:&lt;br&gt;&lt;br&gt;
&lt;strong&gt;Only ONE variable can hold the Index Card for a bag at any given time.&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
​The Handover (Moving Ownership)&lt;br&gt;&lt;br&gt;
​Let's see this in action:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight rust"&gt;&lt;code&gt;&lt;span class="k"&gt;fn&lt;/span&gt; &lt;span class="nf"&gt;main&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="n"&gt;my_slip&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nn"&gt;String&lt;/span&gt;&lt;span class="p"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;from&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Paras"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// You own the Tracking Slip to the bag.&lt;/span&gt;

    &lt;span class="c1"&gt;// Now, you give the slip to your brother:&lt;/span&gt;
    &lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="n"&gt;brother_slip&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;my_slip&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; 

    &lt;span class="c1"&gt;// If you try to use my_slip now, Rust will STOP the program!&lt;/span&gt;
    &lt;span class="c1"&gt;// println!("{}", my_slip); // ❌ ERROR! Your hands are empty!&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;When you write let brother_card = my_card;, you aren't buying a whole new bag and copying all the books. That would waste too much time and RAM!  &lt;/p&gt;

&lt;p&gt;​Instead, you physically hand over the &lt;strong&gt;Index Card&lt;/strong&gt;. Because you gave it away, your hands are now empty. Rust immediately crosses off your name. If you try to read your card again, Rust throws an error because you no longer &lt;em&gt;own&lt;/em&gt; the data. This guarantees that no two people can ever fight over the same bag.  &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;​&lt;/strong&gt; &lt;strong&gt;​🛠️ Try it Yourself: The "Handover" Error&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
​Reading about the Index Card is one thing, but seeing Rust catch you in the act is where the magic happens. Let's force an Ownership error!&lt;br&gt;&lt;br&gt;
​Open your &lt;strong&gt;VS Code&lt;/strong&gt;, delete whatever is in your main.rs file, and paste this exact code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight rust"&gt;&lt;code&gt;&lt;span class="k"&gt;fn&lt;/span&gt; &lt;span class="nf"&gt;main&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="c1"&gt;// 1. You create the heavy bag and hold the Index Card&lt;/span&gt;
    &lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="n"&gt;my_card&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nn"&gt;String&lt;/span&gt;&lt;span class="p"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;from&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"My Heavy College Bag"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

    &lt;span class="c1"&gt;// 2. You physically hand the Index Card to your brother&lt;/span&gt;
    &lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="n"&gt;brother_card&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;my_card&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; 

    &lt;span class="c1"&gt;// 3. Now, try to read YOUR card to see what's inside...&lt;/span&gt;
    &lt;span class="nd"&gt;println!&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"My card says: {}"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;my_card&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;What happened?&lt;br&gt;&lt;br&gt;
​The moment you paste this, your &lt;strong&gt;rust-analyzer&lt;/strong&gt; will light up with a red squiggly line under my_card inside the println! statement.&lt;br&gt;&lt;br&gt;
​If you hover your mouse over the red line, Rust will give you an error message that says something like: &lt;em&gt;"value borrowed here after move."&lt;/em&gt;&lt;br&gt;&lt;br&gt;
​&lt;strong&gt;What does that actually mean?&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
• ​&lt;strong&gt;"Move":&lt;/strong&gt; Rust is saying, &lt;em&gt;"Hey, you moved the Index Card to&lt;/em&gt; &lt;em&gt;brother_card&lt;/em&gt; &lt;em&gt;on line 5!"&lt;/em&gt;&lt;br&gt;&lt;br&gt;
• ​&lt;strong&gt;"Borrowed here":&lt;/strong&gt; Rust is scolding you: &lt;em&gt;"On line 8, you tried to look at an Index Card that you already gave away. Your hands are empty!"&lt;/em&gt;&lt;br&gt;&lt;br&gt;
​How to fix it?&lt;br&gt;&lt;br&gt;
​Since your brother holds the card now, only &lt;em&gt;he&lt;/em&gt; can tell you what is in the bag. Change the println! to ask him instead:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight rust"&gt;&lt;code&gt;&lt;span class="k"&gt;fn&lt;/span&gt; &lt;span class="nf"&gt;main&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="n"&gt;my_card&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nn"&gt;String&lt;/span&gt;&lt;span class="p"&gt;::&lt;/span&gt;&lt;span class="nf"&gt;from&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"My Heavy College Bag"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="k"&gt;let&lt;/span&gt; &lt;span class="n"&gt;brother_card&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;my_card&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; 

    &lt;span class="c1"&gt;// Ask the person who actually holds the card!&lt;/span&gt;
    &lt;span class="nd"&gt;println!&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Brother's card says: {}"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;brother_card&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;Instantly, the red line disappears! You have just successfully navigated Rust’s strictest security rule.  &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Chapter 2 Wrap-Up: The Master Record&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
​We covered a massive amount of ground in this chapter. You didn't just learn how to write code; you learned how a computer actually thinks and manages its memory! Let’s review the Golden Rules of your new digital record book:  &lt;/p&gt;

&lt;p&gt;• ​&lt;strong&gt;The Official Stamp &amp;amp; The Megaphone:&lt;/strong&gt; Every code sentence must end with a semicolon (;). When you want to shout out a result using println!, the comma separates your data, and they take their {} seats in exact order.&lt;br&gt;&lt;br&gt;
• ​&lt;strong&gt;The Guardrails (Data Types):&lt;/strong&gt; We never let the computer guess! We explicitly label our boxes. We use u32 to prevent negative "Ghost Balances," and we use String for flexible, growing text (like a Writing Notebook).&lt;br&gt;&lt;br&gt;
• ​&lt;strong&gt;The RAM Warehouse (Stack vs. Heap):&lt;/strong&gt; * Small, fixed-size items go on the &lt;strong&gt;Custom Bookshelf (The Stack)&lt;/strong&gt; because the computer can grab them instantly.&lt;br&gt;&lt;br&gt;
• ​Large, unpredictable items go on the &lt;strong&gt;Main Floor (The Heap)&lt;/strong&gt;, just like throwing a flexible College Bag into a big open room.&lt;br&gt;&lt;br&gt;
• ​&lt;strong&gt;The Golden Rule (Ownership):&lt;/strong&gt; To keep track of the College Bag on the main floor, Rust puts a tiny &lt;strong&gt;Index Card&lt;/strong&gt; on your fast Bookshelf. To keep your data perfectly safe, &lt;strong&gt;only one variable can hold that Index Card at a time.&lt;/strong&gt; If you hand it to someone else, your hands are empty!&lt;br&gt;&lt;br&gt;
&lt;strong&gt;​&lt;/strong&gt;&lt;strong&gt;​&lt;/strong&gt;&lt;strong&gt;⏭️ Sneak Peek: Chapter 3 (The Art of Lending)&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
​What if a friend just wants to &lt;em&gt;look&lt;/em&gt; at your notebook? You shouldn't have to permanently give away your property just to share information!&lt;br&gt;&lt;br&gt;
​In &lt;strong&gt;Chapter 3&lt;/strong&gt;, we will unlock the next level of Rust: &lt;strong&gt;Borrowing&lt;/strong&gt;. You will learn how to "Lend" data securely without breaking the Golden Rule. We will also learn how to politely handle errors (like &lt;em&gt;"Transaction Declined"&lt;/em&gt;) without crashing the system!&lt;br&gt;&lt;br&gt;
&lt;strong&gt;​💡 Pro Tip for the Road&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
​Open VS Code and try to break the rules on purpose! Put a negative number in a u32 box, or try reading an Index Card after you hand it over. Seeing those red errors pop up is the fastest way to learn.&lt;br&gt;&lt;br&gt;
​&lt;br&gt;&lt;br&gt;
See you in Chapter 3!!!&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>codenewbie</category>
      <category>rust</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Rust Unlocked: The Human-Language Guide (Foundation Edition)</title>
      <dc:creator>Paras</dc:creator>
      <pubDate>Sun, 22 Mar 2026 11:54:46 +0000</pubDate>
      <link>https://dev.to/parasdev-finance/rust-unlocked-the-human-language-guide-foundation-edition-3eam</link>
      <guid>https://dev.to/parasdev-finance/rust-unlocked-the-human-language-guide-foundation-edition-3eam</guid>
      <description>&lt;p&gt;Rust Unlocked: The Human-Language Guide (Foundation Edition)&lt;br&gt;
​Introduction: Why are you here?&lt;br&gt;
​If you opened the official "Rust Book" and closed it after two minutes because it felt like reading a rocket science manual in ancient Greek—you are in the right place.&lt;br&gt;
​Most programming books are written by engineers, for engineers. They assume you already know what "Memory Management" or "Heap Allocation" means. But the world is changing. Today, Accountants, Artists, and Doctors need to understand the tools that run our digital world.&lt;br&gt;
​This is not a technical manual. This is a translation.&lt;br&gt;
​We are going to learn Rust using logic you already use in daily life:&lt;br&gt;
​Accountants will see Rust as a perfect, double-entry ledger.&lt;br&gt;
​Artists will see it as a set of rigid frames that prevent the paint from leaking.&lt;br&gt;
​Students will see it as a strict teacher who corrects your homework before you hand it in, so you always get an A.&lt;br&gt;
​Chapter 0: The Workshop (Setup)&lt;br&gt;
​To build with Rust, you only need three tools. Think of this as setting up your desk before starting a new job.&lt;br&gt;
​1. The Ingredients (Rustup)&lt;br&gt;
​First, we need the language itself. We use a tool called Rustup.&lt;br&gt;
​What it is: The "Delivery Truck" that brings Rust to your computer.&lt;br&gt;
​How to get it: Go to rustup.rs and download rustup-init.exe.&lt;br&gt;
​The Golden Rule (The PATH): When you run the installer, it will ask if you want to "Add Rust to PATH." Always say YES. If it gives you a choice, pick 1 (Default).&lt;br&gt;
​Analogy: This is like giving the computer a map to your kitchen. Without it, the computer knows you have a stove, but it can't find it!&lt;br&gt;
​2. The Notebook (VS Code)&lt;br&gt;
​We recommend Visual Studio Code (VS Code). It’s a "Smart Notebook" that helps you write.&lt;br&gt;
​⚠️ CRITICAL STEP: The "Translator" (rust-analyzer)&lt;br&gt;
​Once you open VS Code, you must install the "rust-analyzer" extension. This is the most important part of your setup.&lt;br&gt;
​Click the Extensions icon (four square blocks) on the left sidebar.&lt;br&gt;
​Search for: rust-analyzer.&lt;br&gt;
​Click Install.&lt;br&gt;
​Why? It acts as your real-time tutor. It predicts what you want to write and underlines mistakes in red (just like a spell-checker) before you even run the program.&lt;br&gt;
​3. The Assistant Manager (Cargo)&lt;br&gt;
​By installing Rustup, you automatically got Cargo.&lt;br&gt;
​The "Live" Test: Open your terminal inside VS Code (Terminal -&amp;gt; New Terminal) and type: cargo new hello_rust&lt;br&gt;
​The Success Moment: If you see a new folder appear on the left, your setup is working perfectly.&lt;br&gt;
​Chapter 1: Writing Your First Records (Variables)&lt;br&gt;
​In any job or hobby, you need to write things down. An artist remembers a color code; a scientist records a temperature. In Rust, we call these saved notes Variables.&lt;br&gt;
​1. Making a Note (The Declaration)&lt;br&gt;
​Imagine you want to save the number of shares you own in a company. You "let" the computer know you are making a new record by using the word let.&lt;/p&gt;

&lt;p&gt;fn main() {&lt;br&gt;
    let shares = 18;&lt;br&gt;
    println!("I own {} shares.", shares);&lt;br&gt;
}&lt;/p&gt;

&lt;p&gt;Wait, what is fn main() { ... }?&lt;br&gt;
Think of this as the "Front Door" of your program. The computer always looks for the word main to know exactly where to start reading your instructions. Everything you write must stay inside these "walls" { }.&lt;br&gt;
​let: This is you picking up your pen. It tells Rust, "I am recording something new."&lt;br&gt;
​shares: This is the Label on your note.&lt;br&gt;
​18: This is the Value written on the note.&lt;br&gt;
​✍️ Your Turn: The "Try It" Section&lt;br&gt;
​Open your main.rs file and delete everything inside.&lt;br&gt;
​Copy and paste this exact code:&lt;br&gt;
​&amp;lt;!-- end list --&amp;gt;&lt;/p&gt;

&lt;p&gt;fn main() {&lt;br&gt;
    // 1. We pick up our pen (let) and name our note (food)&lt;br&gt;
    let food = "Pizza";&lt;br&gt;
 // 2. We use our megaphone (println!) to shout it out&lt;br&gt;
    println!("My favorite food is {}", food);&lt;br&gt;
}&lt;/p&gt;

&lt;p&gt;​To run: First press Ctrl + S (Windows) or Cmd + S (Mac) to save.&lt;br&gt;
​Go to the terminal and type cargo run.&lt;/p&gt;

&lt;p&gt;​2. The "Permanent Ink" Rule (Immutability)&lt;br&gt;
​By default, when you write a note with let, Rust assumes you wrote it in Permanent Ink. You cannot simply scribble over it later.&lt;br&gt;
​&lt;br&gt;
The "Mistake" Test:&lt;br&gt;
Try to change your code to look like this and run it again:&lt;/p&gt;

&lt;p&gt;fn main() {&lt;br&gt;
    let food = "Pizza";&lt;br&gt;
    food = "Burgers"; // ❌ Rust will stop you here!&lt;br&gt;
    println!("My favorite food is {}", food);&lt;br&gt;
}&lt;/p&gt;

&lt;p&gt;Your Tutor (rust-analyzer) will turn that line red. This keeps your records safe and honest.&lt;br&gt;
​3. The "Pencil" Key (mut)&lt;br&gt;
​But life is dynamic. What if your choice changes? The answer is simple: we drop the permanent marker and instead use a pencil. In Rust, this is the word mut (short for mutable).&lt;br&gt;
​The Formula: let + mut + name = A Changeable Note&lt;/p&gt;

&lt;p&gt;fn main() {&lt;br&gt;
    // We switched to the Pencil (mut)&lt;br&gt;
    let mut food = "Pizza"; &lt;br&gt;
    println!("First choice: {}", food);&lt;br&gt;
    // Now we can erase "Pizza" and write "Burgers"!&lt;br&gt;
    food = "Burgers"; &lt;br&gt;
    println!("Updated choice: {}", food);&lt;br&gt;
}&lt;/p&gt;

&lt;p&gt;🦅 The Foundation Summary&lt;br&gt;
​fn main() { ... }: The "Room" where your code lives. Keep these walls standing!&lt;br&gt;
​let: Your Permanent Pen (creates a record that can't change).&lt;br&gt;
​mut: Your Pencil (allows you to erase and update the record).&lt;br&gt;
​{}: The empty seat where your variable sits when you print it.&lt;br&gt;
​Ctrl + S: The "Commit" button. Always save before you run!&lt;br&gt;
​✅ The "Success" Checklist&lt;br&gt;
​Did your code run? (Check your semicolons ;!)&lt;br&gt;
​Did you save? (Ctrl + S is your best friend.)&lt;br&gt;
​Is your code inside the { } walls?&lt;br&gt;
​The Mission behind the Manual&lt;br&gt;
​The "Aha!" Moment&lt;br&gt;
​As a Bachelor of Accounting and Finance (BAF) student at Mulund College of Commerce, I live in a world of ledgers and precision. When I first encountered Rust, I saw a perfect, secure, and automated accounting ledger—but it was hidden behind "Engineer-speak."&lt;br&gt;
​Bridging the "Logic Gap"&lt;br&gt;
​My goal with Rust Unlocked is to act as a translator.&lt;br&gt;
​Accountants deserve tools as reliable as a double-entry ledger.&lt;br&gt;
​Artists deserve digital frames that prevent "creative paint" from leaking.&lt;br&gt;
​Students deserve a "strict teacher" that helps them always get an A.&lt;br&gt;
​Connect with me:&lt;br&gt;
​LinkedIn: &lt;a href="https://www.linkedin.com/in/paras-jadhav-finance" rel="noopener noreferrer"&gt;https://www.linkedin.com/in/paras-jadhav-finance&lt;/a&gt;&lt;br&gt;
​GitHub: &lt;a href="https://github.com/ParasDev-finance" rel="noopener noreferrer"&gt;https://github.com/ParasDev-finance&lt;/a&gt;&lt;br&gt;
​Next Week: We tackle the "Title Deed" of programming: Ownership.&lt;/p&gt;

</description>
      <category>rust</category>
      <category>beginners</category>
      <category>productivity</category>
      <category>finance</category>
    </item>
  </channel>
</rss>
