Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

minor changes to increase code's readability #82

Closed
wants to merge 1 commit into
from

Conversation

Projects
None yet
4 participants
Contributor

ashfame commented Sep 16, 2012

I improved the code's readability a bit.

$k + 1 conveys the meaning better than $k++ when we need to check for the next item from our current pointer. I actually got confused at first look & quite didn't get it what was going on, so thought this area could use some improvement.

@ashfame ashfame referenced this pull request Sep 16, 2012

Closed

Fixed typo #45

Contributor

jkudish commented Sep 16, 2012

The ++ syntax is actually fairly standard php for this kind of loop and used in many places through WordPress core. I don't think we should change this.

Contributor

ashfame commented Sep 16, 2012

Yes increment operators are fairly standard but I think $k + 1 better convey the sense that we are trying to access the next index of what we are on right now. It might be just a little bit of improvement but I don't see how it can hurt.

Contributor

kovshenin commented Sep 17, 2012

I like the multiline code to get_children, though the ))); at the end should have more spacing: ) ) ); Not sure about $k, and honestly $k + 1 might make it even more confusing than $k. $next = $k + 1; could work, but I'd spend some more time thinking about how the whole approach could be improved.

Contributor

mfields commented Dec 29, 2012

I modified the spacing in the image query here I think that ++ is totally fine and this part has been left intact.

@mfields mfields closed this Dec 29, 2012

@ashfame ashfame deleted the unknown repository branch Jan 4, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment