Stupidest code of the day

Discussion in 'Java' started by emmaps, Jan 19, 2005.

  1. emmaps

    emmaps Guest

    Now I have come to expect that my colleagues are still stupid enough
    Whats wrong with using ""+ ?
    emmaps, Jan 19, 2005
    1. Advertisements

  2. It's forcing an unnecessary conversion of an int into a String, the
    creation of a second String, and then the parsing of that String into a
    double in order to create an instance of Double.
    Darryl L. Pierce, Jan 19, 2005
    1. Advertisements

  3. emmaps

    Jon Caldwell Guest

    I would like to submit a nomination for today's stupidest code. I hope C
    entries are eligible.

    put_bufint(&ptr, 1, atoi("92")); /* record type */
    put_bufint(&ptr, 1, atoi("1")); /* language code */
    put_bufint(&ptr, 1, atoi("0")); /* cmd accessible */

    Any ideas how to optimize this? ;-)
    Jon Caldwell, Jan 20, 2005
  4. put_bufint(&ptr, atoi("1"), atoi("92"));
    put_bufint(&ptr, atoi("1"), atoi("1"));
    put_bufint(&ptr, atoi("1"), atoi("0"));
    Andrea Desole, Jan 20, 2005
  5. emmaps

    Paul Tomblin Guest

    Submit it to "The Daily WTF"
    Paul Tomblin, Jan 20, 2005
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.