Ruby adds experimental support for rightward assignments
131–140 of 172 posts
Re: Ruby adds experimental support for rightward assignments
#132Earlier quoted context omitted.
If your 10th clause is an unless then you're using it wrong. I agree that unless and the right hand assignment can be used incorrectly but that's not a reason to omit the feature :)
Where these conversations tend to break down is "you are using it wrong", which is technically correct but practically is a non sequitur. I can't control other people. Neither can you. Unfortunately saying that and acting like it's true are two separate things, and so we are chronically making decisions based on an illusion of control that is unhealthy to the point of self-harm. It just sets you up for disappointment…
Re: Ruby adds experimental support for rightward assignments
#133Re: Ruby adds experimental support for rightward assignments
#134Earlier quoted context omitted.
If your 10th clause is an unless then you're using it wrong. I agree that unless and the right hand assignment can be used incorrectly but that's not a reason to omit the feature :)
Where these conversations tend to break down is "you are using it wrong", which is technically correct but practically is a non sequitur. I can't control other people. Neither can you. Unfortunately saying that and acting like it's true are two separate things, and so we are chronically making decisions based on an illusion of control that is unhealthy to the point of self-harm. It just sets you up for disappointment…
And we put linters on code.
Re: Ruby adds experimental support for rightward assignments
#135 'think highly' => sentiment
this post.Re: Ruby adds experimental support for rightward assignments
#136Re: Ruby adds experimental support for rightward assignments
#137Ruby's parser is notoriously complex; if I remember correctly, only a few members of the core team even know how to maintain it without introducing regressions. The craziest part of this is that Ruby does not provide a full featured Ruby parser, so its entire static and dynamic analysis ecosystem depends on a (actually very high quality) 3rd party parser, begrudgingly maintained by someone who (AFAIK) doesn't even wr…
Anyway, I remember just how frustrated whitequark would get every time CRuby decided to make some random syntax change. I have a lot of respect for the current maintainer(s) for putting up with the ever growing complexity of the Ruby syntax. I hope Ruby stops changing the syntax on a regular basis, but I doubt this will happen any time soon.
Re: Ruby adds experimental support for rightward assignments
#138Earlier quoted context omitted.
shrug I've used it. The overloading of the equals sign is something that has never made sense for assignment. (Seriously, it's hard to intentionally come up with dumber notation than x = x+1.) I do use -> sometimes. It's more natural to do the evaluation and then figure out where you're going to store the result (particularly when you're programming). This is minor as these things go. Definitely not a big deal one wa…
If assignment is what we are concerned about, we should introduce something like `x := x + 1`.
Re: Ruby adds experimental support for rightward assignments
#139Earlier quoted context omitted.
Python has the same "rightward conditional" thing. Any time I use it, I wish python had just gone with the normal ternary (? :) operator.
> Python has the same "rightward conditional" thing. No, python writes the ternary operator with words, it doesn't have rightward conditionals. The key difference is that the else clause is required in the Python ternary, where it's optional in a conditional.
Re: Ruby adds experimental support for rightward assignments
#140I'm sorry but this "feature" is yet another design a hacker living in a bubble came up with. Most people think and program in English, or languages very close to English. In English I can read let x be 4ys and some change. I don't know how to read the arrow. 4ys and some change implies x? If this is a feature designed purely for speakers of SOV or OSV order languages like Japanese, that's fine, but the dominant langu…
> I don't know how to read the arrow. As a description (which is an easier translation of this idiom into English than an imperative) “is assigned to”. Imperatively, English tends to prefer verb-object with implicit subject, so we ought to be using a Lisp family language (setq “foo” 42) maps better to English imperative structure than most popular languages that do imperative assignment.
"is assigned to" is passive voice. I think we've all learned in writing classes we should avoid it as much as possible because stating the active voice is clearer.