-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow the character literal syntax "?" #631
Comments
That's pretty debatable - e.g. that's not really a character literal syntax since Ruby 1.9. It's just another way to write a single-character string, so I'd rather use a string instead of confusing people with an odd special syntax that has lost its original purpose. |
Another point - |
IMHO I'm not a fan of rules exceptions because if there is too much it is hard to remember. Just my opinion though. |
It was my intention opening this issue.
I used "character literal syntax" because this is how the guide calls it.
I think it's only odd because it's not used at all but just open your rails console and run
Again, it is strange because we don't use it, for me, when I began learning ruby it was weird to use
Just googled
I don't meant to force people using @bbatsov @scudelletti Sorry if I sounded rude at some point but english is not my native language, I just meant to show you my opinion :) |
No worries. My biggest concern with it is that it's a legacy remnant from Ruby 1.8 and until very recently it was very likely that it was going to be removed in Ruby 3.0 (and it is still probably going to be removed later). That's why I think we can't really encourage people to use it, knowing that a few years down the road it might cause breakage to their code. |
The guide is discouraging the use of literals syntax
?x
but I think they should be used for single and double quotes, it seems clearer to me.str.gsub(?',?"))
str.gsub("'", '"')
which one is better?
The text was updated successfully, but these errors were encountered: