1

I need to know if there is any other word which is equivalent to "hide/show". I am not actually looking for toggle.

  • Can you provide some context in which you want to use it? In some contexts, showing, then hiding something could be called flashing - yet in other situations that would be a completely inappropriate choice of words. – oerkelens Jul 25 '17 at 7:39
  • I want to name some function in software programming which does the hide/show job. But it does not do hide and show alternatively. It can be show, show, hide, show, show. – Amit Chigadani Jul 25 '17 at 7:48
  • 1
    As far as I know, in the context of software, you usually just see "Show/Hide" or "Toggle Visibility". – Dog Lover Jul 25 '17 at 8:06
  • @DogLover That's true, but you see there is no actual toggle, like I said in my previous comment. – Amit Chigadani Jul 25 '17 at 8:09
  • The closest I can think of is "on-off" - an adjective. You may also use "display" . E.g: function display(true) – Mustafa Jul 25 '17 at 8:47
3

Adding my comment as an answer. The comment thread above cleared up your question. Below is an adaptation of the comments I made to present a full answer.


I want to name some function in software programming which does the hide/show job. But it does not do hide and show alternatively. It can be show, show, hide, show, show.

There are still only two states and not many. In my comment above ( show, show, hide, show, show) I meant that those can be the consecutive results of an action at 5 different times.

It makes no sense to use a binary description (show/hide) for something that has more than two states (show/show/hide/show/show).

You're not just toggling visibility here, you're progressing along a list of preset visibility options. Those are not equivalent descriptions, and a method name should make a clear dinstinction here!

Your description very much reminds me of .MoveNext(), which is a method employed by enumerators that basically "jumps" to the next item in the list.

Jumping to the next item in a list is exactly what you are doing in this method, rather than changing a value. You are moving to the next item in a preset list, which may or may not change the value. Therefore, you can't definitively say that this method will change the visbility.

The key difference here is that a change in value inherently means that the value will change, whereas in your example it's possible to jump from "show" to "show", therefore not changing the value.
The same applies to words like "toggle" or "update", as they all inherently mean "change" in their own way.

However, every time the method is executed, the "current" item that is selected in the preset list does change (that is a guarantee). Therefore, the name of this method should focus on the change it actually creates, rather than the possible consequences of such a change.


Furthermore, I would generally describe the visibility of an object as a visibility state. This is analogous to established naming conventions in software development.


The most accurate description of your intended method, in my experience as a software developer, would be

MoveToNextVisibilityState()

This accurately describes what the function of the method is; which is the main focus of accurately naming a method.


Edit maybe this is a bit vague. Let me clarify with an example.

Consider Russian Roulette. The gun is only partially loaded, so whenever you pull the trigger, you don't know if a bullet will be fired or not. Whenever you pull the trigger, the gun tries to fire a round and then moves on to the next chamber (where a bullet may or may not reside).

Your suggestion of referring to the method as "show/hide" is the equivalent of calling the example method FireBullet().

My claim is that you cannot know whether or not a bullet will be fired; and therefore cannot call this method FireBullet(), since it's perfectly possible that no bullet will be fired and the method will still have worked as intended.

To explain the analogy: My claim is that you cannot know whether or not the visibility will be changed; and therefore cannot call this method ChangeVisibility(), since it's perfectly possible that no change in visibility will occur and the method will still have worked as intended.

Therefore, it is much more appropriate to call this method PullTriggerAndMoveToNextChamber(). Regardless of whether a bullet will be fired, you can conclusively say that the trigger will be pulled, and that the cylinder will advance to the next chamber.

To explain the analogy: Therefore, it is much more appropriate to call this method MoveToNextVisibilityState(). Regardless of whether the visibility will actually change, you can conclusively say that the list of visibility states will advance to the next item in the list.


Edit A small response I want to make. Although it is not needed for my above explanation, I do feel that this is the cause for why you are struggling to find a good name for this method.

I could have said it like hide,show,show,hide as well. So there are only two states(hide & show)

You are mixing two different things here. Are we talking about how many states are in the list of preset states; or are we talking about how many different values exist? Because those are two very different things.

Bob, Alice, Thomas, Bob, Thomas.

How many names are in this list? Five. Not three.

It would be correct to say that there are three distinct names in the list, but that is not the same as saying that there are only three names in the list!

I believe this to be the core of the issue you are currently faced with. You need to distinguish between the range of possible values and the preset list of values.
The list of values can have double entries. And as you have established yourself, it is important that a double entry is respected, and not ignored.

If it wasn't important, then we could reduce the list to simply show/hide. But that is not the case, as you have explained so yourself:

I want to name some function in software programming which does the hide/show job. But it does not do hide and show alternatively. It can be show, show, hide, show, show.

You have specifically refuted the idea that this list can be trimmed down to a list of its distinct values. Therefore, you are not just talking about the (range of possible) states, but rather a preset order of states (including double entries) that must be adhered to.

protected by tchrist Jul 29 '17 at 20:48

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged or ask your own question.