Answer, result, answer, which is better?

I am refinancing some client-server code and it uses the terms Response, Result and Reply for the same thing (response from server). And while it's not really that important, it's hard to guess which word to use when writing new code, so I would like to combine the three terms into one and refactor accordingly, but I'm not sure which word is "better" if there is one. thing.

Any suggestions based on precedence and naming standards for this case?

+1


source to share


4 answers


The answer and the result should be ok, because they can be abbreviated to "res".

Whereas the answer would be "rep", which is ambiguous with repetition.



Maybe just follow HTTP, name them request and response.

+1


source


Answer!



The server responds ... The
person responds ...
You get the results ...

+3


source


Response

... Result

lacks the connotation of the answer (we are talking, for example, of simple "function results"). Reply

has the problem that it is both a noun and a verb. So that Response

is the clearest.

+1


source


If you want to stick to standard ISO / OSI terminology, this is either Indication or Confirmation. For an unconfirmed service, the initiator of the communication issues a Request "Request" (requesting data transfer to the other side), which is delivered to the other side as an "Indication". For an asserted service, the recipient of the pointer will respond with a Reply, which will include data to return to the originating party. This data will be presented on the other side as "Confirmation".

The data contained in the Confirmation indicates how the communication went (i.e. we sent a request and received a response). This can be called the result.

0


source







All Articles