Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds
Refactoring with C#
Refactoring with C#

Refactoring with C#: Safely improve .NET applications and pay down technical debt with Visual Studio, .NET 8, and C# 12

eBook
$38.99
Paperback
$47.99
Subscription
Free Trial
Renews at $12.99p/m

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
Product feature icon AI Assistant (beta) to help accelerate your learning
OR
Modal Close icon
Payment Processing...
tick Completed

Billing Address

Key benefits

  • Apply a wide range of refactoring techniques using the latest tools and features of C#
  • Discover ways to safely improve your code using tests, Roslyn analyzers, and AI assistance
  • Find ways of communicating technical debt and improving your code in agile and enterprise settings
  • Purchase of the print or Kindle book includes a free PDF eBook

Description

Software projects start as brand-new greenfield projects, but invariably become muddied in technical debt far sooner than you’d expect. In Refactoring with C#, you'll explore what technical debt is and how it arises before walking through the process of safely refactoring C# code using modern tooling in Visual Studio and more recent C# language features using C# 12 and .NET 8. This book, written by a Microsoft MVP, will guide you through the process of refactoring safely through advanced unit testing with XUnit and libraries like Moq, Snapper, and Scientist .NET. You'll explore maintainable code through SOLID principles and defensive coding techniques made possible in newer versions of C#. You'll also find out how to run code analysis and write custom Roslyn analyzers to detect and resolve issues unique to your code. The nature of coding is changing, and you'll explore how to use AI with the GitHub Copilot Chat to refactor, test, document, and generate code before ending with a discussion about communicating technical debt to leadership and getting organizational buy-in to refactor your code in enterprise organizations and in agile teams. By the end of this book, you'll understand the nature of refactoring and see how you can safely, effectively, and repeatably pay down the technical debt in your application while adding value to your business.

Who is this book for?

This book is for any developer familiar with C# who wants to improve the code they work with on a day-to-day basis. While this book will be most beneficial to new developers with only a year or two of experience, even senior engineers and engineering managers can make the most of this book by exploring not just the process of refactoring, but advanced techniques with libraries like Moq, Snapper, Scientist .NET, and writing custom Roslyn analyzers.

What you will learn

  • Understand technical debt, its causes and effects, and ways to prevent it
  • Explore different ways of refactoring classes, methods, and lines of code
  • Discover how to write effective unit tests supported by libraries such as Moq
  • Understand SOLID principles and factors that lead to maintainable code
  • Use AI to analyze, improve, and test code with the GitHub Copilot Chat
  • Apply code analysis and custom Roslyn analyzers to ensure that code stays clean
  • Communicate tech debt and code standards successfully in agile teams

Product Details

Country selected
Publication date, Length, Edition, Language, ISBN-13
Publication date : Nov 24, 2023
Length: 434 pages
Edition : 1st
Language : English
ISBN-13 : 9781835083277
Category :
Languages :

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
Product feature icon AI Assistant (beta) to help accelerate your learning
OR
Modal Close icon
Payment Processing...
tick Completed

Billing Address

Product Details

Publication date : Nov 24, 2023
Length: 434 pages
Edition : 1st
Language : English
ISBN-13 : 9781835083277
Category :
Languages :

Packt Subscriptions

See our plans and pricing
Modal Close icon
$12.99 billed monthly
Feature tick icon Unlimited access to Packt's library of 6,500+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Simple pricing, no contract
$129.99 billed annually
Feature tick icon Unlimited access to Packt's library of 6,500+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just $5 each
Feature tick icon Exclusive print discounts
$179.99 billed in 18 months
Feature tick icon Unlimited access to Packt's library of 6,500+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just $5 each
Feature tick icon Exclusive print discounts

Frequently bought together


Stars icon
Total $ 157.97
C# 12 and .NET 8 – Modern Cross-Platform Development Fundamentals
$59.99
Refactoring with C#
$47.99
Clean Code with C#
$49.99
Total $ 157.97 Stars icon
Visually different images

Customer reviews

Top Reviews
Rating distribution
Full star icon Full star icon Full star icon Full star icon Full star icon 5
(8 Ratings)
5 star 100%
4 star 0%
3 star 0%
2 star 0%
1 star 0%
Filter icon Filter
Top Reviews

Filter reviews by




N/A Apr 04, 2024
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Feefo Verified review Feefo
Matthew D. Groves Nov 28, 2023
Full star icon Full star icon Full star icon Full star icon Full star icon 5
This book is a C# developer's treasure trove. It's a class in improving your C# coding skills, especially in the realm of refactoring legacy .NET applications. I especially enjoyed the examples, that help convey the concepts even further, and sometimes inject a bit of humor and entertainment, without being distracting.What sets this book apart from others is an expectation of teamwork and collaboration. It's evident that the author understands that refactoring isn't a solo effort. The tips and techniques presented are designed to be shared and implemented in a team environment. It impresses collective ownership of code quality, which is essential in any successful software development team.The book dives into the latest features of .NET 8 and C# 12, and refactoring features of Visual Studio, making it a valuable reference for those looking to stay up-to-date with the latest advancements. However, the content in this book is still useful even if you are stuck on older versions, and the principles discussed can apply to just about any OO programming language. The author doesn't just skim the surface: there is a comprehensive understanding of how these tools can be applied to refactor code effectively and efficiently (with the exception of some parts of later chapters, keep reading).Each chapter is laden with practical advice and real-world scenarios that help bridge the gap between theory and practice. The examples are not only informative but also engaging, making the learning process both enjoyable and effective. The book's layout and structure make it easy to follow, with clear headings and summaries that help reinforce key concepts. Each chapter builds on the previous, but can also be read in isolation, if you are a more intermediate/advanced developer and want to skip to the chapters for those levels.My only critique is that the benefits of some of the more advanced chapters towards the end of the book are increasingly niche. They are for advanced, high performing teams, with complex code bases, who have already squeezed all the benefits out of the rest of the book, and are looking for more. Roslyn, in particular, is a deep, complex rabbit hole, and I don't believe the cost-to-benefit ratio of building the refactorings discussed in those chapters is going to payoff for most teams. That being said, this material is summarized and introduced well by the author, and there may be some long-term value to readers, as long as they understand that these efforts aren't low-hanging fruit, and further, that this book can only cover the tip of the iceberg.Definitely pick up a copy for yourself, a dozen copies as gifts for your developer friends, and a few copies for your tech book shelf at the office.
Amazon Verified review Amazon
Apostolos Michailidis Jun 24, 2024
Full star icon Full star icon Full star icon Full star icon Full star icon 5
The book is been read with pleasure and it is easy to understand, is giving several refactoring techniques using the C# features and gives some examples using tools like copilot, roslyn analyzer etc.
Amazon Verified review Amazon
Sam Gomez Jan 17, 2024
Full star icon Full star icon Full star icon Full star icon Full star icon 5
This book is a great step by step guide through the technical and personal skills needed to tackle refactoring projects. Matt's experience as a teacher shines throughout by explaining complex concepts in a very simple way.The first parts of the book cover the basic concepts that developers need to understand when refactoring their code and the practical exercises that accompany each chapter gives the reader the perfect chance to practice what has been learned.More experienced developers will also find plenty of value in this book, from building your own Roslyn analyzer to using the latest AI tools when refactoring code. Most importantly, the inclusion of how to communicate the value of refactoring to non-technical people is something that every developer (regardless of experience) needs to be able to do effectively.This book will make a great addition to your technical library and is a resource that is sure to provide value to anyone who reads it.
Amazon Verified review Amazon
DanylkoWeb Dec 28, 2023
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Once in a while, a solid C# book presents itself with coding principles and guidance to assist any developer throughout their career.This is one of those books.The book takes the reader on a journey through the career of a seasoned developer and his experiences. Matt examines every aspect of how to refactor code in a professional manner in the book.The first 3 parts of the book explain the technical aspects. Part 4, titled "Refactoring in the Enterprise", contains the most important chapters of the book. For example, how to handle discussions on refactoring, such as "We have a deadline. Don't worry about refactoring!" or "Refactoring doesn't have any value." These conversations are had by many developers.Each part almost feels dedicated to a particular level of developer throughout their career. Part 1 for beginners learning how to refactor code and learn the terminology. Part 2 is for the intermediate developers whereas Part 3 is meant for advanced developers. Part 4 is for developers working specifically in a team environment.I would absolutely recommend this book to .NET developers regardless of their experience.
Amazon Verified review Amazon
Get free access to Packt library with over 7500+ books and video courses for 7 days!
Start Free Trial

FAQs

How do I buy and download an eBook? Chevron down icon Chevron up icon

Where there is an eBook version of a title available, you can buy it from the book details for that title. Add either the standalone eBook or the eBook and print book bundle to your shopping cart. Your eBook will show in your cart as a product on its own. After completing checkout and payment in the normal way, you will receive your receipt on the screen containing a link to a personalised PDF download file. This link will remain active for 30 days. You can download backup copies of the file by logging in to your account at any time.

If you already have Adobe reader installed, then clicking on the link will download and open the PDF file directly. If you don't, then save the PDF file on your machine and download the Reader to view it.

Please Note: Packt eBooks are non-returnable and non-refundable.

Packt eBook and Licensing When you buy an eBook from Packt Publishing, completing your purchase means you accept the terms of our licence agreement. Please read the full text of the agreement. In it we have tried to balance the need for the ebook to be usable for you the reader with our needs to protect the rights of us as Publishers and of our authors. In summary, the agreement says:

  • You may make copies of your eBook for your own use onto any machine
  • You may not pass copies of the eBook on to anyone else
How can I make a purchase on your website? Chevron down icon Chevron up icon

If you want to purchase a video course, eBook or Bundle (Print+eBook) please follow below steps:

  1. Register on our website using your email address and the password.
  2. Search for the title by name or ISBN using the search option.
  3. Select the title you want to purchase.
  4. Choose the format you wish to purchase the title in; if you order the Print Book, you get a free eBook copy of the same title. 
  5. Proceed with the checkout process (payment to be made using Credit Card, Debit Cart, or PayPal)
Where can I access support around an eBook? Chevron down icon Chevron up icon
  • If you experience a problem with using or installing Adobe Reader, the contact Adobe directly.
  • To view the errata for the book, see www.packtpub.com/support and view the pages for the title you have.
  • To view your account details or to download a new copy of the book go to www.packtpub.com/account
  • To contact us directly if a problem is not resolved, use www.packtpub.com/contact-us
What eBook formats do Packt support? Chevron down icon Chevron up icon

Our eBooks are currently available in a variety of formats such as PDF and ePubs. In the future, this may well change with trends and development in technology, but please note that our PDFs are not Adobe eBook Reader format, which has greater restrictions on security.

You will need to use Adobe Reader v9 or later in order to read Packt's PDF eBooks.

What are the benefits of eBooks? Chevron down icon Chevron up icon
  • You can get the information you need immediately
  • You can easily take them with you on a laptop
  • You can download them an unlimited number of times
  • You can print them out
  • They are copy-paste enabled
  • They are searchable
  • There is no password protection
  • They are lower price than print
  • They save resources and space
What is an eBook? Chevron down icon Chevron up icon

Packt eBooks are a complete electronic version of the print edition, available in PDF and ePub formats. Every piece of content down to the page numbering is the same. Because we save the costs of printing and shipping the book to you, we are able to offer eBooks at a lower cost than print editions.

When you have purchased an eBook, simply login to your account and click on the link in Your Download Area. We recommend you saving the file to your hard drive before opening it.

For optimal viewing of our eBooks, we recommend you download and install the free Adobe Reader version 9.