--
You received this message because you are subscribed to the Google Groups "software_craftsmanship" group.
To post to this group, send email to software_cr...@googlegroups.com.
To unsubscribe from this group, send email to software_craftsma...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/software_craftsmanship?hl=en.
Jason Gorman
www.codemanship.com
On Jan 9, 7:36 pm, Bobby Johnson <bobby.john...@gmail.com> wrote:
> That is an interesting comment. As a person who has done .NET dev for the
> better part of the last decade, I would say your Vehicle interface is more
> confusing in terms of code readability. I have no way of knowing just by
> looking at the usage of it if it is an interface, abstract base or an
> implementation. And I guess that is your point, it shouldn't matter to the
> consumer.
>
> For me I see the interface as defining a contract between collaborators
> explicitly and the "I" is a part of that explicitness. And it't the way
> everyone else does it... 8)
>
> On Sat, Jan 9, 2010 at 10:30 AM, Curtis Cooley <curtis.coo...@gmail.com>wrote:
>
>
>
>
>
> > This is more of a nitpick, and something I'd like to get others opinions
> > on, but I hate .NET's idiom of putting I in front of interfaces. It munges
> > up the domain model. I've always tried to name my interfaces more abstractly
> > then the classes that implement them. So if I have a Car and I want an
> > interface for it, I might choose Vehicle. In the .NET world you'd have Car
> > implement ICar and then down the road have Airplane implementing ICar.
>
> > I know this is the way .NET is done, but I feel names are very important to
> > code readability.
>
> > Plus I've always despised hungarian notation.
>
> >>http://en.wikipedia.org/wiki/Occam's_Razor<http://en.wikipedia.org/wiki/Occam%27s_Razor>
>
> >> --
> >> You received this message because you are subscribed to the Google Groups
> >> "software_craftsmanship" group.
> >> To post to this group, send email to
> >> software_cr...@googlegroups.com.
> >> To unsubscribe from this group, send email to
> >> software_craftsma...@googlegroups.com<software_craftsmanship%2Bunsu...@googlegroups.com>
> >> .
> >> For more options, visit this group at
> >>http://groups.google.com/group/software_craftsmanship?hl=en.
>
> > --
> > Curtis Cooley
> > home:http://curtiscooley.com
> > blog:http://ponderingobjectorienteddesign.blogspot.com
> > ===============
> > Leadership is a potent combination of strategy and character. But if you
> > must be without one, be without the strategy.
> > -- H. Norman Schwarzkopf
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "software_craftsmanship" group.
> > To post to this group, send email to
> > software_cr...@googlegroups.com.
> > To unsubscribe from this group, send email to
> > software_craftsma...@googlegroups.com<software_craftsmanship%2Bunsu...@googlegroups.com>
> > .
> > For more options, visit this group at
> >http://groups.google.com/group/software_craftsmanship?hl=en.
>
> --
> "The explanation requiring the fewest assumptions is most likely to be
> correct."
>
> - Occam’s Razorhttp://en.wikipedia.org/wiki/Occam's_Razor- Hide quoted text -
>
> - Show quoted text -
Personally, I spent a few years in using the I as the subject of the
verb phrase that the interface described. So, for example, what is the
role it describes?
I have a role for transporting people that a concrete class Bus.
ITransportPeople {
load(person)
unload(person)
}
class Bus : ITransportPeople {
}
Rarely did I have an interface that was a noun-phrase.
-Corey
> To unsubscribe from this group, send email to software_craftsma...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/software_craftsmanship?hl=en.
>
>
>
>
--
http://www.coreyhaines.com
The Internet's Premiere source of information about Corey Haines
But in my next project I'll do my very best to say no to my inner
drive for the I and try without it instead.
-Mark
> To unsubscribe from this group, send email to software_craftsma...@googlegroups.com.
> >> - Occam’s Razorhttp://en.wikipedia.org/wiki/Occam's_Razor-Hide quoted text -
>
> >> - Show quoted text -
>
> > --
> > You received this message because you are subscribed to the Google Groups "software_craftsmanship" group.
> > To post to this group, send email to software_cr...@googlegroups.com.
> > To unsubscribe from this group, send email to software_craftsma...@googlegroups.com.
> > For more options, visit this group athttp://groups.google.com/group/software_craftsmanship?hl=en.- Hide quoted text -
> Personally, I spent a few years in using the I as the subject of the
> verb phrase that the interface described. So, for example, what is the
> role it describes?
> I have a role for transporting people that a concrete class Bus.
> ITransportPeople {
> load(person)
> unload(person)
> }
> class Bus : ITransportPeople {
> }
> Rarely did I have an interface that was a noun-phrase.
That's cool. I wish that had caught on.
Ron Jeffries
www.XProgramming.com
www.xprogramming.com/blog
We cannot solve our problems with the same thinking we used when we created them.
-- Albert Einstein
Yeah. You were at SDTConf in 2006 when the ideas and experiments I had done crystallized. .
On Jan 9, 2010 4:18 PM, "Ron Jeffries" <ronje...@acm.org> wrote:
Hello, Corey. On Saturday, January 9, 2010, at 3:22:02 PM, you
wrote:
> Personally, I spent a few years in using the I as the subject of the > verb phrase that the inter...
That's cool. I wish that had caught on.
Ron Jeffries
www.XProgramming.com
www.xprogramming.com/blog
We cannot solve our problems with the same thinking we used when we created them.
-- Albert Einstein
To unsubscribe from this group, send email to software_craftsma...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/software_craftsmanship?hl=en.
> > > - Occam’s Razorhttp://en.wikipedia.org/wiki/Occam's_Razor-<http://en.wikipedia.org/wiki/Occam%27s_Razor->Hide quoted text -
-Mark
> To unsubscribe from this group, send email to software_craftsma...@googlegroups.com.
> >> - Occam’s Razorhttp://en.wikipedia.org/wiki/Occam's_Razor-Hide quoted text -
>
> >> - Show quoted text -
>
> > --
> > You received this message because you are subscribed to the Google Groups "software_craftsmanship" group.
> > To post to this group, send email to software_cr...@googlegroups.com.
> > To unsubscribe from this group, send email to software_craftsma...@googlegroups.com.
> > For more options, visit this group athttp://groups.google.com/group/software_craftsmanship?hl=en.- Hide quoted text -
The reason I want to see the I indicator is that if I don't see it, I probably need to view the definition code file to determine if I am looking at an interface or a class. IMO, that is just wasted keystrokes and time that my brain doesn't need to spend.
-Mark
Once upon a time there was a cage full of gorillas. As an experiment,
a bunch of bananas were hung from the top of the cage. Whenever a
gorilla tried to reach a banana, the whole group was sprayed with cold
water. Once the group was conditioned to not try to get a banana, one
gorilla was replaced. Whenever the new gorilla tried to get a banana,
the others pulled him down. When he was conditioned to not to try to
get a banana, another of the original gorillas was replaced. This was
repeated until all of the original gorillas were replaced. None of the
existing gorillas had ever been sprayed by water, yet none of them
would try to get a banana. Why? Because that's the way it had always
been done.
--
Curtis Cooley
curtis...@gmail.com
Interface to me means behavior, but perhaps not all that the
implementation has to offer. But I agree I would find it much more
interesting to see that an actual concrete class is injected, because
then I would wonder why. This happens less often in my code. So
perhaps I need CXxxx ;)
Also I am not against not using the I when dealing with an interface,
I personally find it useful. But as I said in my next project I will
drop the I and see how that feels, I just hope my fellow team mates
don't get a bucket load of cold water thrown at them when I do.
With respect to the gorrilas, by behaving the way they do they didn't
get wet, but the reason why the second generation did it was because
the where trained to do so, now if they would be able to communicate
the reason behind their behavior then I am sure they would try that
first before pulling the new gorrila down. Most humans I know would
try that approach.
Also interesting is that animals that have never been into contact
with humans (whole generations) do not fear them, only those
generations that have learned (by experience) how evil we are to them
fear us.
When I trained my horses or dogs then consistency is key, so certain
behavior results in good while other behavior results in bad outcomes.
Also it is easier to train an animal when side by side with an already
trained animal.
-Mark
Sent from my iPhone
On 11. jan. 2010, at 02.35, Curtis Cooley <curtis...@gmail.com>
wrote:
Perhaps some examples:
When I see (I'm a Java guy so please pardon the syntax):
public class Car implements CanDrive
I know it's an interface.
When I see:
public class Foo {
CanDrive vehicle;
...
}
I don't care if CanDrive is an interface or class. Should I? If so, why?
Another argument I've heard is that in Eclipse, if you type in
ctr-shift-t (which brings up the type browser) then type I you get a
list of all the interfaces, but I've never actually opened Eclipse and
thought, gee, I wonder what all the interfaces are?
Please, this is not targeted at Mark, since he's admitted to not
seeing value in the I interface idiom, but if there is value, I would
like to know. Otherwise I just consider it another form of outdated
Hungarian notation at best and poor design at worst. To be completely
honest, and I hope I don't offend, but when I see interfaces beginning
with I, the first one I think of is IDontKnowOO
And here I thought I would get some impassioned heat for my use of
extension methods with some good comentary.
Sent from my iPhone
On Jan 10, 2010, at 7:38 PM, Curtis Cooley <curtis...@gmail.com>
wrote:
When I'm trying to understand, for example, how to use a large Java
library, any clues I can get from reading existing code are useful. I
don't find the "I" intrusive, but I have some sympathy with the idea
that it might be better to prefix the class names rather than the
interface names. Still, that isn't going to change now.
One other thing: When designing for testability there's sometimes a
need to put an interface in front of every class (although this need
has reduced as test frameworks have matured). In such a world it's
painful to have to invent a new name for the interface. But perhaps
this pragmatism should have no place in our thinking.
--John
(In the interests of full disclosure, I should point out that I played
a small part, via a book I wrote some years ago, in propagating the
use of the I prefix outside the .net community. I don't feel any
regret :-). On the other hand, I don't feel that strongly about it
either, and I haven't used the convention on any projects recently.)
====
Original message
From: Curtis Cooley <curtis...@gmail.com>
Date: 11 January 2010
Time: 3:38:41 AM
Subject: [SC] Re: Code Review: Active Directory Abstraction
----
Jason Gorman
http://www.codemanship.com
On Jan 11, 5:39 am, Bobby Johnson <bobby.john...@gmail.com> wrote:
> I assume you find ruby developer incompetent for using boxcar casing
> as well? Seriously, judging a developer on the use of a well known
> idiom in a given language calls your credibility into question.
>
> And here I thought I would get some impassioned heat for my use of
> extension methods with some good comentary.
>
> Sent from my iPhone
>
> On Jan 10, 2010, at 7:38 PM, Curtis Cooley <curtis.coo...@gmail.com>
> > On Sun, Jan 10, 2010 at 6:21 PM, Mark Nijhof <mark.nij...@gmail.com>
> >> On 11. jan. 2010, at 02.35, Curtis Cooley <curtis.coo...@gmail.com>
> >> wrote:
>
> >>> On Sun, Jan 10, 2010 at 4:05 PM, Mark Nijhof <mark.nij...@gmail.com>
> >>> curtis.coo...@gmail.com
> > home:http://curtiscooley.com
> > blog:http://ponderingobjectorienteddesign.blogspot.com
> > ===============
> > Leadership is a potent combination of strategy and character. But if
> > you must be without one, be without the strategy.
> > -- H. Norman Schwarzkopf
> > --
> > You received this message because you are subscribed to the Google
> > Groups "software_craftsmanship" group.
> > To post to this group, send email to software_cr...@googlegroups.com
> > .
> > To unsubscribe from this group, send email to software_craftsma...@googlegroups.com
> > .
> > For more options, visit this group athttp://groups.google.com/group/software_craftsmanship?hl=en
> > .- Hide quoted text -
public class Car : CanDrive
There's no distinction here between classes and interfaces and no way
without navigating to theCanDrive definition to know. For me, I find
that the 'I' prefix does not get in the way but does aid readability,
particularly when it's not my code I'm reading, or if I'm reading
outside of an IDE.
Even in usage, I find it useful to know the difference. If it's an
interface then I know that the implementation can be swapped easily
(for example, during testing). If it's a class, then I need to read
much further before understanding what flexibilty I have with respect
to the actual runtime type.
This is one of those where I don't think there is a "correct" answer;
it's up to the team, the language etc to settle on one and then be
consistent in usage. I certainly don't think that using "I" implies
poor OO skills, just a different perspective on what matters to that
team.
In terms of ubiquitous language, I probably would use "I" or indeed
"interface" at all - I'd much rather refer to a "CanDrive contract".
Just my 2p
Steve
Sent from my iPhone
However, now I find myself driven to partake, here are my two pence
worth:
There is a (weak IMO) argument that annotating type names is helpful
to overcome IDE limitations.
There is a (slightly stronger) namespace argument that -- in a spring
or TDD or TOD world where everything comes out of interfaces -- you
need to give different names to interfaces and their basic or default
implementations (although I prefer a clean interface name and a dirty
implementation name).
Otherwise I think the point is moot.
> I assume you find ruby developer incompetent for using boxcar casing
> as well? Seriously, judging a developer on the use of a well known
> idiom in a given language calls your credibility into question.
I don't see any judging going on, and certainly not anything about
boxcar casing.
I see Curtis saying that
public class Foo implements Anything
tells us Anything is an interface, and that the IAnything convention
is not necessary there. He goes on to say that when we see
public class Bar {
...
Anything thing;
...
}
he doesn't see any need to know whether Anything is an interface or
not, and asks why one does need to know.
I'm not seeing any thing about judging people in that.
> And here I thought I would get some impassioned heat for my use of
> extension methods with some good comentary.
I think you're getting both passion and commentary. I wonder why you
don't think so.
Ron Jeffries
www.XProgramming.com
www.xprogramming.com/blog
It's easier to act your way into a new way of thinking
than to think your way into a new way of acting. --Millard Fuller
> I am quite shocked that this is being debated by people who wish to
> become craftspeople in software. It really doesn't seem important to
> me.
One possibility is that some things that don't seem important to you
actually are important.
Ron Jeffries
www.XProgramming.com
www.xprogramming.com/blog
Think! -- Aretha Franklin
Cheers, Ilja
2010/1/11 James E Taylor <james.e...@gmail.com>:
> I'd humbly suggest that if it's not that important to you, you simply
> stop sweating, and at the same time kindly accept that those of us who
> feel that it's important - or perhaps even just interesting - enough,
> would like to sweat some more.
Thank you for putting that so much more nicely than I would have!
Ron Jeffries
www.XProgramming.com
www.xprogramming.com/blog
I must create a system, or be enslaved by another man's;
I will not reason and compare; my business is to create. --William Blake
--
You received this message because you are subscribed to the Google Groups "software_craftsmanship" group.
To post to this group, send email to software_cr...@googlegroups.com.
To unsubscribe from this group, send email to software_craftsma...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/software_craftsmanship?hl=en.