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
-
gitlog62065y@C0D4 nope not that way.
I've seen people fucking using that true value as 1 for operations
You never know the code is bad at just one line or it is the start of a horrendous journey -
mundo0349795yWell it could be worse, they could be numbers or strings.
I think this is a nice way to learn this operator. -
It depends on how much the programming laguage is typed. Javascript or php would be so different from java or c++ in interpreting this line of code.
Like sometime ppl write stuff like :
If(var) {}
So if var is null it is assumed as false. I see this so much in javascript when devs avoid trying to understand the differences between, null, undefined, false, nan lol. -
I remember back in school some people actually wrote code like this:
if(list.isEmpty()) {
return true;
}
else {
return false;
} -
gitlog62065y@C0D4 oh and btw -1 is treated as true in most of the languages in case the return type as Boolean
-
Hazarth94765yreturn t.result() > 0;
Could use the raw value, but I like to keep my types consistent...
Related Rants
-
xjose97x19Just saw a variable in C named like this: long time_ago; //in a galaxy far away I laughed no stop.
-
jsjunkie33Everyone always says the previous developer was crap, sometimes you're right
-
Unskipp24So this happened last night... Gf: my favorite bra is not fitting me anymore Me: get a new one ? Gf: but it ...
Fond this gem in a sample code at uni...
Noice 👌👌👌
rant
boolean
smh
bad code
c++