30% OFF - Use code HANDSON30 for 30% off any course or Dometrain Pro! Browse courses →
  • Courses
  • Learning Paths
  • Blogs
  • Authors
  • Leaderboard
  • Dometrain Pro
  • Shopping Basket

    Your basket is empty

  • Business Portal
  • From Zero to Hero: Refactoring for C# Developers

    Learn refactoring techniques in C# to improve code quality and maintainability. This course covers modern practices to optimize your codebase, with examples to enhance readability, and testability.

    About This Course

    Are you a C# developer keen on enhancing code quality and maintainability? If yes, this "From Zero to Hero" course called "Refactoring for C# Developers" is tailor-made for you! This course will equip you with practical skills and the latest practices to refactor any C# codebase. Starting with an overview of refactoring, its importance, and when it's needed, the course delves into various modern and clean refactoring techniques. The best part? The course uses real-world examples to demonstrate how to transform a codebase to make it more efficient, readable, and extendable. With a focus on hands-on learning, guided examples are provided to demonstrate the refactoring process. But that's not all! The course also covers the implications of refactoring on team collaboration and project scalability. By the end of this course, you'll have a solid grasp of refactoring practices, which you can apply directly to your C# development projects. This course is delivered by Nick Cosentino, a Principal Software Engineering Manager at Microsoft, and is based on years of hands-on experience in the field.

    Course Curriculum

    5h 7m 10 sections
    Welcome
    04:42 Free preview
    What will you learn in this course?
    04:34 Free preview
    Who is the course for and prerequisites
    04:14 Free preview
    Teaching style
    03:29
    What is refactoring?
    08:30
    What are the general goals of refactoring?
    13:00
    Introduction
    02:34
    Renaming private members
    07:05
    Renaming public members
    07:24
    Extract method
    06:14
    Inline method
    06:57
    Section recap
    01:59
    Introduction
    02:05
    Decompose conditional
    18:31
    Replace with temp query
    09:11
    Return early / reduce nesting
    10:52
    Section recap
    01:03
    Introduction
    01:28
    Wrap/isolate dependencies
    23:51
    Extract and inject
    19:39
    Section recap
    02:12
    Introduction
    01:43
    Parameters to parameter object
    09:19
    Replace conditional with polymorphism and composition
    17:52
    Introduction
    01:26
    Rule of 3 and DRY
    11:36
    Pull up method
    10:54
    Form template method
    07:26
    What is a rewrite vs refactor?
    19:41
    What are the pros of rewriting?
    12:09
    What are the cons of rewriting?
    16:48
    Mitigating risks in large refactors
    11:16
    Introducing the example
    02:03
    Conversion routes
    03:04
    Weather web response
    02:24
    Rule of three + DRY on DTOs
    03:36
    Strangler fig + repository facade
    11:15
    Summary of example
    01:28
    Conclusion
    02:28

    Meet Your Instructor

    Nick Cosentino

    Nick Cosentino

    Nick Cosentino is a Principal Software Engineering Manager at Microsoft and a .NET content creator. He manages the teams responsible for deploying the hundreds of services supporting the Microsoft365 suite of products to serve users across the planet. Nick brings his unique experiences to the Big Tech world having worked at a startup that scaled from a handful of employees to hundreds before it went public.

    Nick runs a software engineering and dotnet-focused blog as well as a YouTube channel called Dev Leader. While he enjoys solving complex problems with software solutions, Nick is passionate about reducing barriers for people to get started on their software engineering journey.

    View all courses by Nick Cosentino

    What's New

    Getting Started: Model Context Protocol (MCP)
    course

    Getting Started: Model Context Protocol (MCP)

    Learn how to get started with the Model Context Protocol (MCP) and integrate it into your applications.

    Learn more about Getting Started: Model Context Protocol (MCP)
    Hands-On: Learn TypeScript
    course

    Hands-On: Learn TypeScript

    Learn TypeScript through hands-on coding exercises. Practice what you learn with interactive challenges designed for every level.

    Learn more about Hands-On: Learn TypeScript
    Hands-On: Learn JavaScript
    course

    Hands-On: Learn JavaScript

    Learn JavaScript through hands-on coding exercises. Practice what you learn with interactive challenges designed for every level.

    Learn more about Hands-On: Learn JavaScript
    Hands-On: Data Structures & Algorithms in C#
    course

    Hands-On: Data Structures & Algorithms in C#

    Master data structures and algorithms through hands-on coding exercises in C#. Free to enroll for 7 days!

    Learn more about Hands-On: Data Structures & Algorithms in C#
    Blogsmith.ai
    feature

    Blogsmith.ai

    Turn your videos into blogs and newsletters with AI. Check out our new product at blogsmith.ai.

    Learn more about Blogsmith.ai
    Leaderboard
    feature

    Leaderboard

    See how you stack up against other learners. Track your progress, climb the ranks, and compete with the Dometrain community.

    Learn more about Leaderboard
    Hands-On: Learn PostgreSQL
    course

    Hands-On: Learn PostgreSQL

    Learn PostgreSQL through hands-on coding exercises. Practice what you learn with interactive challenges designed for every level.

    Learn more about Hands-On: Learn PostgreSQL
    Free Hands-On: C# for Beginners
    course

    Free Hands-On: C# for Beginners

    Learn C# through hands-on coding exercises. Practice what you learn with interactive challenges designed for everyone, from beginners to experts.

    Learn more about Free Hands-On: C# for Beginners
    Getting Started: AI for .NET Developers
    course

    Getting Started: AI for .NET Developers

    Get started with integrating AI into your .NET applications effectively using the latest LLM best practices.

    Learn more about Getting Started: AI for .NET Developers
    Getting Started: Building .NET Applications on AWS
    course

    Getting Started: Building .NET Applications on AWS

    Learn how to build and deploy .NET applications on AWS using CDK, Lambda, DynamoDB, S3, and more.

    Learn more about Getting Started: Building .NET Applications on AWS
    What's new in C# 14
    blog

    What's new in C# 14

    This guide covers every new C# 14 feature, explains its benefits, and provides practical code examples to help you navigate how you can use them.

    Learn more about What's new in C# 14
    Let's Build It: AI Chatbot with RAG in .NET Using Your Data
    course

    Let's Build It: AI Chatbot with RAG in .NET Using Your Data

    Build a Retrieval-Augmented Generation (RAG) chatbot that can answer questions using your data.

    Learn more about Let's Build It: AI Chatbot with RAG in .NET Using Your Data
    From Zero to Hero: SignalR in .NET
    course

    From Zero to Hero: SignalR in .NET

    Enable enterprise-grade real-time communication for your web apps with SignalR.

    Learn more about From Zero to Hero: SignalR in .NET
    Deep Dive: Solution Architecture
    course

    Deep Dive: Solution Architecture

    Master solution architecture and turn business needs into scalable, maintainable systems.

    Learn more about Deep Dive: Solution Architecture
    Migrating: ASP.NET Web APIs to ASP.NET Core
    course

    Migrating: ASP.NET Web APIs to ASP.NET Core

    A step-by-step process to migrate ASP.NET Web APIs from .NET Framework to ASP.NET Core.

    Learn more about Migrating: ASP.NET Web APIs to ASP.NET Core
    Getting Started: Caching in .NET
    course

    Getting Started: Caching in .NET

    Let's make the hardest thing in programming easy for .NET software engineers.

    Learn more about Getting Started: Caching in .NET
    From Zero to Hero: Testing with xUnit in C#
    course

    From Zero to Hero: Testing with xUnit in C#

    Learn how to test any codebase in .NET with the latest version of xUnit, the industry-standard testing library.

    Learn more about From Zero to Hero: Testing with xUnit in C#
    Create a ChatGPT Console AI Chatbot in C#
    blog

    Create a ChatGPT Console AI Chatbot in C#

    This walkthrough is your hands-on entry point to create a basic C# console application that talks to ChatGPT using the OpenAI API.

    Learn more about Create a ChatGPT Console AI Chatbot in C#