News for hackers. Stuff that matters.
Re:Interesting Bugs Caught by ESLint's no-constant-binary-ex... by iamflimflam1 on Thursday November 09, 2023 @02:53AM (#38202250)
Wow - I’ve been coding for a long time and find your assign and test really hard to parse.

In a code review I would definitely reject this.

Re:Interesting Bugs Caught by ESLint's no-constant-binary-ex... by kmoser on Thursday November 09, 2023 @03:44AM (#38202558)
Just curious, do you also find the ternary operator hard to parse? This is a serious question: I've found some programmers tend to avoid it entirely, while I think there are some clear cases where it's advantageous to use.

What I'm getting at is one person's "easy to parse" is another person's "difficult to parse", and there may be no objective answer which makes one any better than the other.

Re:Interesting Bugs Caught by ESLint's no-constant-binary-ex... by iamflimflam1 on Friday November 10, 2023 @04:06AM (#38216703)
To be honest I think it really depends. And in some contexts it is unavoidable.

I would think to myself if I was writing one “have I made a mistake somewhere that means I have to use this?”

I don’t think it’s necessarily about “can I parse this”, it’s much more about will all the devs on the team be able to parse this.

To me, code is all about communication - to myself, but also to an audience I haven’t met with varying skill, knowledge and context levels.

I’ve been bitten too many times with code that only one or two people can work on.