Skip to content
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

More readable get function. #51

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

tothimre-zz
Copy link

The code is easier to read, for further contribution.

@fjorgemota
Copy link
Owner

Hey.

Sorry for the slow response, I'm quite busy with another project and didn't saw this pull request.

I was reading the changes you made here and they look quite...redundant, I mean, you're avoiding totally the use of else blocks (which are quite readable already in my opinion) and adding a lot of redundant checks that just don't feel....right (I mean, they are exactly what the else blocks already check itself, and in your code it is totally unnecessary).

Just to mention an example, if isItProtected is true, you already return the item just when it enters the if block in line 68, so you don't need to check again if isItProtected is false (by using !isItProtected, obviously) in the lines below because it is already obviously false.

Right now, I don't see a good reason to accept this pull request. I could say that you can just avoid a lot of if and else blocks by doing something similar to Pimple's get implementation, which does a lot of checks on the first if and doesn't use else blocks too..So feel free to update your approach if you want.

Anyway, thanks for the pull request, and I hope the review is good enough for you and that I explained the point well.

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