-
Book Overview & Buying
-
Table Of Contents
Metaprogramming in C#
By :
Conventions, like those explained in this chapter with the discovery of well-known signatures, can be very powerful and help clean up your code. Forcing the developer to implement an interface for every class supported can be tedious and make the code look a little strange.
The downside of using a convention for method signatures is obviously that you are now at the mercy of runtime checks; there is no compiler that will help you. If you happen to make a little error, it won’t be noticed until you’re at runtime, which can be very annoying while in the zone and developing. In Chapter 17, Static Code Analysis, we will look at how we can detect errors at compile time.
In the next chapter, we’re going to look at how automation can go further with conventions to put developers in the pit of success and avoid a recipe-driven development.