0

I'm trying to find a single word that can describe the process of connecting or disconnecting a cable to a testing machine. This concerns the name of a function in a software program I am working on. The function accepts a true/false value which indicates to the user if they should connect or disconnect a specific cable.
Currently I have called it MoveCable() but this isn't an ideal name for it. I also want to avoid a name such as ConnectDisconnectCable(). Any suggestions?

13
  • There is "attach" and "detach", but I don't know of any word that could mean either. What purpose would the word serve if people didn't know whether it meant on or off? You could do CableConnected or ConnectCable yes/no.
    – TimR
    Commented Apr 2, 2015 at 20:58
  • @TimRomano It's not so much the word, but the name of a process, the outcome of which should be known to the user before initiating it. I understand it's for Java Programming language. Commented Apr 2, 2015 at 21:02
  • If it is an instruction to the user: ConnectCable: yes or ConnectCable: no.
    – TimR
    Commented Apr 2, 2015 at 21:03
  • 2
    How about SetConnectionState()
    – Jim
    Commented Apr 2, 2015 at 21:20
  • 1
    It's a good question and should not be down-voted. Outside of code, is there such a word? With a switch, we can say "toggle", whether the switch is currently set to on or off.
    – bobro
    Commented Apr 2, 2015 at 21:22

2 Answers 2

0

This isn't really about English Language, but about computing practice.

When naming variables, clarify is the most important thing, far above brevity. With modern IDEs you only ever have to type a function name once - the auto-suggestion system will regenerate it all the other times. SO even if you found a short but obscure word that meant 'to connect or disconnect', using it would undoubtedly be more confusing. Assuming that the intention is that calling the function causes the cable to be changed from connected to disconnected or vica versa:

  • setConnectedState(boolean)

is your best bet or

  • setCableConnectedState(boolean) if it isn't obvious from context what is being connected.

  • setConnected(boolean) (or setCableConnected(boolean))

would also work.

  • setConnectedOrDisconnected(boolean)

is clearer about what is being changed, but it isn't immediately obvious which way 'true' and 'false' are to be interpreted.

1
  • I like SetCableState() or SetCableConnectedState(). I guess if there was a word to "toggle" a cable the same way we can toggle a switch someone would have mentioned it by now.
    – valsidalv
    Commented Apr 3, 2015 at 2:47
0

How about CableConnectionStatus() or CableStatus() or ConnectionStatus() ?

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .