99
Dacexi
7y

This is what i consider to be true horror...

Comments
  • 6
    And that's why I like to comment the end of every if, for, while, etc ☺️
  • 4
    Your style guide doesn't appear to be limiting nesting depth. Bad style guide! Bad!
  • 1
    @CrankyOldDev no style guide... Bad. Bad me
  • 6
    A little bit of callback hell? :-)
  • 3
    callback hadouken
  • 1
    Looking at that gave me Carly Rae Jepsen - call me maybe, on my mind..
  • 6
    @ManuLG I won't downvote you for it, but I would consider it a bad habit to do that by default. To me it seems like your control structures are way too long.

    If the code is generic, it should be refactored into a reusable method. If you see an "else", you should do an early return. In JS, you can create promises and higher order functions, you rarely need to nest more than 2 levels deep.
  • 2
    At least it's indented. Imagine trying to make sense of that all on one line!
  • 0
    Debugging that must be hella fun (not).
  • 3
    Look at all the sad faces in that picture. They are suffering more than anyone else
  • 0
    Not enough deep -1
  • 1
    I use a plugin for vscode which transforms paired brackets with the same color. Anyways it's always better avoid the callback hell at all. If you are using node, you can consider using utils.promesify()
  • 0
    This pic actually gives me headache
  • 2
    😖 semicolons, I see your point
Add Comment