My focus is on making software, coaching Agile/Scrum teams, and being a husband and father--definitely not on blogging--so please do not expect very frequent posts here.

Sunday, April 12, 2020

See me at the all-online Minnesota Developer's Conference, May 4, 2020

On May 4, 2020, I gave a talk on Practical Refactoring in C# at the Minnesota Developer's Conference, live online. The all-day virtual conference was only $20 and has some of the best speakers around on C#, Blazor, Javascript, Azure, and soft skills for developers.

My session is all about how to make your C# code better and to do it more routinely and with high-confidence. Too often, we are afraid to refactor because we might break something--but we err on the side of false caution, because our dirty, confusing code causes more bugs than a refactoring would. I'll show my favorite refactorings and demonstrate how to get into the habit of always improving.

I also am excited to see my colleagues Kamran Ayub, Erik Onarheim, and Elsa Vezino present there, and I always love more Benko-tips and wisdom from Ward. Thanks a ton to Jason Erdahl and his team at ILM for moving this thing online rather than cancelling--I've never been as interested in a live online conference before!

Video: Practical Refactoring in C#


Demo Code
My favorite refactorings:
  • Tool-assisted:
    • Rename
    • Extract method
    • Move
    • Remove unused usings
    • Reduce nesting: Invert if; combine singly-nested Ifs;
    • Extract interface
    • Restrict access modifiers
    • Code against nonexisting members then generate
  • Manual:
    • Simplify boolean logic
    • Early return
    • Reduce newline usage
    • Convert If-else to ternary
    • Eliminate/simplify loops with LINQ
    • Iterate instead of repeat code (try lambdas or private classes)
    • Replace Start/Stop methods with an IDisposable
    • 7 steps to add dependency injection
Other sources: