Should the visitor carry any letter from this friend (who, let's say, is a non-native and holds the same passport as the visitor) but is on say a Tx visa in the UK?
I suggest not, for the reasons given by @Kate Gregory. (ie I too have never been asked for proof even when asked where I was planning to stay.) In any case, it is usually only the first night's accommodation that seems to be of interest (in my experience). In other words, I have no real idea why the question is even asked, other than to be sure the reply is not "on the street" and in general to judge your demeanour.
If you feel exposed without some paperwork, I suggest a copy of the contract between the landlord and your friend would be adequate. If your accommodation were an issue Immigration could then contact your friend to confirm her/his permission and already have evidence that s/he has accommodation to offer you.
Perhaps some indication is when a friend of mine was asked about accommodation (though not in UK) where he had none planned. He was about to be turned back but, thinking on his feet, said his friend (who had by then cleared Immigration) held the address. He was allowed to find 'his friend', looked up a hotel in the Yellow Pages, returned with that address - and was allowed through.