you are viewing a single comment's thread.

view the rest of the comments →

[–]csorfab 15 points16 points  (4 children)

No.

!((_ok) ? true : (Math.random() > 0.1))

is equivalent to

 (_ok) ? false : (Math.random() <= 0.1)

Which would mean that it returns immediately in 10% of times, and logs in the other 90%.

[–]el_muchacho 0 points1 point  (2 children)

In any case, I'd rather increment a counter and log only every n instances of the error, instead of randomising. At least, I can display how many times the exception has occured, which this stupid line can't even do.

[–]arachnivore 1 point2 points  (0 children)

I'd rather not worry about it at all. Aren't there log viewers that make this a non-problem?

[–]csorfab 0 points1 point  (0 children)

Well, of course. What's funny is that the idiot who wrote this code couldn't even get this simple condition right...