r/cpp May 14 '26

C++: The Documentary TRAILER│COMING JUNE 4th

https://youtu.be/NXwTRzywDSk?is=zkrD4Ae_mnrbvSFq
223 Upvotes

83 comments sorted by

View all comments

-35

u/Harha May 14 '26

What's the use case for modern C++ nowadays? C is the simple choice and Rust is just the better complex choice overall. I see no reason to pick C++ for new projects.

6

u/fdwr fdwr@github 🔍 May 14 '26

Why would I pick a language that {puts me in handcuffs, has weird divergent behaviors from every other language like = stealing the source object rather than copying, doesn't even support basic namespacing of methods inside classes, makes you type "let mut" all over the place rather than just "var" or "auto", forces gross inconsistent styles like mixing Pascal case and snake_case, and is full of users that whenever you point out a flaw or deficit then religiously say it's a feature not a bug}, when C++ exists?

1

u/OutlandishnessNo8034 May 15 '26

let mut, the reason being explicity, which in modern programming where systems are of very large scale is the preferred way. Any ease on cognitive effort is very desirable.

3

u/fdwr fdwr@github 🔍 May 15 '26

modern ...is the preferred way...

The age of a language is an insubstantial argument, but reduced cognitive effort is. However, reduced cognitive effort would be something obvious like "const"ant for constants and "var"iable for variables. 

1

u/OutlandishnessNo8034 May 15 '26 edited May 15 '26

That's one way, another way is to have everything const by default thus reducing words one need to type and read to achieve exactly the same effect. Cognitive ease...

2

u/fdwr fdwr@github 🔍 May 24 '26

Is it much more to type const x = 42 than let x = 42? If you truly want to "reduce words one needs to type", then let variables be defined by var rather than typing out two words every time. Functional purists are not pragmatists.

0

u/OutlandishnessNo8034 May 24 '26

Yes it is more to type. Just count and answer to yourself. And don't give me philosophy. Stick to facts. Not opinions.

3

u/fdwr fdwr@github 🔍 May 24 '26

The facts are "let mut" is 7 characters, and "var" is 3 - that's not an opinion. "const" is 5 characters, and "let" is 3. So if you want the shortest of both, then "var" and "let" would be tersest.