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
-
m4lik687yBtw: this is from an open source project. Would be interesting to know if anyone can find out wich it's from.
(It has more than 500 stars on github and more than 200 forks. so it should be possible to find out) -
C0D4681387ySo they are using an inline if to determine a database query to be a like or not.
Nothing new here other then the inline IF about to make me throw something at this code 😠-
C0D4681387y@m4lik that’s what I meant 😂 had a blank moment.
Ternaries drive me up the wall, when I come across them.
Granted they take up “less” space but you loose so much context due to them as you have to decipher a simple if/else to ? : and pray it does what it should.
Related Rants
Today I've read this line of code:
$like === true ? $operator = "LIKE" : $operator = "=";
Should I be angry, sad or disappointed?
That was written by a person who I tought could code.
undefined
php
disappointed
ternary