8000 Made Peek() a computed property by codeOfRobin · Pull Request #294 · kodecocodes/swift-algorithm-club · GitHub
[go: up one dir, main page]

Skip to content

Made Peek() a computed property #294

New issue 8000

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 1 commit into from
Nov 20, 2016
Merged

Conversation

codeOfRobin
Copy link
Contributor

IMHO, making peek a computed property feels swiftier

IMHO, making peek a computed variable feels _swiftier_
@kelvinlauKL
Copy link
Member

Yep, I agree @codeOfRobin. I've been especially conscious lately of making any function that takes no parameters as a computed property instead. Good catch!

@kelvinlauKL kelvinlauKL merged commit c783351 into kodecocodes:master Nov 20, 2016
@hollance
Copy link
Member

I have a small comment on this. ;-) "peek" is a verb, which makes sense for a function. Properties should be nouns, not verbs. So if you're making this a computed property, then you might want to name it front or something like that.

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.

3 participants
0