On 2013/04/18 1:42, rosenfeld (Rodrigo Rosenfeld Rosas) wrote:
>
> Issue #8237 has been updated by rosenfeld (Rodrigo Rosenfeld Rosas).
>
>
> Charles, I understand that you don't like this code style. But I'm pretty sure you consider bad several other code styles used on Ruby by people out there, right?

Yes. But my understanding is that in general, those things that have a 
compact syntax have that compact syntax not just because there's some 
occasionally useful (but maybe not generally recommended) coding style 
that uses it, but because there are some uses/coding styles that are 
very frequent and/or highly preferable where the syntax can be used.

So "I really want this to be a short syntax because occasionally I'm too 
lazy to do the better thing" isn't good enough of an argument.

If you can find a reasonably frequent use case where the short syntax is 
the preferred/better way to do things, then that's a good argument for 
introducing a new syntax. Then once that syntax is around, of course 
it's difficult to forbid people to use it, even in cases where it may 
not be the "best" way to do things according to OO or some other theory.

> This is what I like about Ruby. It doesn't try to provide you a single obvious way of doing something.

Did anybody say that they want to forbid you to write
user&&  user.profile&&  user.profile.website&& 
user.profile.website.thumbnail ?

No. It's just that this kind of style isn't important enough and/or good 
enough for them to introduce new, shorter syntax for.

Let's take a different example. Ruby has global variables. We all know 
that global variables, in general, are a bad idea. Ruby happens to have 
global variables because Perl had them. If not for that, would Ruby have 
global variables? I don't know.

But I'm quite sure that somebody coming and saying something along the 
lines of "I want global variables, because it's a kind of coding style 
(not necessarily exemplary, I know), and ruby allows different coding 
styles, so why not mine." that wouldn't be a winning argument.

Regards,   Martin.

> ----------------------------------------
> Feature #8237: Logical method chaining via inferred receiver
> https://bugs.ruby-lang.org/issues/8237#change-38661
>
> Author: wardrop (Tom Wardrop)
> Status: Open
> Priority: Normal
> Assignee:
> Category:
> Target version: