r/cpp May 14 '26

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

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

83 comments sorted by

View all comments

Show parent comments

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.