(Replying to PARENT post)

The bullet list near the end closely matches my own experience with C++. There's an inordinate number of features creating an even worse profusion of edge cases where they interact. Then the "solutions" for those edge cases usually add even more complexity. Worse, they force programmers to coddle their compilers. The ratio between what a C++ compiler will accept and what it will produce sane code for is huge. That's why every C++ codebase I've ever seen is full of code to do things that shouldn't be necessary, and goes through all sorts of contortions to avoid doing things that should be OK, lest the compiler spew out an un-debuggable mess.

I'm perfectly happy managing my own complexity in C, or avoiding it entirely in Python. C++, on the other hand, seems to have been designed by compiler writers for their own enjoyment and/or job security. Every other "systems programming language" from D to Objective-C to Go to Rust to Nim presents a more coherent face to the programmer.

๐Ÿ‘คnotacoward๐Ÿ•‘7y๐Ÿ”ผ0๐Ÿ—จ๏ธ0

(Replying to PARENT post)

> C++, on the other hand, seems to have been designed by compiler writers for their own enjoyment and/or job security.

Being a C++ compiler writer (Zortech C++, Symantec C++, Digital Mars C++) I can assure you this is not true at all.

As to why C++ is so complex, my opinion is it is because it was designed a long time ago, what is considered better practice in designing languages has moved on, and C++ is unwilling to let go of the old decisions.

(There's always some major and vocal user who has build their entire store around some ancient feature.)

For example, why does C++ still support EBCDIC?

๐Ÿ‘คWalterBright๐Ÿ•‘7y๐Ÿ”ผ0๐Ÿ—จ๏ธ0

(Replying to PARENT post)

Sure, it's a large and complex language that takes time to master. But I'm interested to hear examples of what you call 'profusion of edge cases'.

> The ratio between what a C++ compiler will accept and what it will produce sane code for is huge.

As is the case for any programming language.

> C++, on the other hand, seems to have been designed by compiler writers for their own enjoyment and/or job security.

C++ is designed by its standards committee... If you know anything about the struggles compiler writers have had with implementing the standard, you'd know the standards committee definitely does not consist of compiler writers! It's really cheap to summarize their efforts as motivated by advancing their own job security if you ask me... I can recommend you to attend a meeting or to read some proceedings to convince yourself otherwise.

๐Ÿ‘คclishem๐Ÿ•‘7y๐Ÿ”ผ0๐Ÿ—จ๏ธ0

(Replying to PARENT post)

C++ is a mess but it's one of the few languages that gives you low-level control of memory and fast code with zero or near zero cost abstractions. So for a certain class of application it's still the best choice. Music software, for example, is pretty much exclusively written in C++. I don't enjoy C++ the language very much but you can build some very cool things with it.

Personally I'm hoping Rust displaces it from most of these remaining niches but even if it does it will probably happen slowly.

๐Ÿ‘คcageface๐Ÿ•‘7y๐Ÿ”ผ0๐Ÿ—จ๏ธ0

(Replying to PARENT post)

I agree that C++ is bad but I actually find C much worse for projects bigger than a few thousands of lines. Reasons for this:

* lack of namespaces - all names with long prefix look the same to me

* just text based macros

* no generics

* error handling usually based on int constants and output function parameters - in big projects is hard to use them consistently without any type checking

* no polymorphism

* ton of undefined behavior (almost the same as C++)

๐Ÿ‘คoselhn๐Ÿ•‘7y๐Ÿ”ผ0๐Ÿ—จ๏ธ0

(Replying to PARENT post)

>"C++, on the other hand, seems to have been designed by compiler writers for their own enjoyment and/or job security."

It's not what a compiler writer would want by any stretch. Having helped write a C++ compiler I can a test to that. I will agree that C is a nice language. It does exactly as you tell it.

The complexity I would say is what you get when you "design by committee"

Web standards have a similar problem they keep growing and getting more complex. Try to write a browser from the ground up these days.

๐Ÿ‘คanfilt๐Ÿ•‘7y๐Ÿ”ผ0๐Ÿ—จ๏ธ0

(Replying to PARENT post)

Strongly agree on the inordinate number of features point. Which other mainstream OO language supports dynamic & static dispatch, single & multiple inheritance, interface inheritance via abstract classes, generic types and functions via templates, lambdas, type inference, and operator overloading? Roll that up with C compatibility, a 30 year history of evolution, and the complexity of commonly adopted libraries like STL & Boost, and there's simply no avoiding it. There's a lot of C++ out there, and I'm confident that will pay the bills for years to come for this 50 something 25 year C++ veteran!
๐Ÿ‘คosullivj๐Ÿ•‘7y๐Ÿ”ผ0๐Ÿ—จ๏ธ0

(Replying to PARENT post)

C++ is a language with a lot of features, and not all of them should be used in every code base. It's quite possible to write simple, portable, and relatively clean C++ code if you use only those features you need.

It's not the prettiest language by any stretch, but it's quite capable and fast and has excellent support across just about every platform.

๐Ÿ‘คapi๐Ÿ•‘7y๐Ÿ”ผ0๐Ÿ—จ๏ธ0

(Replying to PARENT post)

Regarding D, it looks like that, but any big code base enjoys meta-programming (mixins), templates.

They have a ton of warts regarding annotations, usually worked around by using templates, because on that case they are inferred.

The semantics of shared are still being worked on.

The way const/immuatable works, makes some devs just give up and remove them from their code.

I can equally tell some Objective-C issues.

Yes, in general they are better than C++, but not without their own warts.

๐Ÿ‘คpjmlp๐Ÿ•‘7y๐Ÿ”ผ0๐Ÿ—จ๏ธ0

(Replying to PARENT post)

Not to do the c vs c++ thing, I too prefer c. For over 20 years actually I have preferred c to c++; all the while learning and enjoying other languages like rust. c still is missing some crucial stuff in my opinion-- there are times where I wish generics existed, and when you tie that to a trait system like in rust it's really a pity to not have something like that in c. Couple that with really great package managers for libraries in other languages, and a coherent way to use the libraries, makes one long for more when working in c; it's really missing great and easy code sharing that so many other languages have at their front and center.
๐Ÿ‘คviperscape๐Ÿ•‘7y๐Ÿ”ผ0๐Ÿ—จ๏ธ0

(Replying to PARENT post)

> C++, on the other hand, seems to have been designed by compiler writers for their own enjoyment and/or job security.

If that were the case, the Edison Design Group (https://en.wikipedia.org/wiki/Edison_Design_Group) wouldn't exist. It exists because compiler writers don't want to have to deal with parsing C++.

(Then there's Dinkumware, which serves the same purpose for library functions.)

๐Ÿ‘คjejones3141๐Ÿ•‘7y๐Ÿ”ผ0๐Ÿ—จ๏ธ0

(Replying to PARENT post)

How is Rust less complicated than C++? I don't use it, but from what I read it seems to be even more complicated, and getting even more so with the myriad of features they are adding each release.
๐Ÿ‘คmikevm๐Ÿ•‘7y๐Ÿ”ผ0๐Ÿ—จ๏ธ0

(Replying to PARENT post)

Oh give me a break. Following this logic, why aren't you writing your code in English?

The real world is complex. Don't confuse hiding complexity with minimizing complexity.

๐Ÿ‘คhux_๐Ÿ•‘7y๐Ÿ”ผ0๐Ÿ—จ๏ธ0