Re:Rust went from side project to world’s fastest growing la...
by aldanor on Tuesday February 14, 2023 @11:25AM
(#34791690)
You have a shape which can be either a circle which then has a radius, or a rectangle which has width/height. The shape cannot be anything else, this is important and something you want to rely on and express in code. In C++ you can't easily do this on the language level. In Rust (albeit in a somewhat limited way) and functional languages, you can, via enums where variants can host other types.
[ Parent
| on HN ]
There are no comments on this comment yet.