18
rutee07
37d

I saw this:

functions = {"something_1": name_of_func1,
"something_2": name_of_func2,
more shit like this..}

Then it's called like this in an "if" statement:
if something_1:
functions["something_1"](param1, param2)

Does a simple "if this" then "call this method", not work? What is your point, man? What the fuck? I looked everywhere because maybe, JUST MAYBE, you did this for a reason. Maybe you're reusing this dictionary somewhere but no, I found no reason. You did it because fuck everyone. I mean unreadable and unnecessarily complex code = job security, right? Oh my god, it's like reading a 500 page story with no plot, fucking hell.

Have you ever seen so much bullshit in a codebase, you decided a lifetime with Satan is more tolerable? This makes me want to switch careers altogether. I am tired.

Comments
  • 0
    Maybe I'm just too dumb to understand these things. In that case, I should probably quit anyway. My confidence level is fucking low, nothing makes sense.
  • 6
    Yep, I've also seen functions being saved to the database as configurable's so during checkout specific functions are called instead of the standard flow rather then setting up db flags. was fucking hilarious when I refactored that class and destroyed some UI flows I didn't even know existed.
  • 0
    @C0D4 This is why I'm not touching this shit anymore. I think that's what he was aiming for initially then he changed his mind and forgot to change it.
  • 2
    @C0D4 I didn't know this level of stupidity was even possible. What the actual fuck
  • 2
    @Rutee07
    You're one of the few people I've met who isnt an idiot. That's probably the biggest compliment I've ever given on here.

    Dealing with idiots, though, like whatever dumbass thought it was a good idea to write that code, absolutely makes me tired and unable to care. I dont blame you.
  • 2
    @ItsaMeTuni I work with some bizarre and scary projects. There are Things I would have slapped or thrown CRT monitors at peoples heads for, for the decisions and mess that was left behind.

    I'm expected to maintain and not loose my mind over it, but refactoring / rebuilding has always been a "bad idea" since it would reduce the feature development.

    Mind you the fucking thing is so far gone, the feature development and lack of TDD capable code (think procedural with some functional) breaks almost every time you add something new 🤦‍♂️
  • 1
    @Root Thank you. My big PP energy has become more powerful now. :D

    I agree. I don't think many people understand how demotivating working with this kind of codebase really is. Not to mention, when you stop caring, you end up delivering shit code as well. If you keep caring, you're gonna lose your mind so might as well give up.
  • 2
    @C0D4 How are you still there? What a nightmare.

    The codebase I'm dealing with and been whining about for months is exactly what you described. Their dev has been chasing me for unit tests and I cannot do it. It's impossible to unit test their code because of how it was structured.

    Every time I'm about to add a new feature, I have to follow their sTrUcTuRe. I tried not to and they gave me crap about breaking other stuff so I followed it and voila, it's impossible to unit test. I checked their existing unit tests, it is a joke, might as well say "This works, shut up."
  • 2
    @rutee07 there's pros and cons, the codebase for some of these projects are on the cons side though.
  • 2
    But this is allowing you to use keywords as functionnames
    Such as
    var f = {
    “if”: ()=>{},
    “then”: ()=>{},
    “else”: ()=>{}
    }
    Then call: f[‘if’]()
  • 4
    @dder I'm a slap you so hard that "f" will eval() it's self. 😬
  • 2
    @C0D4 I was just expecting that ! I deserve it !
  • 2
    Sometimes, y’all post things that make me realize I’m not as terrible at writing code as I think I am. Which is good when I’m practicing for interviews. So thank you.

    Also, I am so sorry that a) that exists and b) you had to see it, let alone deal with it.
Add Comment