I’ve heard various programmers suggest not including the word “private” in declarations, method signatures, etc. as private is the default scope when not specified. It can make for cleaner code but I’m interested in what the opinions are on whether you use the “private” scope on your variables, methods, etc. Tools like CodeRush that generate code for you include the word “private” so I’m curious if this is good or bad or just a matter of personal preference.
I’ve heard various programmers suggest not including the word private in declarations, method signatures,
Share
Cleaner code is more explicit as to the designer’s intentions. Using
privatedemonstrates a deliberate choice, not open to debate. Falling to the default opens up the questions: was this on purpose, or he simply forgot to include a modifier?