Skip to content
This is my space, where experience meets the will to start over. This is my space, where experience meets the will to start over.

The first step is knowing where you want to go.

  • Home
  • Coding Hub
    • Software & Project
      • Small Biz Ops – S.B.O.
        • SmallBizOps – Day 10/90
      • CRM/ERP
      • MyTracker
      • My Budget
    • Form Zero to “WoW”
      • JavaScript from Zero (Completed)
        • 2. Remove and Edit List Items
        • 3. Separate HTML and JavaScript, Use addEventListener and Conditional Logic
        • 4. Add Dynamic CSS Classes
        • 5. Save & Restore Your List with localStorage
        • 6 – Turn Your App into a Full To-Do List
      • Python from Zero (Completed)
        • 2. Lists & Loops
        • 3. Conditional Menus
        • 4. Edit & Remove Tasks (with closing: Python vs PHP and Large Data)
        • 5 – Save to File: Make Your Tasks Survive Restarts
        • 6 — Pythin from zero – Final Project Polishing: Numbering, Formatting, and Preparing for CSV
      • Rust – From Zero to “WoW” (Completed)
        • 1 – Setup and Project Structure in Rust
        • 2 – User input: validation and error handling
        • 3 – Rust from Zero to “WoW – BMI Calculation and Conditional Logic
        • 4 –Rust – Clear, Formatted Output
        • 5 – Rust – Final Thoughts: Precision as a Form of Respect
      • Go from Zero to “WoW” (Completed)
        • 1 – Why Go Is Perfect for a Personal Expense Tracker
        • 2 – Logging Expenses and Console Input
        • 3 – Go from Zero to “WoW” – Smart Filtering & Display Logic
        • 4 – Go – Saving Data to Local Files
        • 5 – Go – Final Project – Expense Tracker in Go
      • C++ from Zero to “WoW” (Completed)
        • 1 – Why C++ for file organization?
        • 2 – C++ – File Type Detection and Classification
        • 3 – C++ – Creating & Managing Subfolders
        • 4 – C++ – Safe File Movement and User Feedback
        • 5 – C++ – Order as Mental Clarity
      • Ubuntu – From Zero to “WoW” (Completed)
        • 2 – Ubuntu – The Desktop Environment and Essential Commands
        • 3 – Ubuntu – Managing Files, Folders, and Permissions
        • 4 – Ubuntu – Installing and Updating Software with APT and Snap
        • 5 – Ubuntu – Customizing the Desktop Environment
        • 6 – Ubuntu – Network and Device Configuration
        • 7 – Ubuntu – User Management & System Security — “The Cathedral of Permissions”
        • 8 – Ubuntu – The Talking Machine: Terminal & Bash Scripting
        • 9 – Ubuntu – Ubuntu as a Server or Development Environment
        • 10 – Ubuntu – Backup, Maintenance & Troubleshooting
    • Git Hub Repository
      • Small Biz Ops – S.B.O.
      • Mini ERP – PHP & MySQL
      • CleverCRM (Java, Spring Boot)
      • FraudWatch (Python, FastAPI + scikit-learn)
      • OnboardIQ – Smart Onboarding Portal (Flask + SQLite Demo)
    • ArchPilot
      • 1-Users & Roles, End-to-End (Architecture, Database, and Cross-Framework Code)
      • 2 – Client Registry (CRM) Across Frameworks
      • 3 – Project & Budget Tracker (ERP)
      • 4 – Approval Workflow Engine Multi-step routing, status tracking, escalation paths
      • 5 – Audit Trail & Versioning
    • Small Biz Ops – S.B.O.
  • Vivere in USA
  • P4Y
  • Testi poetici
    • 1 – Sospeso
    • 2 – Il bicchiere di vetro quieto
    • 3 – Quando l’amore inciampa
    • 4 – Ma chi siete davvero?
    • 5 – Above the Thread of Day
    • 6 – The Truth That Doesn’t Exist
    • 7 – All of You, I Miss
    • 8 – The Captain and the Ocean
    • 9 – Between Light and Mist
    • 10 – Il peso delle scelte
  • Contact
  • Admin
This is my space, where experience meets the will to start over.
This is my space, where experience meets the will to start over.

The first step is knowing where you want to go.

Coding Step 11.4 – Rust – Form Zero to “WoW” – Clear, Formatted Output

Posted on 12 Ottobre 202512 Ottobre 2025 By Francesco

“Code is for computers. Output is for humans.”

Many beginners think “printing to the screen” is trivial.
In reality, output is the first handshake between your code and the real world — the first moment your logic turns into experience.

A well-formatted output is not about aesthetics; it’s about clarity, respect, and precision.
Here’s how even a simple BMI result can go from plain to professional, and finally to wow.


4.1 The Goal

After validating input and computing BMI, we want to:

  1. Show numbers with controlled precision.
  2. Provide a clear, human interpretation (underweight, normal, overweight, obesity).
  3. Avoid raw or cluttered text like BMI=24.137245.
  4. Make users feel they’re using a tool built with care, not a quick demo.

4.2 Common Helpers

fn interpret_bmi(bmi: f64) -> &'static str {
    match bmi {
        x if x < 18.5 => "Underweight – consider healthy nutrition and medical advice.",
        x if x < 25.0 => "Normal weight – maintain your healthy habits.",
        x if x < 30.0 => "Overweight – balance diet and activity for better health.",
        _             => "Obesity – consult a doctor for a tailored health plan.",
    }
}

fn category_label(bmi: f64) -> &'static str {
    match bmi {
        x if x < 18.5 => "Underweight",
        x if x < 25.0 => "Normal",
        x if x < 30.0 => "Overweight",
        _             => "Obesity",
    }
}

// Simple formatting shortcuts
fn fmt2(x: f64) -> String { format!("{:.2}", x) }
fn fmt1(x: f64) -> String { format!("{:.1}", x) }

4.3 Version 1 – The Honest and Raw Approach

fn print_basic(height_m: f64, weight_kg: f64, bmi: f64) {
    println!("Your BMI is {}", fmt2(bmi));
    println!("Category: {}", category_label(bmi));
    println!("Height: {} m, Weight: {} kg", fmt2(height_m), fmt1(weight_kg));
}

Output:
Your BMI is 22.20
Category: Normal
Height: 1.75 m, Weight: 68.0 kg

What it teaches:
✅ It works.
❌ But there’s no structure, no guidance for the eye, no feeling of completeness.


4.4 Version 2 – The Structured and Clear Style

fn print_curated(height_m: f64, weight_kg: f64, bmi: f64) {
    println!("\n==============================");
    println!("         BMI RESULT");
    println!("==============================");
    println!("Height : {} m", fmt2(height_m));
    println!("Weight : {} kg", fmt1(weight_kg));
    println!("------------------------------");
    println!("BMI    : {}", fmt2(bmi));
    println!("Status : {}", category_label(bmi));
    println!("Note   : {}", interpret_bmi(bmi));
    println!("==============================\n");
}

Output:
==============================
         BMI RESULT
==============================
Height : 1.75 m
Weight : 68.0 kg
------------------------------
BMI    : 22.20
Status : Normal
Note   : Normal weight – maintain your healthy habits.
==============================

Why it matters:
The difference is tone. This looks intentional — something a professional would hand to a client.
Structure builds trust.


4.5 Version 3 – The Elegant, Respectful Presentation

Here’s where “WoW” happens: the same data, but communicated beautifully.

fn print_elegant(height_m: f64, weight_kg: f64, bmi: f64) {
    let use_color = std::env::var("NO_COLOR").is_err(); // disable if NO_COLOR is set
    let (reset, dim, strong, ok, warn, alert) = if use_color {
        ("\x1b[0m", "\x1b[2m", "\x1b[1m", "\x1b[32m", "\x1b[33m", "\x1b[31m")
    } else {
        ("", "", "", "", "", "")
    };

    let status = category_label(bmi);
    let status_colored = match status {
        "Normal"      => format!("{ok}{status}{reset}"),
        "Underweight" => format!("{warn}{status}{reset}"),
        "Overweight"  => format!("{warn}{status}{reset}"),
        "Obesity"     => format!("{alert}{status}{reset}"),
        _             => status.to_string(),
    };

    let h = fmt2(height_m);
    let w = fmt1(weight_kg);
    let b = fmt2(bmi);

    let title = format!("{strong}BMI SUMMARY{reset}");
    let ranges = format!(
        "{dim}Ranges → Under: <18.5 | Normal: 18.5–24.9 | Over: 25–29.9 | Obesity: ≥30{reset}"
    );

    let top    = "┌───────────────────────────────────────────┐";
    let mid    = "├───────────────────────────────────────────┤";
    let bottom = "└───────────────────────────────────────────┘";

    println!();
    println!("{top}");
    println!("│ {:^41} │", title);
    println!("{mid}");
    println!("│ {:<12} {:>26} │", "Height:", format!("{h} m"));
    println!("│ {:<12} {:>26} │", "Weight:", format!("{w} kg"));
    println!("│ {:<12} {:>26} │", "BMI:",    b);
    println!("│ {:<12} {:>26} │", "Status:", status_colored);
    println!("{mid}");
    println!("│ {:<41} │", ranges);
    println!("{bottom}");
    println!();
}

Output:
┌───────────────────────────────────────────┐
│                 BMI SUMMARY               │
├───────────────────────────────────────────┤
│ Height:                     1.75 m        │
│ Weight:                     68.0 kg       │
│ BMI:                        22.20         │
│ Status:                     Normal        │
├───────────────────────────────────────────┤
│ Ranges → Under: <18.5 | Normal: 18.5–24.9 │
│          Over: 25–29.9| Obesity: ≥30      │
└───────────────────────────────────────────┘

(“Normal” appears in green; warnings and obesity appear in yellow/red depending on category.)

Why it’s “WoW”:

  • Visual hierarchy, alignment, and proportional spacing.
  • Optional ANSI colors used tastefully — clarity, not decoration.
  • Context line showing BMI ranges makes the output self-explanatory.
  • Same math, but the communication is now deliberate, precise, and kind.

4.6 Quick Test

fn main() {
    let height_m = 1.75;
    let weight_kg = 68.0;
    let bmi = weight_kg / (height_m * height_m);

    print_basic(height_m, weight_kg, bmi);
    print_curated(height_m, weight_kg, bmi);
    print_elegant(height_m, weight_kg, bmi);
}

4.7 The Essence of “WoW”

The numerical result never changed — but the emotional impact did.
Good design in code is about intentional communication.
Formatting is not decoration; it’s part of the user’s trust contract.

Precision is kindness.
Every line break, every decimal, every alignment says something about how much you care — not just about the program, but about the person using it.

When a beginner sees their terminal print something elegant, readable, and human, that’s the moment of WoW.
That’s when coding stops feeling mechanical and starts feeling meaningful.


From Zero to WoW – Rust Edition

Small code, big principles. The elegance is in how you treat simplicity.

Post Views: 1.184

Condividi:

  • Condividi su Facebook (Si apre in una nuova finestra) Facebook
  • Condividi su X (Si apre in una nuova finestra) X
Coding Form Zero to "WoW" Rust beginner Rustbmi calculatorclean codeconsole designFrom Zero to WoWlearning Rustoutput formattingrustRust tutorial

Navigazione articoli

Previous post
Next post

Francesco

My name is Francesco Boschi, originally from Italy and currently based in the United States. For over twenty years, I’ve worked as a manager and consultant across diverse sectors — from education and cultural institutions to the food industry — developing skills in operational management, strategic consulting, and complex problem-solving. In recent years, I’ve combined this experience with a strong passion for software development, creating custom tools designed to simplify workflows and meet real business needs.

Relocating to the U.S. marks the beginning of a new chapter: a personal and professional decision driven by the desire to be close to my son and to embrace new challenges in a different environment. Today, my goal is to turn my experience into meaningful solutions, blending strategic vision with technical expertise to help people and organizations work more effectively.

I enjoy moving between different worlds, adapting tools and approaches to people and contexts. I bring leadership, flexibility, attention to detail, analytical thinking, and a strong problem-solving mindset — along with a deep curiosity to learn and grow. Above all, I believe in sharing: I’m always eager to offer my experience to support the growth of others.

Related Posts

Coding

ArchPilot – Step 3 – Project & Budget Tracker (ERP)

Posted on 30 Novembre 202530 Novembre 2025

A cross-framework showcase of the Project & Budget Tracker module, demonstrating how different technologies handle the same ERP workflow with clarity, adaptability, and architectural insight.

Condividi:

  • Condividi su Facebook (Si apre in una nuova finestra) Facebook
  • Condividi su X (Si apre in una nuova finestra) X
Read More
Go

Coding – Step 12 – Go from Zero to “WoW”

Posted on 5 Settembre 202527 Settembre 2025

A fast and pragmatic expense tracker built in Go, designed for everyday use. Log your spending, filter by category, and save locally — no cloud, no clutter. A perfect example of how simplicity and speed can solve real-life problems.

Condividi:

  • Condividi su Facebook (Si apre in una nuova finestra) Facebook
  • Condividi su X (Si apre in una nuova finestra) X
Read More
Coding

Coding – Step 13.4 – C++ – Safe File Movement and User Feedback

Posted on 12 Ottobre 202512 Ottobre 2025

Learn how to make file movement in C++ safe, reversible, and human-friendly — with dry runs, backups, duplicate handling, progress indicators, and clear feedback. Because true performance includes trust.

Condividi:

  • Condividi su Facebook (Si apre in una nuova finestra) Facebook
  • Condividi su X (Si apre in una nuova finestra) X
Read More

Iscriviti alla nostra Newsletter

🤞 Let's keep in touch

We do not send spam! Read our Privacy policy for more information.

Controlla la tua casella di posta o la cartella spam per confermare la tua iscrizione

Cerca nel sito

©2026 This is my space, where experience meets the will to start over. | WordPress Theme by SuperbThemes