MYMuhammad Yafi Alhakiminyafi.hashnode.dev路Apr 7 路 4 min readTraits: The "Contract" SystemABSTRACT: 馃З Analogy for Frontend Developers A Trait in Rust is exactly like an interface in TypeScript. Think of a Trait as a Contract or a Job Description. It is a way to define shared behavior in an abstract way, forcing different types of data t...00
MYMuhammad Yafi Alhakiminyafi.hashnode.dev路Apr 7 路 2 min readTesting: The "Quality Contract"Coming from a background of Jest, Vitest, or Mocha, you'll find Rust's built-in testing suite incredibly refreshing. No extra dependencies are needed for basic unit testing! Think of Rust Testing as a Quality Contract. By writing tests, you are "Sign...00
MYMuhammad Yafi Alhakiminyafi.hashnode.dev路Apr 7 路 2 min readSmart Pointers: The "Specialized Containers"In JavaScript, most "pointing" is hidden. Every object or array is actually a reference (a pointer). In Rust, pointers are explicit, and Smart Pointers are like Wrappers with Superpowers. Think of a regular reference (&T) as a simple link, and a Smar...00
MYMuhammad Yafi Alhakiminyafi.hashnode.dev路Apr 7 路 2 min readMacros & Patterns: The "Metaprogramming Magic"If you've reached this part of Rust, you're looking at the tools that power the libraries you've been using (like vec!, println!, or serde). These are the Power User tools. Think of Macros as Code that Writes Code. Imagine if you could write a Babel ...00
MYMuhammad Yafi Alhakiminyafi.hashnode.dev路Apr 7 路 3 min readLifetimes: The "Timeline Contract"Lifetimes are the most unique feature of Rust. You have probably never encountered them in JavaScript or TypeScript because the browser's Garbage Collector handles all of this automatically behind the scenes. Think of a Lifetime as a Timeline Contrac...00