-
-
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
Add guideline for using safe operator. #912
Conversation
@@ -323,6 +323,29 @@ foo&. bar | |||
foo&.bar | |||
---- | |||
|
|||
=== Safe navigation |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd argue regarding the section, Source code layout.
Maybe it would be a better fit for Misc?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you elaborate more regarding this comment?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I'm not mistaken, presently this new guideline resides in the "Source code layout" section. This section is mostly all about whitespace, formatting, those things that don't change code semantics.
The new guideline suggests code changes that may, depending on constraints, change its behaviour.
Basing on this observation, I propose moving this new guideline to a different section. I don't have a better section in mind, so I suggested "Misc".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
got it
add language name along with source.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
Thank you, @Gauravpurohit409 ! |
#889 - Add guidance for safe navigation operator (&.)
Based on the 889 issue added guidelines for using safe navigation operators using some resources from the thought bot.
The idea here is to not use a safe navigation operator in unnecessary chaining which may lead to confusion to the reader regarding the existence of the object instead use delegation.
NOTE: This is my first pr so if there is any suggestion please let me know thanks in advance :).