a question about reef naming conventions

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

a question about reef naming conventions

EstebanLM
Hi,
I'm having some doubts about how to call some methods for Reef. To be
precise, I'm not sure about the naming og the method extensions I'm
adding.
For instance, I have an extension for Object, the method #asView, and
some others in BlockClosure, #asCallback, asCallbackOn:, etc.

So... I want to ask which naming convention is better.

1) Just let the methods like now?
2) adding a prefix, like reView, reCallback, etc.?
3) adding a full name prefix, asReefView, asReefCallback, etc.?

What do you think?

Cheers,
Esteban



Reply | Threaded
Open this post in threaded view
|

Re: a question about reef naming conventions

Diogenes Moreira
I think the third option is clearer than the others.

Best Regards

On Wed, Nov 3, 2010 at 7:52 PM, Esteban Lorenzano <[hidden email]> wrote:
Hi,
I'm having some doubts about how to call some methods for Reef. To be precise, I'm not sure about the naming og the method extensions I'm adding.
For instance, I have an extension for Object, the method #asView, and some others in BlockClosure, #asCallback, asCallbackOn:, etc.

So... I want to ask which naming convention is better.

1) Just let the methods like now?
2) adding a prefix, like reView, reCallback, etc.?
3) adding a full name prefix, asReefView, asReefCallback, etc.?

What do you think?

Cheers,
Esteban




Reply | Threaded
Open this post in threaded view
|

Re: a question about reef naming conventions

YossiDM
In reply to this post by EstebanLM
I am also for the third option. I will qualify that though by saying that I think it makes sense if your extension methods are only useful for Reef. If they are more general purpose and useful outside of Reef, perhaps another prefix and separate accordingly in your packages.

I think the first is confusing in the context of viewing the code in OB. I don't like the second as I think prefixes are evil and there's no reason these days to not be expressive, especially with tools to save typing like OCompletion. Always go for clarity in my opinion.

Anyway, thanks for the good work on Reef.
Reply | Threaded
Open this post in threaded view
|

Re: a question about reef naming conventions

Peter van Rooijen
In reply to this post by Diogenes Moreira
On Thu, 04 Nov 2010 00:01:24 +0100, Diogenes Moreira <[hidden email]> wrote:

I think the third option is clearer than the others.

I agree, but I'd use a "real" prefix, exactly the same characters at the beginning, every time.


So that would become: reefAsView, reefAsCallback.


In my own code, I prefix selectors sometimes and always as real prefixes.

But I would use an abbreviation for the project/"namespace" prefix

instead of something that could be a word, so that the prefix stands out more.


So that might become: rfAsView, rfAsCallback.


Cheers,

Peter


Best Regards

On Wed, Nov 3, 2010 at 7:52 PM, Esteban Lorenzano <[hidden email]> wrote:
Hi,
I'm having some doubts about how to call some methods for Reef. To be precise, I'm not sure about the naming og the method extensions I'm adding.
For instance, I have an extension for Object, the method #asView, and some others in BlockClosure, #asCallback, asCallbackOn:, etc.

So... I want to ask which naming convention is better.

1) Just let the methods like now?
2) adding a prefix, like reView, reCallback, etc.?
3) adding a full name prefix, asReefView, asReefCallback, etc.?

What do you think?

Cheers,
Esteban







--
Peter van Rooijen
Nijlring 83
5152 VJ Drunen
m: 06-2854 2048
Reply | Threaded
Open this post in threaded view
|

Re: a question about reef naming conventions

Stéphane Ducasse
In reply to this post by EstebanLM
how it is right now :)?


On Nov 3, 2010, at 11:52 PM, Esteban Lorenzano wrote:

> Hi,
> I'm having some doubts about how to call some methods for Reef. To be precise, I'm not sure about the naming og the method extensions I'm adding.
> For instance, I have an extension for Object, the method #asView, and some others in BlockClosure, #asCallback, asCallbackOn:, etc.
>
> So... I want to ask which naming convention is better.
>
> 1) Just let the methods like now?
> 2) adding a prefix, like reView, reCallback, etc.?

> 3) adding a full name prefix, asReefView, asReefCallback, etc.?
>


for me asReefView is not the same as reefView

so between reView and reefView I prefer reefView


> What do you think?
>
> Cheers,
> Esteban
>
>
>