tiles-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Martin Cooper" <mart...@apache.org>
Subject Re: Checkstyle doubts
Date Thu, 05 Apr 2007 17:09:26 GMT
On 4/5/07, Nathan Bubna <nbubna@gmail.com> wrote:
>
> On 4/5/07, Greg Reddin <gredbug@gmail.com> wrote:
> > On 4/5/07, Martin Cooper <martinc@apache.org> wrote:
> > >
> > > 2. The "public" redundant modifier is declared illegal in that
> > > > checkstyle file, but I think that it is not so bad.
> > >
> > >
> > > Here I disagree. IMHO, using 'public' in interfaces demonstrates a
> lack of
> > > clarity. It constitutes "noise" in the interface definition that
> hinders
> > > rapid comprehension. When someone reads through a set of interfaces
> and
> > > sees
> > > 'public' scattered around, they're likely to stop and wonder if the
> author
> > > had some purpose to specifying 'public' that they should try to
> > > understand,
> > > when in reality the author was simply not thinking clearly enough to
> > > translate their thoughts into accurate interface definitions. We
> should
> > > always strive for maximum communication bandwidth, and not clutter the
> > > code
> > > with things that readers will trip over and have to stop and wonder
> about.
>
> -0  hindering rapid comprehension is *highly* subjective.  it depends
> on what you are trying to comprehend and what you are used to.  in
> this instance that is apparently different for you and me. :)
>
> >
> > Interesting.  I've always preferred to be explicit and express things
> that
> > are true by default.
>
> agreed.   i also like that the method signature looks like it does in
> the implementation class.   i prefer the consistency...


This is a perfect demonstration of my point. Creating interfaces is a design
activity; creating implementation classes is an implementation activity.
They *should* be distinct, and you *should* be thinking differently when you
write them. Making them look the same confuses these two very different
activities and can lead to poor interface design.

--
Martin Cooper


> For example, I use "this." a lot (though probably not
> > consistently enough to communicate anything).  I can see your point but
> the
> > lack of the public modifier would "hinder rapid comprehension" for me,
> just
> > because I'm used to seeing it there.  (To be real honest I didn't
> realize it
> > was defaulted until I read this - though it makes sense).
> >
> > So should we cater to those who don't know the language well enough or
> cater
> > to those who prefer language purit?  Personally, I still prefer the
> former
> > because I like being explicit, but I won't die on that hill.  I'm
> willing to
> > be convinced otherwise :-)
>
> i don't really care.  to me it's a fairly trivial preference.  and
> whatever "hindrance" the lack of "public" might be to my comprehension
> is entirely negligible. :)
>
> > Greg
> >
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message