this post was submitted on 11 Dec 2023
0 points (NaN% liked)

JavaScript

1920 readers
3 users here now

founded 1 year ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
[–] kassuro@feddit.de 0 points 9 months ago (4 children)

I often have the pleasure of refactoring this mess. And sometimes it's not just 2 ternaries but like 4 or 5 thrown together. It took like half an hour to even understand what was going on. If you do this, you are just an evil person...

So I totally support this. Stop this shit...

[–] coloredgrayscale@programming.dev 0 points 9 months ago (1 children)

pleasure of refactoring this mess took half an hour to understand

If you can use any of the jetBrains IDE it can rewrite it to if/else with a few clicks (or [alt] +[return])

[–] kassuro@feddit.de 0 points 9 months ago

Ah that would be helpful. Gotta try that the next time I encounter such a monstrosity.

load more comments (2 replies)