Get the app to ++, post and comment
  • 40

    Today the lead developer and I where loling and wtfing hard to the following code:

    if ($looked_column == true)
    {
    $trunca = 1;
    }
    else
    {
    $trunca = 1;
    }

    Mind you, we had no clue why he named the variable $trunca, and even then it had been set at the top of the file as 1 to begin with....was never used up to this line and $looked_column had also a set to true.

    This is why a lot of people give php a bad reputation. This right here is why people make fun of php......

  • 5
    Oh and I should have said. Neither the lead developer or me created this. It was done by someone else eons ago
  • 2
    Yes this is what code reviews are for haha
  • 3
    @jschmold they really did not.

    Ah and to make it better. This lies within an app that deals with budgeting :)
  • 1
    Horrid in many ways.
  • 1
    If I had to guess, it'd be that something is always being 'truncated'?
  • 3
    Sometimes you just have to be really, really... REALLY sure that $trunca = 1!
  • 2
    $turnca = call_user_func_array(function ($param = 1) { return !$param === 1 ? 1 : 1; }, [1]);
  • 1
  • 1
    @ALivingMemory you know it man!
  • 1
    @bashleigh holy shit lemme buy u a beer
  • 1
    Only 1 Yea? Lol
  • 0
    @bashleigh that example gets you whatever you wanna drink and as many beers lol. I was that impressed.
  • 0
    @AleCx04 haha I agree!!
  • 1
    @AleCx04 while (!$passedOut) { $beer++; if ($beer >= 8) $passed out = true; }
  • 1
    Probably some guy wanted to prove his company's code reviewing sucks or some shit.
Add Comment