No. The comments about CLR change requirement are about other features suggested in comments (also not actually necessary for 99.9% of cases, just more convenient to implement them that way).
Readonly locals don't 'require' any change to the CLR.
A blank check to refactor is rare and hard to come by. I'd love to see a company where you're allowed to clean up every piece of code you ever touch but I suspect they're rare and incredibly rich.
I work in a 10 year old application that has been under constant development for that whole time. Huge chunks of it would take weeks to clean up well (written long ago in a huge rush, as is normal for early stage startups), if I'm there investigating one small issue I can't justify the cost and risk of an in depth refactor.
On the other side of the coin I'm currently in charge of a project to rewrite the entire payments, billing and accounting potion of this application and its being cleaned up because we managed to sell it to the people who hold the money.
No need to assume you're the only person whose ever tried to be good at their job, I assume most of us here know not to write 1000 line methods...
As much as /u/SalizarMarxx is being sorta naive about large code bases and the difficulty to refactor, refactoring does not have to be a very time consuming process. C# and visual studio have pretty good refactoring tools and if you are working with legacy code you should at least do a minor refactor of a function that is long horrible and ugly. Even a variable rename, or inverting an if statement, switching to foreach or a number of other tiny changes can help improve a function. And if you get in a mode where you do a single minor refactor each time you touch the code then the code will slowly get better.
Bigger refactorings are certainly tricky, extract method is extremely useful, but it's not always possible. However visual studio does have pretty great support for automatically doing it, and even if it requires passing variables by reference into it it's still potentially better.
18
u/[deleted] Mar 09 '16
[removed] — view removed comment