Refactor code to use new C# language features
-
Jet Brains[^]:
Modernizing, or migrating to modern language features in any language can help make code more readable, efficient and secure. In this blog post, we’ll look at ways to modernize code so it’s better than before.
Time to redecorate
The actual mechanisms might be ReSharper-specific, but the concepts aren't Edit: forgot the blurb before clicking post
-
Jet Brains[^]:
Modernizing, or migrating to modern language features in any language can help make code more readable, efficient and secure. In this blog post, we’ll look at ways to modernize code so it’s better than before.
Time to redecorate
The actual mechanisms might be ReSharper-specific, but the concepts aren't Edit: forgot the blurb before clicking post
Romans go home! (I just felt like I hadn't said that recently.) Having said that... The old ways are the best ways. Don't use new features of anything unless they actually improve things.
Kent Sharkey wrote:
can help make code more readable, efficient and secure
more readable -- Only if you know the new feature and don't know the old one. efficient -- I have never seen that, at least not runtime-efficient. Often "new" features are less runtime-efficient. They may make a poor developer more productive, churning out poorly-performing code more quickly. secure -- Definitely not. Unless it means that said poor developer can't break things as easily. Edit: Plus, refactoring often leads to bugs. If the existing code is "less readable" than the newer developers would like, then they must not touch it. "Progress for the sake of progress must be discouraged."
-
Romans go home! (I just felt like I hadn't said that recently.) Having said that... The old ways are the best ways. Don't use new features of anything unless they actually improve things.
Kent Sharkey wrote:
can help make code more readable, efficient and secure
more readable -- Only if you know the new feature and don't know the old one. efficient -- I have never seen that, at least not runtime-efficient. Often "new" features are less runtime-efficient. They may make a poor developer more productive, churning out poorly-performing code more quickly. secure -- Definitely not. Unless it means that said poor developer can't break things as easily. Edit: Plus, refactoring often leads to bugs. If the existing code is "less readable" than the newer developers would like, then they must not touch it. "Progress for the sake of progress must be discouraged."
PIEBALDconsult wrote:
Often "new" features are less runtime-efficient.
But definitely not always. For example, the new
Span<T>
/ReadOnlySpan<T>
methods can drastically increase performance and reduce memory allocations - if you know what you're doing. :) If you've got a few hours spare, Stephen Toub posts some excellent long-form blogs on the performance improvements in various new versions of .NET: Performance Improvements in .NET Core - .NET Blog[^] Performance Improvements in .NET Core 2.1 - .NET Blog[^] Performance Improvements in .NET Core 3.0 - .NET Blog[^] Performance Improvements in .NET 5 - .NET Blog[^] Performance Improvements in .NET 6 - .NET Blog[^] Performance Improvements in .NET 7 - .NET Blog[^] Edit: Whoops! Just noticed the post below: The Insider News[^]
"These people looked deep w
-
Jet Brains[^]:
Modernizing, or migrating to modern language features in any language can help make code more readable, efficient and secure. In this blog post, we’ll look at ways to modernize code so it’s better than before.
Time to redecorate
The actual mechanisms might be ReSharper-specific, but the concepts aren't Edit: forgot the blurb before clicking post
Problem - this is extremely low-priority "technical debt", and a regression testing nightmare.Any project manager worth his salt would take heroic steps to avoid doing it.
".45 ACP - because shooting twice is just silly" - JSOP, 2010
-----
You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010
-----
When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013 -
Jet Brains[^]:
Modernizing, or migrating to modern language features in any language can help make code more readable, efficient and secure. In this blog post, we’ll look at ways to modernize code so it’s better than before.
Time to redecorate
The actual mechanisms might be ReSharper-specific, but the concepts aren't Edit: forgot the blurb before clicking post
Lipstick on a pig!
PartsBin an Electronics Part Organizer is finally available for download. JaxCoder.com