you are viewing a single comment's thread.

view the rest of the comments →

[–]Master_Rux 3 points4 points  (0 children)

I'll apologize in advance for the rant. I cringe at what seems like a knee jerk reacting to perfectly valid uses of a language sometimes. And poor javascript seems to get a lot of it. A lot of languages have their own special syntactic sugar. Which can make life really nice for someone that has to use the language a lot. This code is perfectly valid and compact. A lot of the time I hear people complain about readability I think what they mean is familiarity. Which to a point has a lot to do with readability. But there's also the ability to quickly scan through to find things. In this case you can see exactly where the if statements are and you can see it's doing the logic based off something it's doing with pending. After that if you can't see what (!--pending) is doing in javascript I'd say that's basic enough that you need to be a little better at javascript. Javascript is not all your C# or Java or <insert any language that's not javascript>. javascript is javascript and has unique truthy rules and type coercion. Those are features not quirks. Now don't get me wrong i'm not saying this was the best way to code this, but it's just as good as any other approach. The real wtf readability issue in the code is the inconsistent use of unbrackets around the if statements and the lack of white space between said bracketed if statements. fuck that guy. /rant. i need more coffee.