News for hackers. Stuff that matters.
Re:Ruby adds experimental support for Rightward assignments by amw-zero on Thursday September 03, 2020 @11:09PM (#24371336)
How is the complexity increased?
Re:Ruby adds experimental support for Rightward assignments by eejjjj82 on Friday September 04, 2020 @07:52AM (#24374099)
Because now there are 2 ways to do the same thing with little obvious benefit other than syntactic bikeshedding.

2 ways to do something is more complex than 1.

But it's more than just the syntax of the code. It now means new lint rules, new coding standards in projects (some will allow => assignment, some will encourage conformity to legacy code, and others will disallow it entirely). There will be new Rubocop rules and other editor configs to update for proper syntax highlighting.

Syntactic changes like this with little obvious benefit need to be looked at skeptically. Just because something can be done, doesn't mean it should be.

Re:Ruby adds experimental support for Rightward assignments by mypalmike on Friday September 04, 2020 @12:38AM (#24371742)
Complexity increase from reading it has.
Re:Ruby adds experimental support for Rightward assignments by satisfaction on Saturday September 05, 2020 @11:20AM (#24384191)
Laughed at this I did.
Re:Ruby adds experimental support for Rightward assignments by sixstringtheory on Friday September 04, 2020 @03:31AM (#24372620)
As you read through code you can come across a huge switch and not know why until you look to the end. Now you’re reading bottom-up, which is just as unnatural as right-to-left for english speakers.

Not necessarily more complex, but not less complex either IMO. I often say complexity can’t be eliminated, only spread around differently; I think we’re seeing that here.

Re:Ruby adds experimental support for Rightward assignments by satisfaction on Saturday September 05, 2020 @12:50PM (#24384958)
I think it would be possible to think of this in terms of complexity theory, for N case statements to you would possibly have to check 2N locations for assignment. I wonder if you could do parallel assignment: var1 = case = var2
Re:Ruby adds experimental support for Rightward assignments by baash05 on Saturday September 05, 2020 @08:33AM (#24383079)
It's actually very simple to illustrate. Say this 5 => x in english. (three words or less)

Or this one

cat => person.pet