1
pfs5
5y

Hey guys!
I am looking for good "whats wrong with this code" snippets with as little lines of code as possible!

Comments
  • 2
    Can't you just make some yourself?
  • 5
    @PrivateGER you'd think a dev would know how to write fucked code... Lol
  • 0
    ××i;
  • 0
    int i=10;
    i /=2;

    or i *=5;

    Valid code, but it feels just wrong
  • 2
    void main(int argc, char* argv) {
    return 0;
    }
  • 0
    mov eax, (0)
  • 1
    dating_pool = World.people.where(idiot: false, gender: :female).group(:country).sort(country: :desc, iq: :desc)

    dating_chance = dating_pool.count / World.people.count.to_f
  • 3
    @NoToJavaScript I use that all the time because
    i = i * 5;
    just looks silly IMO. Funny thing is that most people still don't use the shorthand syntax whith bit shifts. Not sure why, I strongly prefer
    i >>= 4;
    over
    i = i >> 4;
  • 1
    @Fast-Nop I use += every time. But still can’t bring my self for *=, -= and /=. I guess personal preference.
  • 1
    if (a > b) {

    return true;

    } else {

    return false;

    }
  • 0
    a simple function to find out if B is twice the value of A

    bool isSecondDouble(int a, int b) {
    return (a/b) == 0.5;
    }

    but it will never work in C nor Java. Probably will in JavaScript tho...
Add Comment