Misuse of method overload



  • Image that you have an class. Let's call it Paint*
    And it has a method which say:


    <font size="-1">  void</font> rectangle(float x, float y, float w, float h)
              Adds a rectangle to the current path.

    Now paint also have an overloaded version of the rectangle method which take a Rectangle object. But instead of painting the rectangle, it "Adds a border (complete or partially) to the current path.."

     What kind of design is that??

    *Name have been changed to protect the guilty



  • That would depend on the difference between "adding a rectangle to the current path" and "adding a border (complete or partially) to the current path".



  • Also, iText's Rectangle class encapsulates x, y, width, height, border width, border color, and fill color. So this is not necessarily a sensible overload. And when I still worked with iText's low level api (PDFContentByte) I often had to look at the PDF spec to even understand what the (more unintuitive) functions supposed to mean. OK, I could have bought Bruno's book, but I don't like dead tree books.

    Also, you can "easily" create PDF files with do not follow the spec, but luckily Adobe Reader complains and then you can start searching what you broke...

    TRWTF is that after Bruno changed the license to AGPL, people tended to keep lots of mini forks of the old (MPL/LGPL) version to avoid buying a commercial license, instead of trying to concentrate their bugfixing effort to a single fork (or just buying the commercial license...)



  • @mihi said:

    TRWTF is that after Bruno changed the license to AGPL, people tended to keep lots of mini forks of the old (MPL/LGPL) version to avoid buying a commercial license, instead of trying to concentrate their bugfixing effort to a single fork (or just buying the commercial license...)

    Multiple, buggy forks created due to obscure licensing issues nobody with a real life could care about are the heart and soul of FOSS.



  • @mihi said:

     

    TRWTF is that after Bruno changed the license to AGPL, people tended to keep lots of mini forks of the old (MPL/LGPL) version to avoid buying a commercial license, instead of trying to concentrate their bugfixing effort to a single fork (or just buying the commercial license...)

    I guess that is what happens when the price goes from 0 to 1.615€ for a single minimum server license.




  • @mt@ilovefactory.com said:

    @mihi said:

     

    TRWTF is that after Bruno changed the license to AGPL, people tended to keep lots of mini forks of the old (MPL/LGPL) version to avoid buying a commercial license, instead of trying to concentrate their bugfixing effort to a single fork (or just buying the commercial license...)

     

    I guess that is what happens when the price goes from 0 to 1.615€ for a single minimum server license.


    People fail to form a cohesive community?

     



  • @mt@ilovefactory.com said:

    I guess that is what happens when the price goes from 0 to 1.615€ for a single minimum server license.

    That's only $2.11, that doesn't seem so bad.



  • @morbiuswilters said:

    @mt@ilovefactory.com said:
    I guess that is what happens when the price goes from 0 to 1.615€ for a single minimum server license.

    That's only $2.11, that doesn't seem so bad.

    It looks worse if you consider it as a percentage!

     



  • TRWTF is that Bruno chose a name that's agoogleable and according to Wikipedia, it's a presentation program from 1979.


Log in to reply
 

Looks like your connection to What the Daily WTF? was lost, please wait while we try to reconnect.