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).
-
orijin20218y@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.
-
scoots488yYou 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
That was one careful developer
undefined
just in case