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?
2 Answers
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.
-
I like
SetCableState()
orSetCableConnectedState()
. 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. Commented Apr 3, 2015 at 2:47
CableConnected
orConnectCable
yes/no.ConnectCable: yes
orConnectCable: no
.