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.5 – Rust – Final Thoughts: Precision as a Form of Respect

Posted on 18 Ottobre 202518 Ottobre 2025 By Francesco

Introduction

You’ve just completed a journey that took you from your very first fn main() to mastering formatted output in Rust. This wasn’t just a programming course—it was a path of care, clarity, and intention.

This final project isn’t just a technical exercise. It’s a gesture of respect—toward those who will read your code, toward yourself, and toward the time you’ve invested. It’s your chance to show that precision isn’t pedantry—it’s kindness.

Goal

Build a program that calculates Body Mass Index (BMI), interprets it using standard medical ranges, and presents the result in a clear, elegant, and respectful way. The output should be:

  • Functional: the calculation is correct.
  • Explanatory: the meaning is clear.
  • Formatted: the output is readable and well-structured.
  • Empathetic: the final message is human.

Project Structure

1. Input

  • Height in meters (float)
  • Weight in kilograms (float)

2. Calculation

  • BMI formula: weight / (height * height)

3. Interpretation

CategoryBMI Range
Underweight< 18.5
Normal18.5 – 24.9
Overweight25.0 – 29.9
Obesity≥ 30.0

4. Output

  • ASCII-bordered table
  • ANSI colors (if supported)
  • Reference ranges
  • Personalized interpretation message

Full Code

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

    display_result(height_m, weight_kg, bmi);
}

fn display_result(height: f64, weight: f64, bmi: f64) {
    let use_colors = std::env::var("NO_COLOR").is_err();
    let (reset, dim, bold, green, yellow, red) = if use_colors {
        ("\x1b[0m", "\x1b[2m", "\x1b[1m", "\x1b[32m", "\x1b[33m", "\x1b[31m")
    } else {
        ("", "", "", "", "", "")
    };

    let category = interpret_bmi(bmi);
    let colored_category = match category {
        "Normal" => format!("{green}{category}{reset}"),
        "Underweight" | "Overweight" => format!("{yellow}{category}{reset}"),
        "Obesity" => format!("{red}{category}{reset}"),
        _ => category.to_string(),
    };

    let h = format!("{:.2}", height);
    let w = format!("{:.1}", weight);
    let b = format!("{:.2}", bmi);
    let title = format!("{bold}BMI SUMMARY{reset}");
    let ranges = format!(
        "{dim}Ranges → Under: <18.5 | Normal: 18.5–24.9 | Overweight: 25–29.9 | Obesity: ≥30{reset}"
    );

    let top_border = "┌─────────────────────────────────────────┐";
    let mid_border = "├─────────────────────────────────────────┤";
    let bottom_border = "└─────────────────────────────────────────┘";

    println!();
    println!("{top_border}");
    println!("│ {:^41} │", title);
    println!("{mid_border}");
    println!("│ {:<12} {:>26} │", "Height:", format!("{h} m"));
    println!("│ {:<12} {:>26} │", "Weight:", format!("{w} kg"));
    println!("│ {:<12} {:>26} │", "BMI:", b);
    println!("│ {:<12} {:>26} │", "Category:", colored_category);
    println!("{mid_border}");
    println!("│ {:<41} │", ranges);
    println!("{bottom_border}");
    println!();

    println!("{bold}Interpretation:{reset}");
    match category.as_str() {
        "Underweight" => println!("Your BMI indicates you are below the ideal weight. Consider consulting a health professional."),
        "Normal" => println!("Your BMI is within the normal range. Keep up your healthy lifestyle!"),
        "Overweight" => println!("Your BMI is above the normal range. Reviewing your diet and activity may be helpful."),
        "Obesity" => println!("Your BMI is high. We recommend speaking with a doctor for a full evaluation."),
        _ => println!("Unrecognized category."),
    }
}

fn interpret_bmi(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",
    }
}

What You’ve Learned

  • How to structure a complete Rust program
  • How to separate logic and presentation using functions
  • How to format numbers and strings
  • How to use ANSI colors for clarity
  • How to communicate respectfully through code

Why “Precision is a Form of Respect”?

Because every detail matters. A well-aligned output isn’t just aesthetic—it’s accessible. A clear message isn’t just informative—it’s kind. Readable code isn’t just technical—it’s thoughtful.

When you write code, you’re speaking to other humans. And when your code says “I care,” you’ve already made the leap from Zero to WoW.

What’s Next?

You’ve finished the course—but not your learning journey. Here are some ideas to keep going:

  • 🧩 Extend the project: Add keyboard input, file saving, or JSON export.
  • 🌐 Build a web interface: Use Yew or Tauri to turn it into an app.
  • 🌍 Localize your output: Translate it into English, French, or any language you like.
  • 🧪 Write tests: Use cargo test to verify your logic.
  • 📦 Publish your project: Create a GitHub repo and share it with the world.

Thank You

Thank you for your time, attention, and curiosity throughout this course. I hope you’ve learned not just Rust, but a way of thinking: precise, respectful, and human.

Disclaimer

This project is for educational purposes only. The BMI interpretations are simplified and do not replace professional medical advice. For clinical evaluations, always consult a qualified healthcare provider.

Post Views: 366

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

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

Coding Step 14.2 – Ubuntu – The Desktop Environment and Essential Commands

Posted on 12 Ottobre 202512 Ottobre 2025

Discover Ubuntu’s desktop environment, its core structure, and essential terminal commands — with real comparisons to Windows. Learn to navigate between visual freedom and command-line power.

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 11 – Rust – From Zero to “WoW”

Posted on 5 Settembre 202527 Settembre 2025

A minimalist yet powerful console app built in Rust that calculates Body Mass Index (BMI) with strict input validation and clean output. Designed to show how precision and safety can elevate even the simplest health tool into something trustworthy and refined.

Condividi:

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

ArchPilot: A Modular ERP/CRM Showcase Across Frameworks

Posted on 4 Novembre 202520 Novembre 2025

ArchPilot is a modular ERP/CRM showcase project developed across multiple frameworks—including Laravel, Spring Boot, Django, Drupal, Node.js, and ASP.NET Core. Designed to demonstrate architectural mastery, secure workflows, and cross-framework versatility, each module is built and documented to highlight strengths, trade-offs, and professional insight. This is not just code—it’s a legacy of scalable design.

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