© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•2y ago•
7 replies
TheBrambleShark

Attribute Style Preference

Not sure if #help is the right place for this but I was hoping for some thoughts on attribute style.
// Style 1
[Foo]
[Bar]
public void Bizz(Buzz buzz) { }

// Style 2
[Foo, Bar]
public void Bizz(Buzz buzz) { }
// Style 1
[Foo]
[Bar]
public void Bizz(Buzz buzz) { }

// Style 2
[Foo, Bar]
public void Bizz(Buzz buzz) { }

It goes without saying that functionally, the two styles make absolutely no difference. They are handled identically by the compiler.
I have noticed however that decompiled C#, such as when looking at lowered code in SharpLab, tends to prefer style 1. I think that's mostly because it's easier to render it as C# that way, not because of any functional reason.

Which style do you guys prefer, and what is your reasoning? Does it depend, e.g. based on the length of the attribute name or the number of attributes? Do you mix and match styles?
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

❔ File naming convention preference
C#CC# / help
3y ago
❔ DEBUGGER ATTRIBUTE .NET
C#CC# / help
3y ago
❔ Wrapping Conditional Attribute
C#CC# / help
3y ago
❔ CSharp [] attribute help
C#CC# / help
4y ago