DEV Community

Discussion on: Laravel Collections Higher Order Messages - Single Line Magic

Collapse
 
mattmangoni profile image
Matteo Mangoni

It's a nice feature, but it makes reading your code slightly harder.
It may seem like a good idea now, but your future self or your teammates may disagree.

Collapse
 
ppshobi profile image
Shobi

I should disagree with you here ;), as a developer when you write multiple nested ternary operators for a complex if conditional, I can understand that it reduces the readability, whereas when you write a ternary instead of a simple if condition in one line, rather I'd appreciate you,

Collapse
 
mattmangoni profile image
Matteo Mangoni

Maybe I just need to get used to it :)