12
Kafuu
4y

Talk about the weirdest shit you've seen in someone's code!

Comments
  • 5
    The pom variable, someone actually made a fully functional webshop with just one (1!) variable......
  • 2
    @GieltjE Do you have a link ;)

    I would like to see that code :P
  • 5
    if ('true' == 'true') { }
  • 2
    @byIcee Seen that ;)

    Often where you during development only showed something to some users and when releasing you did not remove the if just in case you would have to reinstate it, then it was forgotten.
  • 3
    @byIcee if ('true' == true)
    {
    printf("true");
    }

    lol
  • 2
    @Kafuu welcome to devRant!
  • 2
  • 1
    A json string of >3000 chars in one line of Java test code. The guy saved a service response once and checked it to be the same every time. Worked for him only (database state) and only for a few days. Code stayed there for years.
  • 3
    Also seen very often:

    if (condition == true) {...}
  • 1
    This could be a good topic for next week
  • 0
    @ocab19 It'd be an honor if this was chosen lol.
  • 0
    Parsing xml with

    xml.substring(xml.indexOf(...) + xml.length, xml.indexOf(...))
  • 2
    }else
    {
  • 1
    @CodyTheFurry I find myself guilty of that. ;-;
  • 1
    Switch (var)
    {
    case default:
    //something
    break;
    }
  • 0
    @Pauly-Rey @t4ils welcome to devRant!
  • 3
    Another common thing:

    If (arg != null) {
    // 100 lines of code
    }
    return null;

    Instead of handling the null first, throwing an illegalargumentexception, and using the actual code in the function body without an unnecessary indentation level.

    Also: please never return null!
Add Comment