3 ms·
> But at that point it gets confusing to read. What's confusing about that? Perl has that, I use it all the time.
by jstanley 4y ago
> But at that point it gets confusing to read.
What's confusing about that? Perl has that, I use it all the time.
- forgotmypw17 4y agoWhat I find confusing about it is that it does not match the execution order. Perl is my main, and I never use that feature.
- jbverschoor 4y agoIt’s way more clear and robust than a one liner if. A for loop also doesn’t match what’s being executed. It’s s actually a do/while loop
- forgotmypw17 4y agoOne-liner if statements is another pattern I stay away from as much as possible...
- jbverschoor 4y agoI usually use it to do some pre conditional checks, or to return early
- forgotmypw17 4y agoThat's fair. I still use 3-liners for that.
- levodelellis 4y agoComparing perl to a language that wants to be readable is very funny to me For me, the problem is when my expression got long or if I call a function with multiple parameters. The more complex the line is the easier it is to not notice the `if`. Also I agree with what the other person said, it doesn't match the order if you read top down left to right
- unfunco 4y agoRuby also has it and it is easily readable.