D
david.karr
I was recently reviewing some code that consistently defined empty and
redundant "noargs" constructors. I pointed this out (along with the
humorous method comment of "Default constructor"), but was told the
code was developed with the requirement of using the Checkstyle
plugin, which has an advice of always defining an empty noargs
constructor and not using the default constructor (assuming you didn't
need a noargs constructor that was non-empty).
I've never been that fond of advice that creates useless code that
takes up space better taken by real code, but I'm wondering what other
people's studied opinions are on this.
redundant "noargs" constructors. I pointed this out (along with the
humorous method comment of "Default constructor"), but was told the
code was developed with the requirement of using the Checkstyle
plugin, which has an advice of always defining an empty noargs
constructor and not using the default constructor (assuming you didn't
need a noargs constructor that was non-empty).
I've never been that fond of advice that creates useless code that
takes up space better taken by real code, but I'm wondering what other
people's studied opinions are on this.