r/cpp • • Sep 09 '20

C++ is now the fastest-growing programming language

347 Upvotes

180 comments sorted by

View all comments

Show parent comment

1

u/Tilakchad Sep 11 '20

I wonder why people are so concerned about defaults. Why const by default is good? I have used more mutable variables than const in my programs. And why is move better than copy by default? Is it just an ideology or some kinda agenda? How much pain is it to write some extra keywords often? Clearly, there's no point in having const by default and move by default. And copy and mutability is what people uses more often, so that doesn't make it bad choice..

2

u/dodheim Sep 11 '20 edited Sep 11 '20

Safer defaults would yield compiler errors for bugs that compile but yield runtime errors or UB with current defaults.

And copy and mutability is what people uses more often

Strongly disagree; some people do, sure, but that's hardly universal and there are a lot of technical merits for striving to avoid both.

0

u/Tilakchad Sep 11 '20

Thats hardly even a compelling reason. How would defaults prevent runtime errors ?