Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
This is a nice example where 1TBS would have been superior (I imagine removing braces altogether is impossible).
-
orijin20129y@StefanH That's really cool! Maybe he was trying to prevent malicious bits injected between the opening of the function and the first if statement 😃 -
@StefanH Interesting, just read something about this happening in linux, the dirty COW exploit. Seems like this kind of attack.
-
scoots489yYou need to get used to === or !== instead of == and !=. And simply check the type you comparing. The code here might still not work if value is empty string or undeclared. -
Are we ignoring the fact that 2 difference cases were used for the argument defaults? NULL and null...
Related Rants

Have you ever seen such a comprehensive Title select?
Okay Xing I fucking got it. GDPR is there...
That was one careful developer
undefined
just in case