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
-
//Not only is this stupid, it's mixing
if ("foo")
{
return true;
}
//and
if ("bar") {
return false;
}
// I can't even -
Maybe he was never taught that return statement can be outside an if block...
...And if only need a value
...And comparisson can be done without strings -
Is that curly on line 552 bothering anyone else? Seems like you've got inconsistent formatting too.
-
Lukey498yI mean, I've actually seen this sort of awfulness lots in legacy code where people were too lazy to remove the if logic that was there and just changed it to always pass or fail. You know, because just removing it would be terrible π€
-
What I've learned from snippets like these is that never, NEVER remove it. Whatever it does it makes the code to work, and the code feels complete inside with this useless snippet in it, thus removing it is like taking a piece out of the poor code's hearth, which will makes it sad, resulting in a failed build.
I guess I should sleep instead of commenting. -
deMark4258yI've actually seen true/false defined in a database table and mapped to 0/1...
I guess it's there in case we want to swap realities of define a 0.5 true or something... -
Sometimes, I feel like I've got a long wayyy to go before I could say I'm a real programmer and then I see shit like this that I would never do, even not knowing a language and think fuck...
I have no idea why he doing this ._.
undefined
cleancode
smell
javascript