loading...

re: A simple tip for cleaner code VIEW POST

TOP OF THREAD FULL DISCUSSION
re: For some reason the younger devs in the team prefer to write code this way ☝️, but the truly enlightened devs will write code like this: const f...
 

while I personally go for the first one, I tend to be a little bit more explicit by doing the OP's last example, because I've worked on code bases where there's a lot of new devs and they tend to break (and some times don't even touch them by fear) too much these ternary/single return statements, while I don't think they are bad, some times I just care more about explicitness for the rest of the team/teams, on my personal projects tough you will find more ternary/single return samples :smile:

code of conduct - report abuse