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
-
@JustThat in php '0' is falsely so the second statement is always called after the first one.
-
@Root How is that unintuitive? Isn't that just a standard rule for languages without direct datatypes?
-
@PrivateGER in Perl '0' would be evaluated as true.
I prefer Perl syntax, too.
$mode or $mode = "defaultlang";
just looks nicer than the ternary operator with omitted second operand.
But that's a matter of taste, of course. I bet many people would prefer :? ... -
Root797676y@PrivateGER A non-empty string being falsey is unintuitive. Honestly, in typed languages I would prefer if nothing but false and null/undefined evaluate to false. Fewer accidental errors and unexpected behavior that way.
-
@PrivateGER Strings shouldn't cast to anything automatically IMO. Especially not on the server side. Manual casts don't bite, mixing input with runtime values does. For example by enforcing a cast maybe devs wouldn't forget to check for range of input numbers. In the past month I used 3 different websites that allowed buying -1.5 t-shirts
-
If that's the worst code in your legacy system then it sounds like you have a pretty cushy job
What the fuck is this. I swear every time I look at this codebase I find something more stupid than I did last time.
I can't wait to throw the whole legacy system away.
rant