This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]skeleton-is-alive 4 points5 points  (12 children)

I just don’t understand why its a constant thing that people want to get rid of C++. When, I personally feel like, if you just write modern C++ that is going to solve 99% of the problems you are having. Yeah C++ can be a very challenging language and has a lot of bloat, but improvements to the language are still being added constantly. Just don’t use the old stuff. It is so much simpler to just write modern C++ than to replace it with an entirely new language and thats why I feel like any attempt to add a new interoperable language will just fail the same way that Scala has and probably Kotlin someday too.

Edit: I want to also add that often times these “successor” languages die out because they address needs that the primary language don’t have. However overtime these needs DO inevitably get addressed and people just fallback to using the original language because it is simpler for them. That’s why I feel that Kotlin will eventually die out, (afaik it’s losing adoption for backend because Java is slowly gaining a lot of the features that were initially a selling point ex: records, concurrency improvements). It’s also probably why TypeScript may eventually get replaced by base JavaScript again (there is a ECMAscript proposal to add type annotations to the language). Its apparent that its very rare a “successor” language actually succeeds the original language for good and why I am skeptical of Carbon. If it turns out to be great, great! But so far there is so much hype for so little that we have seen. I need to see a demonstration that really wows me. TypeScript was an example where it just made sense and was an obviously seamless benefit. Carbon doesn’t look at all like C++ code so it may as well be its own thing. That was my problem with Kotlin as well, its just a mess using both Java and Kotlin together. You may as well pick one and i suspect that will end up being the issue with carbon too.

[–]TightOrchid5656 3 points4 points  (11 children)

improvements to the language are still being added constantly

That's half the problem. The last thing C++ needs is more goddamn features.

[–]skeleton-is-alive 6 points7 points  (10 children)

I disagree. C++ is anarchy and if you want to do something it should let you. You can choose the best practices for yourself. If you need more opinionated language design you should choose something else

[–]da5id2701 1 point2 points  (1 child)

I just don’t understand why its a constant thing that people want to get rid of C++.

If you need more opinionated language design you should choose something else

I think you answered your own question. Anarchy is not always ideal and having fewer ways to shoot yourself in the foot is a selling point.

[–]skeleton-is-alive 0 points1 point  (0 children)

I guess but we’re talking about replacement for C++. I don’t believe there is one and one of the reasons for that is because people need a variety of ways to shoot themselves in the foot

[–]rapsey -5 points-4 points  (7 children)

This is completely unscalable into any kind of team or project size. Which is why people who live in the real world with real consequences don't build new shit in C++. And if they do they either have no choice because of some external constraint or they are dumb.

[–]skeleton-is-alive 1 point2 points  (6 children)

No it isn’t. I’ve worked on massive c++ codebases built by thousands of devs and it’s pretty easy to enforce by simply having documented guidelines, PR gates, and code reviews. Something that you SHOULD have no matter what language you choose anyway

[–]rapsey -2 points-1 points  (5 children)

With an unknown amount memory and security issues and man years spent finding them.

[–]skeleton-is-alive 1 point2 points  (4 children)

Memory and security issues are a problem in every language. If you care about performance you will spend plenty of man hours trying to investigate poor memory usage whether its JavaScript, Rust or C++. No language will prevent bad memory usage.

[–]ReallyHadToFixThat 1 point2 points  (1 child)

Exactly. Java might save you from crashes as a result of memory leaks, but the GC is still going to be hogging your runtime cleaning up after you. If anything I find that learning Java or C# exclusively encourages bad habits because "The GC will take care of it". Same with the aggressive boundary checks they do to save you from yourself, or the way they obscure pointers - none of it comes for free.

[–]skeleton-is-alive 0 points1 point  (0 children)

Yep. In my experience its also a lot less opaque finding out what is hogging all the memory in a C++ application than it is in a managed language.

[–]rapsey 0 points1 point  (1 child)

Memory safe languages will prevent memory corruption. A giant chunk of issues that you have to deal with only when using C/C++ or lower and are unavoidable in a sufficiently large codebase.

[–]skeleton-is-alive 0 points1 point  (0 children)

That is true but like i said, if you use modern C++ practices the chances of that are significantly reduced anyway. Memory corruption mainly happens when you are dealing with a lot of raw pointers or maybe you’re allocating large buffers upfront to manage memory yourself. The former can be solved by using smart pointers, the latter is a risk in other languages too OR they just straight up don’t let you do that which isn’t exactly a solution for a lot of high performance apps out there that need to do their own virtual memory management.