Re:John Carmack on Mutable Variables
by MrNet32823 on Friday October 31, 2025 @06:19AM
(#45770353)
Jonathan Blow had strong objection with const keyword. I forgot because i did not understand at that time. Does anyone with jai experience have a counter point to that.
[ Parent
| on HN ]
Re:John Carmack on Mutable Variables
by JonChesterfield on Friday October 31, 2025 @07:51AM
(#45771005)
I believe the standard counterargument goes:
- either it's transitive, in which case your type system is very much more complicated
- or it isn't, in which case it's a near useless liability
Naturally C++ runs with the latter, with bonus extra typing for all the overloads it induces.
How isn't it transitive in C++? If the variable/reference is const, you can't modify fields, and you can only call const methods. What else do you need?
Re:John Carmack on Mutable Variables
by dude250711 on Friday October 31, 2025 @06:24AM
(#45770385)
He also stopped shipping things.