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.
3 Answers
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.

- 2,932
- 2
- 22
- 18
-
I think I've already been following those guidelines, hence why I want to see the parameter names. I could supposedly use [this](http://answers.unity3d.com/questions/51110/is-there-an-alternative-to-stylecop-for-monodevelo.html), but I don't know how to use those files. – Feb 16 '12 at 05:58
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.

- 9,792
- 5
- 39
- 50
-
I've found that people tend to converge on either one, or a small number of options, despite vast possibilities in a whitespace-ignoring language. I never see a lack of space after "for" or "if", but I rarely see that space after method names. If it's going to stop people from having to put any thought whatsoever into parsing my code, I'll stick with the most common conventions, and absorb them myself. Named parameters, as far as I can tell, are too new and underused for that many people to have put much thought into this. I'd like to start early, to avoid any potential rewriting later. – Feb 16 '12 at 05:07
-
_I never see a lack of space after "for" or "if"_ - but it is pretty common :) _I'd like to start early, to avoid any potential rewriting later_ - then use a single space after the colon. – penartur Feb 16 '12 at 05:10
-
Please point me to some examples of 1. the lack of that space, and 2. why you think your preferred method will become the standard. (The latter will answer the original question, of course.) – Feb 16 '12 at 05:52
-
2. Again, there is no such thing as _standart_, but pretty much everybody now use the said notation. 1. It is funny, but I can't find any popular project that uses this notation (personally I'm using it). – penartur Feb 16 '12 at 06:19
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.

- 38
- 5
-
-
I guess stackoverflow is a good soundboard for you then. IMO, I like spaces I reckon it makes it more readable and easier to spot when it's missing. – dbatwa Feb 16 '12 at 06:42
-
Why would it not be the standard in Objective-C, then? Named parameters have existed a lot longer there. – Feb 16 '12 at 16:06