this post was submitted on 03 Jul 2023
11 points (100.0% liked)

Programming

4 readers
1 users here now

This magazine is dedicated to discussions on programming languages, software development, and coding. Whether you are a beginner programmer or an experienced developer, this is the place for you. Here you can share your knowledge, ask questions, and engage in discussions on topics such as coding languages, software engineering, web development, and more. From the latest trends and frameworks to tips and tricks for debugging, this category covers a wide range of topics related to programming.

founded 1 year ago
 

Languages on the rise like Rust and Go are being quite vocal against inheritance and many engineers seem to agree. Why? And is it the fall of inheritance?

you are viewing a single comment's thread
view the rest of the comments
[–] ignirtoq@kbin.social 3 points 1 year ago

I think inheritance served as a good stepping stone to features like traits in Rust. I spent most of my early career in C and C++, and given just those 2, I would pick C++ for classes alone, even though that's nominally "picking inheritance." Because with C++ classes you can define interfaces and compose those objects better than you can with just functions and structures in C (no callback functions and void pointers, thank you).

So it's about the ergonomics of the language, and I think we as developers are collectively growing and exploring, figuring out what works and what doesn't, and with Rust and Go we're trying out those traits and interfaces we figured out in object oriented languages without dragging along classical inheritance. Given another 5, 10, 20 years, I'm sure we will have figured out what doesn't work in Rust and Go and see new languages dropping those concepts in favor of newer, even more ergonomic ones.