Path: csiph.com!x330-a1.tempe.blueboxinc.net!newsfeed.hal-mli.net!feeder3.hal-mli.net!news.glorb.com!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail From: Lew Newsgroups: comp.lang.java.programmer Subject: Re: Style Police (a rant) Date: Sat, 27 Aug 2011 08:42:05 -0700 (PDT) Organization: http://groups.google.com Lines: 38 Message-ID: <14afe60c-e1ba-4e65-a00e-19a58aea3957@glegroupsg2000goo.googlegroups.com> References: Reply-To: comp.lang.java.programmer@googlegroups.com NNTP-Posting-Host: 216.239.45.130 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Trace: posting.google.com 1314459726 7709 127.0.0.1 (27 Aug 2011 15:42:06 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Sat, 27 Aug 2011 15:42:06 +0000 (UTC) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=216.239.45.130; posting-account=CP-lKQoAAAAGtB5diOuGlDQk0jIwmH0T User-Agent: G2/1.0 X-Google-Web-Client: true Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:7418 Tom Anderson wrote: > Eric Sosman wrote: >> In recent days I've encountered a tool called "Checkstyle," that >> parses Java code and flags various departures from its baked-in rules. > > You mean the rules you configure? Or by 'baked-in' do you mean the default > rule set? > > I assume you are not making the mistake of assuming that Checkstyle's rule > set is not configurable. > >> Some of these are worthwhile [...] Some are less so > > That has been our experience with it too. ... > [snip] >> But the subject of this rant is its complaint that a class is "not >> designed for extension." You write a perfectly ordinary class with >> methods foo() and bar(), and Checkstyle throws up its hands and gibbers >> that your class is "not designed for extension." Say, what? > > I know what this rule is getting at. Hopefully Lew will chime in at some > point soon and explain it. I defer to a more expert Bloch on this: http://java.sun.com/docs/books/effective/ Item 17: Design and document for inheritance or else prohibit it The nut of this tip is that code outlives the writing of it, a much-ignored truth to the detriment of the code. If you leave a door open, someone will walk through it regardless of the danger on the other side. >> I wonder what this Checkstyle tool would think of the concrete, >> non-final, non-empty equals(), hashCode(), clone(), toString(), and >> finalize() methods of ... java.lang.Object, the one class *no* Java >> program can avoid extending. If java.lang.Object is "not designed for >> extension," is there any hope left for the language? > > Well put!