480

It's never a good sign when a team lead writes code like this

Comments
  • 21
    😬😬😬
  • 27
    BUT WHY? THERE IS NO REASON FOR THAT SHIT.
  • 32
    @D--M There are tons of null checks at the top. I've got a long hard day of refactoring this horseshit of a codebase ahead of me. Sigh..
  • 26
    this = white theme?
    At least there are display alerts for that.
  • 30
    My condolences
  • 17
    @electrineer I expected displayAlert puns and I was not let down.

    Btw I prefer white theme as it's easy on my eyes. There, I've said it.
  • 26
    *left eye twitches*
  • 8
    Yeah, I do like light theme in cases where I'd have to constantly be switching tasks with an app or site that only has light theme. The transition is worse than the prolonged brightness IMO.
  • 8
    Look up "Peter Principle"
  • 7
    Early exit to the rescue, these else blocks are disgusting!
  • 15
    displayAlert("Fired.");
  • 10
    I wonder how do they become team leaders?
  • 11
    I would love a picture of how you refactored that code just for the comparison.
  • 3
    That's what happens with gotophobia.
  • 3
    It's time for goto's! πŸ˜‚
  • 5
    My eyes is bleeding lol
  • 9
    Experience over skills I suppose.
  • 3
    as someone who is partially blind for best practice cause noone ever told him

    what would be better?

    for a while i resorted to do a code style that more or less looks like

    [condition that would mean altert] -> return error

    [next condition that should not be broken]

    instead of doing

    [condition that needs to be fullfilled] -> doStuff()

    [ELSE] Alert()
  • 6
    Ha. Team. Leads.
    What are they good for?
    Absolutely nothing!
  • 4
    Team lead? What was his previous experience? Team lead at RetardCoding.com ?
  • 1
    @hamido-san Gross, but i agree :) as i myself is lead. and really i don't know where to lead :)
  • 11
    First of all, indeed, the code is painful.

    Apart from that, two remarks:
    - A team lead is not supposed to be the best programmer. He is more of a manager, that is supposed to make sure things happen when they got to happen and make sure the team stays together. If he has some spare time, he can code too, but that is not his main task.
    - He might not have seen better versions of this. Just show him how he can improve it, and he probably will. Give it some time and attention ;-)

    I am kind of the de facto team lead at my job, which means I talk to the managers, keep the discussions going when needed, and write some code :-)
    (Okay, there are only 3 developers and we are in the same room as the direct manager, but still...)
  • 3
    @TempestasLudi I will show this to my manager
  • 1
    @nkhan Why, if I may ask? ^^
  • 3
    @TempestasLudi Well I am more of a programmer then a manager :) didn't wanted the role.
  • 3
    @nkhan Ah, that's tough. How big is the team? And how many teams does your manager manage?
  • 4
    @TempestasLudi Now i have to program as I used to and manage my self and the team, well most the time team do it them selves(thumbs up to those guys) and i can do what i love.
  • 2
    Should have used GOTOs
  • 1
    May be your TL was killing time.
  • 2
    I can relate to that.
  • 2
    wtf πŸ˜…
  • 2
    Rip☠️
  • 2
    awwwwwwww hellllllllll no
  • 3
    just kill him
  • 8
    " It is more readable like this "
  • 3
    Beautiful code
  • 6
    @gowtham-sai Years of minimal oversight, total apathy, and seniority-based hiring structures. :)
  • 5
    @vlatkozelka then he should have seen this coming.
  • 1
    @devTea nicely put
  • 1
    @csizemore how does such organization runs?
    How do they survive?

    Sorry, don't mind. I know, too many questions. But that's how I learn.
  • 2
    @anudroid “Have you heard of our lord and saviour the maybe monad?”
  • 3
    There are two really easy ways to don’t do finish with this mess.

    1) Catch an custom exception class made for this purpose.
    2) Conditions are executed from left to right, so sometimes you can just do things like if(o != null && o.element != null) { ... } else { ... }

    Or you can just avoid doing a big function. It works too.
  • 1
    I threw up in my mouth. Thanks.
  • 1
    @AnonyOps did you drink it back?
  • 2
    @electrineer only way to do it 🀷🏼‍♂️
  • 1
    Bruh
  • 1
    He probably values other's and his code by number of lines. Why use oneliner CASE when bunch of IFs make so rich and elegant code πŸ˜‚
  • 2
    This hell always looks so attractive πŸ˜‚
  • 3
    Do you work at hell's hell?
  • 1
    Hells hell is a good definition also
  • 1
    Mother of god
  • 1
    πŸ˜‚πŸ˜‚πŸ˜‚
  • 2
    What is "||"?

    Thank you, I'll take "WTF Refactoring" for $200 please.
  • 1
    That's why they hired you, right?
  • 1
    WTF is this shit? 😬
  • 1
    I feel ya, have to deal with if else waterfalls all day everyday
  • 10
    Remembered me of that:
  • 2
    I'd see it as a possible job opening
  • 1
    Is it a program for the bomb squad ?

    if (cut_red_wire)

    {

    if (cut_blue_wire)

    {

    ..

    ..
  • 0
    So does it always display the same alert?
  • 0
    As well as the obvious wtf on branching logic.... the casing issues on the method!!! Triggered me straight away. I was like no bro!

    Maybe he is drinking magners irish cider so i will give him a pass on the shitty code for 5 seconds but java naming conventions on methods.

    Code review fail!!!
  • 0
    Greer. Fill it with goto statements and make him fix it.
  • 0
    This is all the code a Microsoft programmer needs...

    UNIX - assumes ahead of time you are intelligent and know what it is that you want to do.

    Windows - assumes ahead of time you’re retarded and have no clue what you’re doing.
  • 2
    Two more if-else's and I will call that code an AI 🀣
  • 1
    ... this isn’t what “Block Chain” means...
  • 0
    You display a huge alert.
  • 0
  • 0
  • 0
    I think you are right
  • 0
    One question...." WHY ? "😳
Add Comment