What is diglossia,code-switching,pidgins,bilingualism,creoles,lingua francas,vernucular,speech act,language acquisition device.shortly please
You asked for a short answer but your question has many pieces to it. So I will aswer a portion only. If you like what I answer, perhaps you can reword your question.
Code switching occurs when someone uses two different languages or dialects when speaking. Let's take for example someone who speaks Spanish and English and who is speaking to another person who also speaks both these languages. Person "A" can carry on a conversation and use English words and Spanish words in the same breath so to speak. Sometimes this occurs without even concious thought. Please note that I am not talking about person "A" saying something as simple as, "I think I'll have a taco for lunch." This is not an example of code switching. This is just a forgein word that has universal understanding in English so it is accepted without translation.
No, code switching is deeper. Back to my earlier example. Person "B" in this example above would have no difficulty understanding what person "A" is saying simply because they too speak both languages. This type of mixing of two languages can continue as long as both people understand one another. It should be noted that this type of speech is generally considered unacceptable and reserved for the more uneducated populous.
A comical look at code switching that takes place with monolingual people who send a lot of text messages and what happens with these heavy texters. They become so used to their abbreviations during texting that they forget others may not understand them. They may even submit classwork in "text-eese."
Clearly they understand what they are saying but their teachers may not and understanding is interrupted. This code switching in this case is not acceptable as it inhibits communication.
So my point is, code switching can be common, but the down side is it can prevent easy communication.
Hope this helps with part of your question.