Reputation:
MSDN - spaces after the colon. That's different than Objective-C, where I don't see people using a space after the colon. I'm thinking it might be an issue where syntax highlighting hasn't caught up to the feature yet, but I have no experience in a good IDE. MonoDevelop, which I use on the Mac with Unity, neither provides syntax coloring nor autocomplete for named parameters. There is a lot there; if you know what I'm asking to exist within, or elsewhere, please let me know. I haven't found it yet.
Upvotes: 4
Views: 686
Reputation: 38
Style guides should emerge from the development team. Each language has its own idioms that should be followed but the details need to be defined by the team. The same applies to naming conventions.
Write them down, circulate and get everybody's agreement. If you're doing open source I'm sure the community will give you feedback.
Upvotes: 0
Reputation: 2942
Microsoft has some common sense guidelines published on MSDN, in my opinion its the uniformity that counts as much as the convention. If you are not already doing so its worth looking at Stylecop for code styling and standards.
From: Names of Parameters
Choosing good parameter names can significantly improve the usability of your library. A good parameter name should indicate what data or functionality is affected by the parameter.
Do use camel casing in parameter names. Do use descriptive parameter names.
In most scenarios, the name of the parameter and its type should be sufficient to determine the parameter's usage.
Consider using names based on a parameter's meaning rather than names based on the parameter's type.
In developer tools and documentation, the parameter's type is usually visible. By selecting a name that describes the usage or meaning of the parameter, you give developers valuable information that helps them identify the right member for their task and the right data to pass into the member.
Upvotes: 2
Reputation: 9922
Nobody forces you to use some specific style, if this is what you're asking about. You can write it without the spaces, or with the space after the colon, or with the space before the colon, or with the spaces surrounding the colon, as you wish.
However, IMHO, it is more readable when you only use a single space after the colon.
Upvotes: 1