FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Prefixing Interface Definitions

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.     Forum Index -> DWT
View previous topic :: View next topic  
Author Message
JJR



Joined: 22 Feb 2004
Posts: 1104

PostPosted: Sun Apr 18, 2004 2:04 am    Post subject: Prefixing Interface Definitions Reply with quote

SWT java source makes it obvious when a class is implementing an interface: it uses "implements" keyword.

D doesn't make it obvious that an interface is being implemented because classes implement interfaces by simply using the colon the same way as done in normal inheritance designation.

I propose that, in order to make D interface implementation obvious, we prefix all interface symbols with a 'I' as in...

public final class ImageData : ICloneableCompatibility { }

Seems standard in other places (like the dsc project Smile )

Agree or no?
Back to top
View user's profile Send private message
brad
Site Admin


Joined: 22 Feb 2004
Posts: 490
Location: Atlanta, GA USA

PostPosted: Sun Apr 18, 2004 9:47 am    Post subject: Reply with quote

I agree. And even though it's more clear in Java, putting the I in front is a very common practice for Java programmers. Hmmm. I wonder what Kris worked on before D?
_________________
I really like the vest!
Back to top
View user's profile Send private message
kris



Joined: 27 Mar 2004
Posts: 1494
Location: South Pacific

PostPosted: Sun Apr 18, 2004 12:55 pm    Post subject: Reply with quote

brad wrote:
I agree. And even though it's more clear in Java, putting the I in front is a very common practice for Java programmers. Hmmm. I wonder what Kris worked on before D?

Oh man ... busted.

I tend to prefix all interfaces in D for exactly the reason John states. Even though it has a vague whiff of, *gasp*, the unspeakable 'H' notation ...
Back to top
View user's profile Send private message
csauls



Joined: 27 Mar 2004
Posts: 278

PostPosted: Tue Apr 20, 2004 10:08 pm    Post subject: Reply with quote

Hungarian schmungarian... I've been using prefixes since before I ever even imagined touching the Windows API or any other hungarian lib... Sometimes its just useful. When I first learned C, I tended (for example) to prefix all enum-typed variables with an 'e'. IName for interfaces is just a good convention in my mind.
_________________
Chris Nicholson-Sauls
Back to top
View user's profile Send private message AIM Address Yahoo Messenger
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.     Forum Index -> DWT All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group