←back to thread

498 points azhenley | 2 comments | | HN request time: 0.001s | source
Show context
shmerl ◴[] No.45768080[source]
Proposing making immutable by default in C or C++ doesn't make sense due to backwards compatibility reasons. New languages like Rust have easier time making better choices with immutable by default.
replies(4): >>45768149 #>>45768408 #>>45771014 #>>45773596 #
1. NathanaelRea ◴[] No.45768408[source]
They could just add a "use immutable;" directive that you place at the top of your file.
replies(1): >>45768453 #
2. Pxtl ◴[] No.45768453[source]
C# does this with the null hole. I wish more languages would take a versioning approach to defaults at the file-level.