View previous topic :: View next topic |
Author |
Message |
JJR
Joined: 22 Feb 2004 Posts: 1104
|
Posted: Sun Apr 18, 2004 2:04 am Post subject: Prefixing Interface Definitions |
|
|
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 )
Agree or no? |
|
Back to top |
|
|
brad Site Admin
Joined: 22 Feb 2004 Posts: 490 Location: Atlanta, GA USA
|
Posted: Sun Apr 18, 2004 9:47 am Post subject: |
|
|
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 |
|
|
kris
Joined: 27 Mar 2004 Posts: 1494 Location: South Pacific
|
Posted: Sun Apr 18, 2004 12:55 pm Post subject: |
|
|
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 |
|
|
csauls
Joined: 27 Mar 2004 Posts: 278
|
Posted: Tue Apr 20, 2004 10:08 pm Post subject: |
|
|
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 |
|
|
|