235
scroach
6y

i'm getting headaches right now...

Comments
  • 32
    Hey it ain't that bad...

    ... Could be code from my company ;))
  • 32
    @010001111 worst thing is: this ain't legacy code... This is new stuff written NOW ... In 2019 ... In bloody joomla!!!!
  • 3
    Gilfoyle hits again
  • 14
    @scroach I can't even...
    My first thought was 'lol you're stuck with legacy shit too, I'm not the only one, yay..'
    Then I saw your comment.. is the person responsible by any chance a new hire? Might be my ex coworker, he loved to copy paste shit without fixing the variable namings and stuff.. o.O also not checking exactly what the copy pasted stuff did..
  • 4
    Well, the good thing is that this should be easy to coach him about and make him better!
  • 7
    @sladuled Nah ... Worse. It's from a project partner who is actually teacher at the university where I studied... And no I don't have any idea how that happened cause normally they should know and teach better... My eyes started bleeding when I saw this.
  • 2
    Looks easy to fix! Have a code review. Discuss what your standards are. Done. A lot better than code that doesn’t run.
  • 8
    @sheriffderek code with severe security vulnerabilities is worse than code that doesn't run.
  • 1
    @ItsNotMyFault having your hand cut off hurts.
  • 1
    Lol, kinda looks like a legacy project I've had to work on in the past

    I had the same reaction as you did 😂 good luck and power through it man, bad code everywhere better get used to it and try to refactor when you have extra time

    Also pay extra attention to documentation and update/create where necessary, your colleagues/future you will love you for it 😉
  • 7
    nits - hilarious. I am gonna name my pet nits.:)
  • 2
    I love how the doc comment for the function is demonstrating its uselessness by restating whats already there and failing to be up to date with the param name.
  • 1
    @dUcKtYpEd joooooomla
  • 2
    Why u shame my underscore, sirrrrr? 😢#underscore_all_the_shit
  • 2
    It's possible that "$input->get()" already prevents SQL injection, isn't it?
  • 5
    @Skayo No it doesn't. It won't. And even if it would TRY to. DONT trust it. Never trust any input and just use prepare statements!
  • 1
    @dUcKtYpEd don't ask me... Stupid people? My coworker prototyped that thing with symfony... Was fully working and nicely coded. Then the project partner decidee: hey let's use fucking joomla... Because... It has bugs... And can easily be hacked... I dunno.
    This thing isn't even going to be a fucking CMS .. it's a fucking backend with a REST API!
  • 2
    Chef Golden Ramsey’s hell code! 👨‍🍳
  • 1
    Honestly these things are easily corrected. I worked with some who wrote 20 line string queries that wouldnt execute in a database manager but somehow worked in production.

    He lasted two months but the damage was done. You can't delete one of them without causing days of work because of injected variables like $TypeType
  • 4
    Be thankful you have classes.
    I’ve got shit with is just require(“thisFile.php”) in the middle of a code block.

    This then injects this other file and makes use of variables initialised in the parent file.

    So much time wasted trying to trace code, when a child has a variable initialised in another child file 😔

    Sometimes I want to stab people, one day... one day I might just loose it.
  • 1
    I love SQL Injection' too..
  • 1
    Looks like I could have written this...
  • 1
    @scroach Wait. What? This is new stuff? How. Is. This. Even. Possible.
  • 1
    Code style is personal preference I believe.
    If they want to use tabs, they can do it, as long as the code is readable.
    If they want to use underscores, they can do it.
    Just: don't mix underscores and CamelCase for no reason
    Out of your rant, only two points were reasonable I believe.
  • 0
    I see Joomla!
Add Comment