Skip to content

Make local variable name more expressive #464

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

Merged
merged 2 commits into from
Dec 26, 2015
Merged

Make local variable name more expressive #464

merged 2 commits into from
Dec 26, 2015

Conversation

nielsandriesse
Copy link
Contributor

It seems that element would also be more consistent with the documentation

@datwelk
Copy link

datwelk commented Dec 12, 2015

👎 I would argue that in this case ret is more descriptive than element.

@PatrickPijnappel
Copy link
Contributor

In any case, result or returnValue would at least be better than ret, which is unnecessarily abbreviated.

@gribozavr
Copy link
Contributor

I'd prefer result.

@dabrahams
Copy link
Contributor

I prefer element or nextElement. It tells you about the result's semantic role, rather than just its relationship to the method API

@dabrahams
Copy link
Contributor

Good naming is part of code quality. We care about the quality of the Swift source code. This may be far from the most important issue that we have to deal with, but it's still an improvement worth making.

@mrazam110
Copy link

Can you explain why it should be result instead of element?

@lattner
Copy link
Contributor

lattner commented Dec 26, 2015

This seems like a clear improvement over what is already there.

lattner added a commit that referenced this pull request Dec 26, 2015
Make local variable name more expressive
@lattner lattner merged commit 12e670a into swiftlang:master Dec 26, 2015
@nielsandriesse nielsandriesse deleted the patch-6 branch December 26, 2015 02:43
@kud1ing
Copy link

kud1ing commented Dec 26, 2015

Since the documentation says Advance to the next element and return it i think return next_element would be quite descriptive.

freak4pc pushed a commit to freak4pc/swift that referenced this pull request Sep 28, 2022
[run_sk_stress_test] update stress-tester xfails for master -> main rename and new issues
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants