4 ms·
C++ has a lot of features (large surface area) and power. This power is the result of powerful language constructs like inheritance, operator overloading, templ
by dilipdasilva 5y ago
C++ has a lot of features (large surface area) and power. This power is the result of powerful language constructs like inheritance, operator overloading, templates, etc. This can make it very powerful and concise for writing code. When power is hidden, it makes it very difficult to read.
C just has data structures and functions (small surface area). Its simplicity makes it much easier to read.
Some languages prioritize adding features and power. C++, Rust, and Swift are examples.
Other languages prioritize minimizing the surface area. C, Go and Scheme are examples.
Programmers either value minimal surface area (better for reading) or maximal features and power (better for writing) and are more likely to adopt languages based on this classification.
For example, C programmers are more likely to adopt Go over C++ and Rust. And, C++ programmers are more likely to adopt Rust.
- longtrousers 5y agoThis summary is absolutely amazing. It makes you think, given that code gets read a lot more than it gets written. It also makes me curious about Scheme, because I didn't know that it belongs to that category. I think that it's also important to add that C++ sort of belongs to a category of its own, because it has an absolutely enourmous surface area compared to e.g. Rust.
- bfrog 5y agoI actually disagree, while Rust has a great deal of features it’s still significantly easier to read. A big part of that I think comes from not having implicit function overloads and having not succumbed to the multitude of bikeshed acceptable language subsets C++ has developed over the many years it has existed. The rust you write on a microcontroller isn’t actually that different than the rust you’d write for a web app. Perhaps a clear sign that the parents statement is evidently incorrect is the acceptance of rust and the utter denial of C++ in the Linux kernel, where developers demand readability. Part of that may very well be what Rust provides as a feature set is enticing enough to work with whatever readability issues have come up.