Attributes are great, please stop using them.
I've had a few situations recently where a library's attributes have coupled some code to that library (and often a version of that library)
[ThisIsTheThingThatIs] public void WhyWasntThisConfiguredInCodeSomewhereQuestionmark() { }
I don't want to call anyone out for this, but I'd like to ask that people think about alternatives to attributes. They might offer a shorthand now and attach intent to the code, but code will hold on long after the developer's fingers slip off the cliff edge.
It's all happiness until someone slips you a NuGet package which is annotated with attributes found in the specific version of the library they've chosen to you (which has breaking changes with the version you use, so you can't just forward)...
Anyone recognise this as a problem? Have I just been unlucky?
0 comments:
Post a Comment