Click here to Skip to main content
15,898,222 members
Home / Discussions / C#
   

C#

 
GeneralRe: C# coding style question Pin
MarkRHolbrook6-Sep-13 4:40
MarkRHolbrook6-Sep-13 4:40 
GeneralRe: C# coding style question Pin
Gary Wheeler6-Sep-13 4:53
Gary Wheeler6-Sep-13 4:53 
GeneralRe: C# coding style question Pin
BillWoodruff6-Sep-13 6:02
professionalBillWoodruff6-Sep-13 6:02 
GeneralRe: C# coding style question Pin
MarkRHolbrook6-Sep-13 6:09
MarkRHolbrook6-Sep-13 6:09 
GeneralRe: C# coding style question Pin
BillWoodruff6-Sep-13 5:51
professionalBillWoodruff6-Sep-13 5:51 
GeneralRe: C# coding style question Pin
Nicholas Marty5-Sep-13 3:26
professionalNicholas Marty5-Sep-13 3:26 
GeneralRe: C# coding style question Pin
BillWoodruff5-Sep-13 18:32
professionalBillWoodruff5-Sep-13 18:32 
GeneralRe: C# coding style question Pin
Nicholas Marty5-Sep-13 20:54
professionalNicholas Marty5-Sep-13 20:54 
Hm... Very interesting Bill Thumbs Up | :thumbsup:
Had to test it myself too now Smile | :)

It looks like the default access modifier is only internal for classes and structs, while it is private for class members (Variables, Methods, etc.). So I was wrong in the first place Blush | :O (considering the topic/examples were about variables). Looks like a lack of consistency to me. A reason more for me to dislike those defaults Wink | ;) I've never noticed that as I always write the access modifier to be clear of my intentions.

As far as I can see, the default value should be sufficient in most cases to be able to use your class without any explicit modifiers. private makes usually no sense for a class (as you won't be able to use it anywhere except the top level class "possessing this class) and internalallows enough for usage in you application. if you want to expose it more you can still change it to public. A default of private for class members also seems reasonable given that you usually want fields to private (and probably a bunch of class methods too).

BillWoodruff wrote:
The default behavior in ReSharper 8, with these options enabled, is to prepend the 'private access-modifier for a static variable, after you type it.

You should also be able to change the order of the modifiers on the following line Smile | :)
GeneralRe: C# coding style question Pin
BillWoodruff6-Sep-13 4:35
professionalBillWoodruff6-Sep-13 4:35 
GeneralRe: C# coding style question Pin
Nicholas Marty6-Sep-13 5:15
professionalNicholas Marty6-Sep-13 5:15 
GeneralRe: C# coding style question Pin
PIEBALDconsult5-Sep-13 3:39
mvePIEBALDconsult5-Sep-13 3:39 
AnswerRe: C# coding style question Pin
Rakesh Meel4-Sep-13 20:48
professionalRakesh Meel4-Sep-13 20:48 
AnswerRe: C# coding style question Pin
Ricardo Kajihara4-Sep-13 21:33
Ricardo Kajihara4-Sep-13 21:33 
AnswerRe: C# coding style question Pin
Christopher Kenis5-Sep-13 1:04
professionalChristopher Kenis5-Sep-13 1:04 
AnswerRe: C# coding style question Pin
Eytukan5-Sep-13 7:21
Eytukan5-Sep-13 7:21 
GeneralRe: C# coding style question Pin
BillWoodruff5-Sep-13 18:35
professionalBillWoodruff5-Sep-13 18:35 
GeneralRe: C# coding style question Pin
Eytukan5-Sep-13 19:02
Eytukan5-Sep-13 19:02 
AnswerRe: C# coding style question Pin
V.6-Sep-13 1:48
professionalV.6-Sep-13 1:48 
QuestionThread Progress Bar Pin
juliogyn4-Sep-13 8:31
juliogyn4-Sep-13 8:31 
AnswerRe: Thread Progress Bar Pin
Forbiddenx4-Sep-13 9:01
Forbiddenx4-Sep-13 9:01 
GeneralRe: Thread Progress Bar Pin
BillWoodruff4-Sep-13 17:23
professionalBillWoodruff4-Sep-13 17:23 
GeneralRe: Thread Progress Bar Pin
Forbiddenx6-Sep-13 1:16
Forbiddenx6-Sep-13 1:16 
AnswerRe: Thread Progress Bar Pin
Dave Kreskowiak4-Sep-13 9:03
mveDave Kreskowiak4-Sep-13 9:03 
AnswerRe: Thread Progress Bar Pin
V.6-Sep-13 1:51
professionalV.6-Sep-13 1:51 
QuestionAny Ideas or feedback for a C# final year programming project? Pin
johnmolo4-Sep-13 4:11
johnmolo4-Sep-13 4:11 

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.