-
Notifications
You must be signed in to change notification settings - Fork 13.9k
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
Conditional Logic: Correct ternary operator syntax #29021
Conversation
Clarified ternary operator syntax by replacing "conditional" with "logical" for accuracy.
Why do you feel conditional statement is not correct? |
Thank you @CouchofTomato for give me a chance to clarify my opinion
Because the right name for something that could evaluates to #the followings are logical statements
5 == 7 #=> evaluates to `false`
6 >= 10 #=> evaluates to `false`
"hi" != "hello" #=> evaluates to `true`
# I think the following is a conditional statement, which is composed of : `if ... end`
if logical_statement
#do something
else
# do that another thing
end I think |
@CouchofTomato May I ask you about what do you think? |
Apologies for the delay. I don't disagree with you that it's a logical expression. However you'll often see it referred to as the condition in a lot of places because it decides the executed part of a conditional operator. So in isolation it definitely is a logical expression, but as part of a conditional operator it is often referred to as the condition. That's why I'm not sure it's wrong to leave it as it is. What are your thoughts? |
Thanks a lot @CouchofTomato, I guess it should stay as it is, There is a little change I recommend based on the resources you provided: So I recommend replacing |
Yeah I'm happy to accept that. Thanks for working through this with me and I'm glad we arrived at a satisfactory outcome. |
Clarified ternary operator syntax by replacing "conditional" with "logical" for accuracy.
Because
To make the ruby ternary operator syntax more accurate
This PR
Issue
Closes #XXXXX
Additional Information
Pull Request Requirements
location of change: brief description of change
format, e.g.Intro to HTML and CSS lesson: Fix link text
Because
section summarizes the reason for this PRThis PR
section has a bullet point list describing the changes in this PRIssue
section