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
-
C0D4681385y@ScriptCoded except when that's every 2nd line of a sql query ๐คจ
Fucking ternaries can be good for quick conditionals, but can be a minefield when used with multi line blocks when an IF/ELSE should have been used. -
@C0D4 Well, there are use cases for both ternaries and if statements. But in this case I wouldn't say that either would be good. Assigning boolean values and doing nothing else in an if/else is, well, never correct imo. But I totally agree. Ternaries are supposed to be short and clear. Else if/else is probably smarter.
-
klutch4275y@ScriptCoded Thanks so much!!!
I've never actually been part of something like this before, just a lone wolf for a longggg time. -
C0D4681385y@ScriptCoded
I typically just do something like below unless there's I have a reason to write a ternary.
My experience with ternaries being used for inline assignments and multi line blocks (like 10+ lines per of/else section) has put me off them.
But each to their own.
someBool = false;
If( x == y )
someBool = true;
I hate complicated and out of date documentation!!!
if (me == angryClickityClackity) {
headButtKeyboard = True;
}else{
headButtKeyboard = false;
}
rant