In contrast to code-switching as an unmarked choice, codeswitching is marked when it does not conform to expected patterns.

-Marked switching may be used to increase social distance, or to express authority, as in the example below where a salaried worker on a visit to his home village switches from the local language, Lwidakho, to Swahili and then English when talking to a farmer who wants to borrow money.
Myers-Scotton notes that this exchange takes place in a rural bar. The farmer speaks Lwidakho and perhaps a little Swahili. The worker comes from the same area, but is working in an urban center away from home. Until this point, the entire conversation has been in Lwidakho, which would be the unmarked choice in this context. Swahili and English are marked choices. Myers-Scotton comments that they are no doubt used here because of their association with authority, but that, importantly, their usage also has a shock value because this departs from the expected.
-What is the function of code switching here?

The function of code switching in this context is to create social distance and express authority. By switching to Swahili and then English, the salaried worker is positioning themselves as more knowledgeable and higher in social status compared to the farmer who only speaks Lwidakho. The use of these marked languages also adds a shock value and departs from the expected, further emphasizing the worker's authority.

The function of code-switching in this scenario is primarily to establish social distance and express authority. The salaried worker switches from the local language, Lwidakho, to Swahili and then English when talking to the farmer who wants to borrow money. This deviation from the expected language choice serves to surprise and possibly intimidate the farmer, as Lwidakho would have been the unmarked choice in this rural context. Using Swahili and English, which are associated with authority, helps the worker assert his position and increase social distance between them.