[Mono-osx] Patches for NSColor

Regan Sarwas rsarwas at gmail.com
Sat Jan 1 15:57:12 EST 2011


Here is a patch for the renames in NSColor.

Happy New Year!

On Sat, Jan 1, 2011 at 6:40 AM, Miguel de Icaza <miguel at novell.com> wrote:

> Hello,
> Hello,
>
> There are currently 30 ObjC methods named "numberOfXxx" in appkit.cs, and 1
>> in coreimage.cs and there does not seem to be a standard for the C# name.  I
>> have seen
>>
>>   NumberOfXxx
>>   Xxx
>>   CountOfXxx
>>   XxxCount
>>   Count
>>
>
> Thanks for surveying the API.    It might be useful to keep track of these
> conventions, as I find myself not remembering what certain things should be.
>
>
> Leaving it NumberOfXxx, doesn't seem very C#ish, and Count is only
>> appropriate if the object is clearly a collection.  Dropping the NumberOf is
>> usually confusing, for example shortening the NSColor method
>> numberOfComponents to just Components is mis-leading because it does not
>> return the components (which is an array of floats).  Granted intellisense
>> helps, but I think a good standard name helps make the code more readable.
>>  So, what should it be?
>>
>
> Agreed.
>
>
>> My vote is Count or XxxCount, depending on the object.
>>
>
> XxxCount is my preference, as I remember clearly not using "Count" as I
> found the resulting code ambiguous sometimes.
>
> Miguel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-osx/attachments/20110101/eb5c378c/attachment.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: appkit.cs.NSColorRename.patch
Type: application/octet-stream
Size: 2930 bytes
Desc: not available
Url : http://lists.ximian.com/pipermail/mono-osx/attachments/20110101/eb5c378c/attachment.obj 


More information about the Mono-osx mailing list