4 ms·
Fun thing is the current explaination regards readonly locals: https://github.com/dotnet/csharplang/issues/188#issuecomment-1077768460 https://github.com/dotnet
by oaiey 4y ago
Fun thing is the current explaination regards readonly locals: https://github.com/dotnet/csharplang/issues/188#issuecomment-1077768460 https://github.com/dotnet/csharplang/issues/188#issuecomment...
It is basically: if we introduce it, it gives us a tiny benefit for a gigantic amount of noise during every single code review. It boils down to comparing developer productivity vs. language safety.
I find the argument a bit weak since code review guidelines can end this conversation AND C# has already quite some code analysis code fixes to auto-fix language usage stuff (like file scoped namespaces or nullability checks). And that case of const and readonly can be algorithmically checked.
- trinovantes 4y agoIt does seem like a weak argument when it can be enforced/fixed by linters e.g. this is already solved in JS with eslint prefer-const rule I suppose you can emulate it today with variable prefixes/suffixes and check the AST with a custom linter yourself
- awild 4y agoEspecially since its not really a language safety feature. As a reader of code I much prefer knowing what I need to pay much attention and what not. As a writer I want to be reminded when I promised myself to not touch a variable.
- codeflo 4y agoSome of the comments in that thread must come from people who are lucky enough to have never had to read or refactor any large, convoluted methods. Knowing that this particular bool flag isn’t being flipped thrice, 100 lines down, is a godsend.
- oaiey 4y agoThat is indeed a problem every once in a while. These people develop a framework and 3 languages. They do not built large systems. But there are other groups at Microsoft which keep them on track with their real needs.