General Tech

Why isn't mutable a subtype of immutable, or vice versa?

The article discusses the relationship between mutable and immutable types in programming, questioning why they are not subtypes of each other. The author, a software developer, explains the concept of subtyping and its relation to inheritance and method overriding. They argue that mutable and immutable types have different properties and behaviors, making them distinct categories that cannot be subtypes of each other. The author also touches on the concept of a 'mutable' type being a subtype of an 'immutable' type, citing examples from various programming languages, including Java and Rust.

Read the full article at crumbles.blog →