Interface Naming Conventions

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Interface Naming Conventions

hans_d
Administrator
Hi,

I'm wondering what convention we should use for naming interfaces.  
Right now my approach is to use an 'I' prefix for interfaces of the  
internal API and no prefix for public interfaces like Project. I'm  
wondering if we should skip the I-prefix altogether.

- Hans

--
Hans Dockter
Gradle Project lead
http://www.gradle.org





---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|

Re: Interface Naming Conventions

Russel Winder-2
Hans,

On Thu, 2008-09-11 at 08:25 +0200, Hans Dockter wrote:
> Hi,
>
> I'm wondering what convention we should use for naming interfaces.  
> Right now my approach is to use an 'I' prefix for interfaces of the  
> internal API and no prefix for public interfaces like Project. I'm  
> wondering if we should skip the I-prefix altogether.
>
> - Hans

I have to admit I have never really seen the efficacy of Hungarian
Notation which this prefixing of interface names with I is an echo of.
I think it is fashionable to do this in C# but that doesn't make it
useful.

I guess it depends on whether splitting interface and class is important
or whether type is the important thing.

Perhaps hypocritically, I do like separating type names and variable and
function names, so I like the Java convention of capitals for types and
lowercase for variables and methods.  I use this in C++ and Python where
it is more conventionally not to distinguish -- but then I prefer Camel
Case convention to large numbers of _ to separate words in a name.

Summary:  My view is drop the Is.
--
Russel.
====================================================
Dr Russel Winder                 Partner

Concertant LLP                   t: +44 20 7585 2200, +44 20 7193 9203
41 Buckmaster Road,              f: +44 8700 516 084
London SW11 1EN, UK.             m: +44 7770 465 077

signature.asc (196 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Interface Naming Conventions

Adam Murdoch-2
In reply to this post by hans_d


Hans Dockter wrote:
> Hi,
>
> I'm wondering what convention we should use for naming interfaces.
> Right now my approach is to use an 'I' prefix for interfaces of the
> internal API and no prefix for public interfaces like Project. I'm
> wondering if we should skip the I-prefix altogether.
>

+1


Adam

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|

Re: Interface Naming Conventions

Stefan Groschupf
In reply to this post by Russel Winder-2
I like the I prefix, it makes things very easy.
However I learned that native english speakers identify interfaces on  
the name.
Useally interface ends of ''able". For example Writ'able' or  
Serializ'able'.
Stefan


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
101tec Inc., Menlo Park, California
web:  http://www.101tec.com
blog: http://www.find23.net



On Sep 11, 2008, at 12:44 AM, Russel Winder wrote:

> Hans,
>
> On Thu, 2008-09-11 at 08:25 +0200, Hans Dockter wrote:
>> Hi,
>>
>> I'm wondering what convention we should use for naming interfaces.
>> Right now my approach is to use an 'I' prefix for interfaces of the
>> internal API and no prefix for public interfaces like Project. I'm
>> wondering if we should skip the I-prefix altogether.
>>
>> - Hans
>
> I have to admit I have never really seen the efficacy of Hungarian
> Notation which this prefixing of interface names with I is an echo of.
> I think it is fashionable to do this in C# but that doesn't make it
> useful.
>
> I guess it depends on whether splitting interface and class is  
> important
> or whether type is the important thing.
>
> Perhaps hypocritically, I do like separating type names and variable  
> and
> function names, so I like the Java convention of capitals for types  
> and
> lowercase for variables and methods.  I use this in C++ and Python  
> where
> it is more conventionally not to distinguish -- but then I prefer  
> Camel
> Case convention to large numbers of _ to separate words in a name.
>
> Summary:  My view is drop the Is.
> --
> Russel.
> ====================================================
> Dr Russel Winder                 Partner
>
> Concertant LLP                   t: +44 20 7585 2200, +44 20 7193 9203
> 41 Buckmaster Road,              f: +44 8700 516 084
> London SW11 1EN, UK.             m: +44 7770 465 077


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email