Deprecate `!a == b`
Patrick Schluter
Patrick.Schluter at bbox.fr
Mon Aug 19 12:23:13 UTC 2024
On Tuesday, 13 August 2024 at 21:02:28 UTC, Nick Treleaven wrote:
> On Tuesday, 13 August 2024 at 20:40:32 UTC, IchorDev wrote:
>> On Tuesday, 13 August 2024 at 20:30:10 UTC, IchorDev wrote:
>>> [...]
>
> I think it's actually that they don't know the operator
> precedence, or they just made a mistake.
>
>> A problem I have actually had is not being able to parse the
>> operation order for expressions like `1 + 2 * 3`, but I don’t
>> think we should require parenthesis there either.
>
> Agreed, because that syntax comes from maths rather than a
> subset of programming languages.
>
>> Also, here’s a nice case where I’d actually want to write
>> this: `!myInt == myBool` Again, here the parenthesis would
>> just be visual noise.
>
> The diagnostic doesn't need to fire when both sides are bool.
Comparing bools is an anti-pattern.
More information about the dip.ideas
mailing list