Skip to content

toggle: renamed toggle(showOrHide) to toggle(doShow) #654

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

Closed
wants to merge 1 commit into from
Closed

toggle: renamed toggle(showOrHide) to toggle(doShow) #654

wants to merge 1 commit into from

Conversation

burka
Copy link
Contributor

@burka burka commented Feb 16, 2015

To make it clear that passing true shows and passing false hides. Otherwise if you take showOrHide at its word, it would do nothing if you pass false and would call the regular toggle() if you pass true ;-)

@@ -24,7 +24,7 @@
</signature>
<signature>
<added>1.3</added>
<argument name="showOrHide" type="Boolean">
<argument name="doShow" type="Boolean">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure that doShow does this any better... How about setShown ?

Also maybe add a description in the <desc> tag specifying true will show and false will hide?

@gnarf
Copy link
Member

gnarf commented Feb 16, 2015

Thanks for the submission! Sorry that my showOrHide name was confusing to 😄

To make it clear that passing true shows and passing false hides. Otherwise if you take showOrHide at its word, it would do nothing if you pass false and would call the regular toggle() if you pass true ;-)
@burka
Copy link
Contributor Author

burka commented Feb 16, 2015

Glad if it clears things up. At least for me ;-) setShown or doShow both sound like the initiation of a action, both are valid to me and I think both would make it more clear. I have no definite opinion on that, so setShown is ok for me if you prefer it.

@gnarf
Copy link
Member

gnarf commented Feb 16, 2015

👍 Looks great, thanks for the quick update!

@AurelioDeRosa
Copy link
Member

IMHO doShow doesn't clarify the concept. doShow seems tied to the show concept only, and not that passing false hides the elements.

@scottgonzalez
Copy link
Member

How about makeVisible (or honestly, just leaving it as is).

@gnarf
Copy link
Member

gnarf commented Feb 17, 2015

I think the change to the description is important either way, what we call it doesn't matter that much to me, any name for that parameter is awkward.

@AurelioDeRosa
Copy link
Member

👍 for leaving it as is

@burka
Copy link
Contributor Author

burka commented Feb 17, 2015

The description should be changed in any case. Currently if you read it you might make the right guess, but you can't infer the meaning of the parameter from the documentation without reading the code snippet further down.

I think all alternates are a little awkward, but faster to understand than showOrHide. makeVisible might be a little better, just show might be a little better, doShow, setShown are both better than the current version and could be used until someone has a even better idea.

@gnarf
Copy link
Member

gnarf commented Feb 17, 2015

I like it as you have it for now. Going to merge it.

@gnarf gnarf closed this in 5615146 Feb 17, 2015
@burka burka deleted the patch-1 branch February 17, 2015 15:11
@kswedberg
Copy link
Member

Too bad. I agree that the description is better, but setShown is worse. It implies that the method will either show it or it won't, when what it really does is show it or hide it depending on its current state (hence the "showOrHide").

@AurelioDeRosa
Copy link
Member

I agree with @kswedberg. It wasn't an urgent fix, so we could have discussed a bit more.

@gnarf
Copy link
Member

gnarf commented Feb 17, 2015

I know we went back and forth on it when documenting it originally I think
'showOrHide' was my own suggestion, and I'm seeing problems with it now.
'set shown' felt better. Let's talk it over in an issue and come back to
it if needed?
On Feb 17, 2015 1:55 PM, "Karl Swedberg" notifications@github.com wrote:

Too bad. I agree that the description is better, but setShown is worse.
It implies that the method will either show it or it won't, when what it
really does is show it or hide it depending on its current state (hence the
"showOrHide").


Reply to this email directly or view it on GitHub
#654 (comment).

@gnarf
Copy link
Member

gnarf commented Feb 17, 2015

If you have opinions on what we should call this, please go to #655 - Thanks @burka for the submission (and starting this discussion inadvertently)!

@gnarf
Copy link
Member

gnarf commented Feb 17, 2015

Also @AurelioDeRosa I wasn't ignoring your "I liked it the old way" comment before the merge, I just didn't read it until after I had merged 😦 sorry

@AurelioDeRosa
Copy link
Member

Don't worry @gnarf, I wasn't complaining :)

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

Successfully merging this pull request may close these issues.

6 participants