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

Arrow left icon
Profile Icon Matt Eland
Arrow right icon
£9.99 per month
Full star icon Full star icon Full star icon Full star icon Full star icon 5 (8 Ratings)
Paperback Nov 2023 434 pages 1st Edition
eBook
£28.99
Paperback
£35.99
Subscription
Free Trial
Renews at £9.99p/m
Arrow left icon
Profile Icon Matt Eland
Arrow right icon
£9.99 per month
Full star icon Full star icon Full star icon Full star icon Full star icon 5 (8 Ratings)
Paperback Nov 2023 434 pages 1st Edition
eBook
£28.99
Paperback
£35.99
Subscription
Free Trial
Renews at £9.99p/m
eBook
£28.99
Paperback
£35.99
Subscription
Free Trial
Renews at £9.99p/m

What do you get with a Packt Subscription?

Free for first 7 days. £13.99 p/m after that. Cancel any time!
Product feature icon Unlimited ad-free access to the largest independent learning library in tech. Access this title and thousands more!
Product feature icon 50+ new titles added per month, including many first-to-market concepts and exclusive early access to books as they are being written.
Product feature icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Product feature icon Thousands of reference materials covering every tech concept you need to stay up to date.
Subscribe now
View plans & pricing

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 : 9781835089989
Category :
Languages :
Tools :

What do you get with a Packt Subscription?

Free for first 7 days. £13.99 p/m after that. Cancel any time!
Product feature icon Unlimited ad-free access to the largest independent learning library in tech. Access this title and thousands more!
Product feature icon 50+ new titles added per month, including many first-to-market concepts and exclusive early access to books as they are being written.
Product feature icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Product feature icon Thousands of reference materials covering every tech concept you need to stay up to date.
Subscribe now
View plans & pricing

Product Details

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

Packt Subscriptions

See our plans and pricing
Modal Close icon
£9.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
£99.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
£139.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 £ 118.97
C# 12 and .NET 8 – Modern Cross-Platform Development Fundamentals
£44.99
Refactoring with C#
£35.99
Clean Code with C#
£37.99
Total £ 118.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

What is included in a Packt subscription? Chevron down icon Chevron up icon

A subscription provides you with full access to view all Packt and licnesed content online, this includes exclusive access to Early Access titles. Depending on the tier chosen you can also earn credits and discounts to use for owning content

How can I cancel my subscription? Chevron down icon Chevron up icon

To cancel your subscription with us simply go to the account page - found in the top right of the page or at https://subscription.packtpub.com/my-account/subscription - From here you will see the ‘cancel subscription’ button in the grey box with your subscription information in.

What are credits? Chevron down icon Chevron up icon

Credits can be earned from reading 40 section of any title within the payment cycle - a month starting from the day of subscription payment. You also earn a Credit every month if you subscribe to our annual or 18 month plans. Credits can be used to buy books DRM free, the same way that you would pay for a book. Your credits can be found in the subscription homepage - subscription.packtpub.com - clicking on ‘the my’ library dropdown and selecting ‘credits’.

What happens if an Early Access Course is cancelled? Chevron down icon Chevron up icon

Projects are rarely cancelled, but sometimes it's unavoidable. If an Early Access course is cancelled or excessively delayed, you can exchange your purchase for another course. For further details, please contact us here.

Where can I send feedback about an Early Access title? Chevron down icon Chevron up icon

If you have any feedback about the product you're reading, or Early Access in general, then please fill out a contact form here and we'll make sure the feedback gets to the right team. 

Can I download the code files for Early Access titles? Chevron down icon Chevron up icon

We try to ensure that all books in Early Access have code available to use, download, and fork on GitHub. This helps us be more agile in the development of the book, and helps keep the often changing code base of new versions and new technologies as up to date as possible. Unfortunately, however, there will be rare cases when it is not possible for us to have downloadable code samples available until publication.

When we publish the book, the code files will also be available to download from the Packt website.

How accurate is the publication date? Chevron down icon Chevron up icon

The publication date is as accurate as we can be at any point in the project. Unfortunately, delays can happen. Often those delays are out of our control, such as changes to the technology code base or delays in the tech release. We do our best to give you an accurate estimate of the publication date at any given time, and as more chapters are delivered, the more accurate the delivery date will become.

How will I know when new chapters are ready? Chevron down icon Chevron up icon

We'll let you know every time there has been an update to a course that you've bought in Early Access. You'll get an email to let you know there has been a new chapter, or a change to a previous chapter. The new chapters are automatically added to your account, so you can also check back there any time you're ready and download or read them online.

I am a Packt subscriber, do I get Early Access? Chevron down icon Chevron up icon

Yes, all Early Access content is fully available through your subscription. You will need to have a paid for or active trial subscription in order to access all titles.

How is Early Access delivered? Chevron down icon Chevron up icon

Early Access is currently only available as a PDF or through our online reader. As we make changes or add new chapters, the files in your Packt account will be updated so you can download them again or view them online immediately.

How do I buy Early Access content? Chevron down icon Chevron up icon

Early Access is a way of us getting our content to you quicker, but the method of buying the Early Access course is still the same. Just find the course you want to buy, go through the check-out steps, and you’ll get a confirmation email from us with information and a link to the relevant Early Access courses.

What is Early Access? Chevron down icon Chevron up icon

Keeping up to date with the latest technology is difficult; new versions, new frameworks, new techniques. This feature gives you a head-start to our content, as it's being created. With Early Access you'll receive each chapter as it's written, and get regular updates throughout the product's development, as well as the final course as soon as it's ready.We created Early Access as a means of giving you the information you need, as soon as it's available. As we go through the process of developing a course, 99% of it can be ready but we can't publish until that last 1% falls in to place. Early Access helps to unlock the potential of our content early, to help you start your learning when you need it most. You not only get access to every chapter as it's delivered, edited, and updated, but you'll also get the finalized, DRM-free product to download in any format you want when it's published. As a member of Packt, you'll also be eligible for our exclusive offers, including a free course every day, and discounts on new and popular titles.