30
perotti
6y

Refactoring someone else's code (the dude's a senior).
I'm a junior, just updated my linkedin, burnout activated, I can't deal with this kind of shit no more.

Outro: this is the nicest piece of code from him, every other line of code just .... just.... D:

Comments
  • 1
  • 1
  • 7
    ... well.. at least he knows how to use try and catch ¯\_(ツ)_/¯
  • 4
    Callback hell with promises 10/10
  • 0
    Might I suggest today's catch, good Sir?
  • 1
    You are saying that it's a refactoring job, could it have been written at a time when async/await or promise patterns were not established yet?

    Admittedly even then it could have been done better.
  • 1
    @rusty-hacker but thats waaay too much. At that point it feels like deadlines were way closer than reason was.
  • 0
    @rusty-hacker nope, started at node 8.10, no excuse there
  • 0
    If he doesn't know how to use promise, he should at least know how to make a variable containing a function to keep it DRY...
    It's a basic understanding of JS...
  • 0
    😱😱😱😱
  • 0
    I hate deep nesting. There are some programmers who really love it though. To me it just lacks any real clarity, and it makes the code brittle. If I had to refactor this, I would try to flatten this as much as possible. IF that's even an option. I'm not a Javascript dev, so I don't know
  • 1
    One catch is ok man
  • 0
    @BranDev the worst part is they don't even depend on each other, so we could await Promise.all([]).
    But I'm not touching this. 🤢🤢🤢🤢
  • 1
    WHYY?!?
Add Comment