EPISODE · Apr 1, 2017 · 20 MIN
e020: Putting code in its place
from New Rustacean · host Chris Krycho
How do we organize code in Rust? Where do we break it apart into modules or crates, and why? Notes Structuring code in a language like Rust can seem a bit more ambiguous than doing the same in a language with classes to attach all our functionality to, but in practice, the concerns are much the same: modules are namespaces, and we group by responsibility. In today's episode, I talk through that philosophy (and give some comparisons to other languages), and then look at what it looks like in practice! Links Learning Rust Modules, by Jeff Walker, has a nice comparison of C# namespaces and Rust modules. The commit on Lightning inspired by this episode. Sponsors Aleksey Pirogov Andreas Fischer Andrew Thompson Austin LeSure Ben Whitley Charlie Egan Chris Jones Chris Palmer Christopher Giffard Dan Abrams Daniel Collin Derek Morr Eugene Bulkin Jakub "Limeth" Hlusička Jordan Henderson Jupp Müller Justin Ossevoort Karl Hobley Keith Gray Lachlan Collins Luca Schmid Matt Rudder Matthew Piziak Max Jacobson Micael Bergeron Ovidiu Curcan Pascal Hertleif Patrick O'Doherty Peter Tillemans Philipp Keller Ralph Giles ("rillian") Raph Levien reddraggone9 Steven Murawski Stuart Hinson Tyler Harper Vesa Kaihlavirta Vlad Bezden Warren Harper William Roe Zaki (Thanks to the couple people donating who opted out of the reward tier, as well. You know who you are!) Become a sponsor Patreon Venmo Dwolla Cash.me Flattr PayPal.me Contact New Rustacean: Twitter: @newrustacean Email: [email protected] Chris Krycho GitHub: chriskrycho Twitter: @chriskrycho
What this episode covers
How do we organize code in Rust? Where do we break it apart into modules or crates, and why? Structuring code in a language like Rust can seem a bit more ambiguous than doing the same in a language with classes to attach all our functionality to, but in practice, the concerns are much the same: modules are namespaces, and we group by *responsibility*. In today's episode, I talk through that philosophy (and give some comparisons to other languages), and then look at what it looks like in practice!
NOW PLAYING
e020: Putting code in its place
No transcript for this episode yet
Similar Episodes
Mar 31, 2026 ·54m
Mar 27, 2026 ·14m
Mar 24, 2026 ·42m
Mar 20, 2026 ·42m
Mar 17, 2026 ·41m
Mar 13, 2026 ·44m