Why I think Rust is Object Oriented<br>9 Jul 2026<br>Why I think Rust is Object Oriented
Before we begin, I want to say<br>I don't care that much if you disagree with me.<br>There's no sound precise mathematical definition of Object Oriented, no ISO<br>standard, and no grand arbiter who decides what is and what is not OO<br>(although I believe Casey Muratori may have applied for that position<br>somewhere in his 12 day monologue about the subject). You are unlikely to<br>change my mind, and I am unlikely to change yours, and that's perfectly<br>fine. On with the post!
In my heart of hearts, Rust feels like an object oriented language.<br>Practically everything I write in Rust is a datum + set of behaviours<br>intimately associated therewith. I hide my struct fields, give my<br>totally-not-objects equality semantics and string representation. I utilise<br>polymorphism via traits - and while I know that traits are<br>not technically interfaces, that fact occupies the same region of my<br>brain that knows that<br>mandrills<br>are not technically baboons. Almost all my functionality is written<br>in methods, and those methods belong to the data they operate on, in a way<br>that they definitely don't in something like C or OCaml.
But what about inheritance? OO-haters often fixate on this as<br>the<br>defining thing about objects, which has always perplexed me. I came up in the<br>JavaMania era and "composition over inheritance" was the accepted wisdom of<br>every programmer who took OO seriously. I scarcely used it during my time in<br>the C# mines. Historically speaking the case is weak as well; neither
the first smalltalk, nor the first simula<br>had inheritance. Self was hugely influential (traits originated in Self) and<br>didn't have it either. I won't deny it wasn't a common feature, but it never<br>took center stage in my mind outside the brief "Cat inherits Mammal" phrase we<br>all go through, and it certainly wasn't encouraged in the OO design books I<br>read.
So why the disconnect? Why does talking about this not resonate with other<br>Rust programmers? I think because in the Rust culture, "objects" are something<br>very different. They're virtual destructors & inheritance trees. They're a<br>nasty thing C++ had that Rust forwent because dynamic dispatch is<br>slow (except in Zig of course where it's fast now). Of course Rust<br>isn't OO!
But for those of us who took object-oriented design seriously, everything you<br>read just reinforced that they're neat little black boxes you call methods on.<br>And of those, rust is full.