0

I am trying to find a name for a variable that contains the hostname (node45.service.com), the port (9984) and the server name (US Salami Server) of a service I want to connect to and looks something like this

class server_connection_configuration
     string server_name
     string hostname
     integer port

At the moment it's called server_connection_configuration. Is there a shorter alternative for that? It must encompass that it is a set of parameters that are needed to connect to a server. I understand that the server name does not really fit here.

I can't use server_connection because this implies that this would be the object that models the connection (a handle). I also can't use connection_configuration because in that context other connections exist as well.

I don't want to use abbreviations because it would contradict clean code principles.

What word(s) could I use instead?

I tagged single-word-requests but maybe there is a better tag for this question.

closed as off-topic by FumbleFingers, Jim, Hellion, Jason Bassford, Eilia Sep 4 '18 at 13:29

  • This question does not appear to be about English language and usage within the scope defined in the help center.
If this question can be reworded to fit the rules in the help center, please edit the question.

  • 8
    I'm voting to close this question as off-topic because it's asking for suggestions re the naming of programming variables and functions. – FumbleFingers Sep 3 '18 at 15:12
  • I don't see the problem, because I could rewrite the question to not have the variable but then it would be harder to answer imho. Yeah, it's a technical concept but the word could be used outside of programming as well imho. – problemofficer Sep 3 '18 at 15:15
  • 2
    Well, you try rewording the question so the expression you seek refers to some meaningful real-world concept outside your highly specific technical / programming context! If you can do that, I'll retract my closevote. – FumbleFingers Sep 3 '18 at 15:20
  • 2
    I actually think your name is clear enough as it is. Why not use it? It is a bit long, but not excessively so. (Unfortunately, asking for advice on naming things or variables is off topic on this site, sorry. The rules: english.stackexchange.com/help/on-topic) – Cerberus Sep 3 '18 at 15:25
  • @FumbleFingers I will do so, if more people agree that this question is too programming specific and the question gets closed. Imho the mere fact that I am looking for a variable name does not make this question off-topic to this site. If I were to ask how I could name a variable for the number of people who live in a city, then that answer would include the word "inhabitant" and this word is not limited to being used in programming. Imho you are applying the rule without considering why it was probably introduced in the first place. – problemofficer Sep 3 '18 at 15:30
1

Typically, hostname and port are combined with scheme to form a URL, so presumably you are using a library of some kind to send a message and receive a response. If so, the library will have some names to identify the parameters to be passed. It would be easiest just to use the library names.

For example, the Python requests package has a get(url) method where url is a string containing the scheme, hostname and port. In this case, you could call your class url_params.

Technically, if you have to provide a port number, your program is attempting to communicate with a program already listening on that port. So this can also give you a name.

Based on a quick Google search, port 9984 is associated informally with BigChainDB. There is probably a reference implementation of the BigChainDB client that can supply a name for your class. However, 9984 is not a well-known port, so maybe there is some other program. But the reasoning is the same.

If you want to use a class name that reflects the business logic as opposed to the implementation details, start with the word address and couple it with the business function being performed at that address.

0

How about ‘server address’? Similar in idea to a house address of ‘number-street-town’.

You could somewhere early in the document define that ‘server address’ denotes the concatenation ‘servername-hostname-port’ and then always refer to it as ‘server address’.

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