Click here to Skip to main content
15,914,608 members

Survey Results

Do you use Attributes in your .NET development?   [Edit]

Survey period: 17 Oct 2011 to 24 Oct 2011

Attributes provide a neat way to hide the plumbing. Do you use and/or create attributes yourself?

OptionVotes% 
Extensively626.31
Often17017.31
Occasionally27928.41
Rarely19419.76
Never787.94
I am unfamiliar with Attributes in .NET19920.26



 
GeneralRe: what?? Pin
Keith Barrow18-Oct-11 0:35
professionalKeith Barrow18-Oct-11 0:35 
GeneralRe: what?? Pin
Fabio Franco21-Oct-11 2:23
professionalFabio Franco21-Oct-11 2:23 
GeneralLocalization Pin
Gary Wheeler17-Oct-11 8:42
Gary Wheeler17-Oct-11 8:42 
GeneralRe: Localization Pin
CDP180217-Oct-11 11:35
CDP180217-Oct-11 11:35 
GeneralRe: Localization Pin
Gary Wheeler17-Oct-11 23:46
Gary Wheeler17-Oct-11 23:46 
GeneralA lot more now I'm using MVC3 Pin
Keith Barrow17-Oct-11 7:16
professionalKeith Barrow17-Oct-11 7:16 
QuestionCustom or built in? Pin
dan!sh 17-Oct-11 4:40
professional dan!sh 17-Oct-11 4:40 
GeneralAttributes are evil PinPopular
Marc Clifton17-Oct-11 3:03
mvaMarc Clifton17-Oct-11 3:03 
There are only three reasons I use attributes:

1. XML Serialization
2. Designer info used by the property grid
3. Metadata describing how my plugins intercept SQL transactions

The third isn't necessary and may eventually be replaced with a standard plugin API call to discover the desired behavior rather than using reflection.

I used to think that attributes were the cat's meow. After using them extensively, I discovered that they are just another layer of obfuscation that complicates the maintenance of the code. I realized that a much better implementation would have been to keep the the imperative code separate from the metadata declarative portions. As it stands, the source code combines both. What I think would be better is a separate, purely declarative, repository as a map of the imperative code and the desired attributes. This would have allowed the attributes to vary independently from the code. Consider changing a serialization attribute, like the XML attribute name, or a description of a property to assist the form designer. Good grief, I have to touch the code base to do that? Absurd, in my opinion.

So that's what I've learned over the years, is that the code and the attributes should actually have been kept physically separate.

Marc

GeneralRe: Attributes are evil Pin
CDP180217-Oct-11 3:39
CDP180217-Oct-11 3:39 
GeneralRe: Attributes are evil Pin
#realJSOP17-Oct-11 4:54
professional#realJSOP17-Oct-11 4:54 
GeneralRe: Attributes are evil Pin
Eddy Vluggen17-Oct-11 6:58
professionalEddy Vluggen17-Oct-11 6:58 
GeneralRe: Attributes are evil Pin
User 482203317-Oct-11 9:38
User 482203317-Oct-11 9:38 
GeneralRe: Attributes are evil Pin
#realJSOP17-Oct-11 10:13
professional#realJSOP17-Oct-11 10:13 
GeneralRe: Attributes are evil Pin
Paul Coldrey17-Oct-11 15:15
professionalPaul Coldrey17-Oct-11 15:15 
GeneralRe: Attributes are evil Pin
CDP180217-Oct-11 20:07
CDP180217-Oct-11 20:07 
GeneralRe: Attributes are evil Pin
#realJSOP18-Oct-11 2:26
professional#realJSOP18-Oct-11 2:26 
GeneralRe: Attributes are evil Pin
User 482203318-Oct-11 2:30
User 482203318-Oct-11 2:30 
GeneralRe: Attributes are evil Pin
myker18-Oct-11 7:41
myker18-Oct-11 7:41 
GeneralRe: Attributes are evil Pin
Fabio Franco21-Oct-11 2:20
professionalFabio Franco21-Oct-11 2:20 
GeneralRe: Attributes are evil Pin
Fabio Franco21-Oct-11 6:00
professionalFabio Franco21-Oct-11 6:00 
GeneralRe: Attributes are evil Pin
Stonkie17-Oct-11 12:00
Stonkie17-Oct-11 12:00 
GeneralRe: Attributes are evil Pin
Marc Clifton17-Oct-11 14:43
mvaMarc Clifton17-Oct-11 14:43 
GeneralRe: Attributes are evil Pin
Fabio Franco21-Oct-11 2:18
professionalFabio Franco21-Oct-11 2:18 
GeneralRe: Attributes are evil Pin
hairy_hats21-Oct-11 3:21
hairy_hats21-Oct-11 3:21 
GeneralWho have useful questions for the CP weekly poll? Pin
AlexCode17-Oct-11 2:45
professionalAlexCode17-Oct-11 2:45 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.