> > Trailing Boolean Operators > > If the link doesn't work, here's the raw url: > https://wiki.php.net/rfc/trailing_boolean_operators > > The TL;DR is that we allow what I'm calling a 'dangling' ('optional' might be > the better word) trailing boolean operator. Mirroring trailing commas. It's > designed to be a purely additive QoL improvement to help reduce diffs. >
Hi Len, I see that this is your first RFC, welcome, and well done on the RFC draft. The RFC text is quite detailed, and clearly brings the idea across. I appreciate that you explained your rationale, with simple examples, and a well-defined scope. Greatly done. As for the idea, however, I do not agree that this would be a net-positive change. I wanted to echo what Ben said in his reply too. Commas are fundamentally different from the operators like `&&` and `||`. One is a separator, the other is an operator. Trailing separators do not add to the confusion, and the benefits you mention in the RFC are meaningful improvements that do not add to visual confusion. `&&` and `||` are binary operators that require a right-hand operand. Your RFC removes this requirement from the syntax, but I believe they semantically still require a right-hand operand. I'm also not aware of any other languages that allow trailing operators. For PHP to add trailing commas, it had a strong argument in favor because other languages like JavaScript, Python, and of course C (among many other languages) supported it, and adding support for trailing commas was a natural progression. Back then, even this was argued quite a lot in the RFC discussions, and some proposals did not pass the vote. As Ben mentioned, the new-line, operator, and operand pattern solves the diff issue. Besides, changing the order of an `if` block is a significant change, and at least for me, not something I do often. For changes like this, I would rather like it to have a more visually stark diff. Thanks, Ayesh.
