Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Metaprogramming in C#

You're reading from   Metaprogramming in C# Automate your .NET development and simplify overcomplicated code

Arrow left icon
Product type Paperback
Published in Jun 2023
Publisher Packt
ISBN-13 9781837635429
Length 352 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Einar Ingerbrigsten Einar Ingerbrigsten
Author Profile Icon Einar Ingerbrigsten
Einar Ingerbrigsten
Arrow right icon
View More author details
Toc

Table of Contents (25) Chapters Close

Preface 1. Part 1:Why Metaprogramming?
2. Chapter 1: How Can Metaprogramming Benefit You? FREE CHAPTER 3. Chapter 2: Metaprogramming Concepts 4. Chapter 3: Demystifying through Existing Real-World Examples 5. Part 2:Leveraging the Runtime
6. Chapter 4: Reasoning about Types Using Reflection 7. Chapter 5: Leveraging Attributes 8. Chapter 6: Dynamic Proxy Generation 9. Chapter 7: Reasoning about Expressions 10. Chapter 8: Building and Executing Expressions 11. Chapter 9: Taking Advantage of the Dynamic Language Runtime 12. Part 3:Increasing Productivity, Consistency, and Quality
13. Chapter 10: Convention over Configuration 14. Chapter 11: Applying the Open-Closed Principle 15. Chapter 12: Go Beyond Inheritance 16. Chapter 13: Applying Cross-Cutting Concerns 17. Chapter 14: Aspect-Oriented Programming 18. Part 4:Compiler Magic Using Roslyn
19. Chapter 15: Roslyn Compiler Extensions 20. Chapter 16: Generating Code 21. Chapter 17: Static Code Analysis 22. Chapter 18: Caveats and Final Words 23. Index 24. Other Books You May Enjoy

Preface

“Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live.”

– Martin Golding

In the world of software, there are so many things that can go wrong and often do go wrong. We’re a relatively young industry that is in an ever-changing state. Things haven’t settled and innovation happens at lightning speed. It’s not like carpentry, which has had a few thousand years of experience of what works and what doesn’t. In software, we’re still inventing the tools and reinventing them as we go. The business benefit and the possibility to increase productivity for our end users sets the expectations high and in an increasingly competitive market, time to market is of the essence.

At the level we write our software today, we have a huge potential to leverage the metadata surrounding our own code to ensure the quality and maintainability of the software we write. This is where the metaprogramming journey starts.

Metaprogramming can be really fun to work with, but it represents true opportunities for developers and businesses to set themselves apart. Things that metaprogramming can do for you include the following:

  • Improve the maintainability of your code
  • Automate tedious tasks
  • Let developers focus more on your business and not the plumbing
  • Help you stay more compliant
  • Reduce risk related to security

There are technical reasons to dive into metaprogramming, as with any other technique, but I think there is true value to be discovered in leveraging it to help you and your team become more productive and, at the end of the day, deliver more business-critical features that are easier to change and maintain over the years.

lock icon The rest of the chapter is locked
Next Section arrow right
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €18.99/month. Cancel anytime