Click here to Skip to main content
15,914,820 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: 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 
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 PinPopular
User 482203317-Oct-11 9:38
User 482203317-Oct-11 9:38 
It hurts my eyes to see such conservatism in developers. Do you seriously avoid DataAnnotations, WebServices, WCF Contracts, ASP.NET MVC post/get descriptors etc?

Attributes are great for many reasons:
1)They are declarative. They abstract the actual painful order of details, they just do what you tell them to do
2) They are where they should be. Decorating your method, property or whatever, not in some hidden config file you easily forget to update. You don't want them there for some important reason? There are workarounds (see entity framework and Metadata classes which add data annotations).
3) They combine well with OO programming (abstraction, data together with their behaviour etc etc)
4) You can do sexy things with them with reflection
5) Their most common uses are dead-simple to understand (a junior developer who cannot understand in 10 minutes what [Post] or [Required] can do in the appropriate context, just shouldn't be a developer).
6) In most cases they are the most brief way to express something
7) It's one of those features Java was so eager to copy, for a reason.
8) You cannot seriously compare attributes with lambdas in their complexity. (even though I love lambdas as well).
9) Of course they can be abused, but even "if" can be abused (I've seen horrible series of if statements that could have been replaced by a more maintenable and faster to execute switch).

modified 6-Apr-21 21:01pm.

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 
GeneralNope, I only use BACON Pin
OriginalGriff16-Oct-11 23:47
mveOriginalGriff16-Oct-11 23:47 
GeneralRe: Nope, I only use BACON Pin
Nagy Vilmos17-Oct-11 4:37
professionalNagy Vilmos17-Oct-11 4:37 
GeneralRe: Nope, I only use BACON Pin
OriginalGriff17-Oct-11 4:43
mveOriginalGriff17-Oct-11 4:43 
GeneralRe: Nope, I only use BACON Pin
Nagy Vilmos17-Oct-11 4:46
professionalNagy Vilmos17-Oct-11 4:46 

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.