Shall I define code switching for you?
Wikipedia defines it this way,
code-switching is the concurrent use of more than one language, or language variety, in conversation. Multilinguals - people who speak more than one language - sometimes use elements of multiple languages in conversing with each other. Thus, code-switching is the use of more than one linguistic variety in a manner consistent with the syntax and phonology of each variety. Well, its when a bilingual (trilingual or quad-lingual even) individual when speaking to another bilingual of the same two languages switch off from one language to another when conversing with one another.
This phenomenon fascinates me because I do this; and I do it ALL the time. Maybe I should rephrase the statement. "I have this BUG" or better yet, "I am a VICTIM of this ailment." Apparently, I am not the only one with this situation. There are more than a handful of people around me who exhibit the same symptom. But, the youngest of them all is my favorite 5 year old, little-Mr. Z. I was just helping little-Mr. Z with his Japanese homework (he did a fine job at it) and this is when I noticed his constant switching from English to Japanese.
Our conversation was something like this:
Little- Mr. Z (z): Sacchan (my Japanese nickname), kono shukudai (this homework), I don't wanna do it.
Me (s): z, yaritakunakutemo owarasenaitone. (we still have to finish it even if you don't want to do it.)
z: *sigh. Why do I have to do this?
(begin working on homework)
s: kore nani? (what is this? -while pointing at a Hiragana character)
z: I know! "Ki" Kirin no Ki! (It's "KI" KI for KIRIN (giraffe) )
What causes these switch from one language to another?
For the case of Little-Mr. Z, I believe there are three reasons.
1) Accessibility of the language
2) Discrepancy in vocabulary count between the languages
3) Innate cultural identification with words and phrases
In other words, he uses phrases that are easier to formulate. Some phrases are shorter and sweeter in English. Other phrases may have a better flow in Japanese. This allows us to see that our brain functions very efficiently even at the developing stage of five years-old (our brain is like a convenience store of words and phrases!). Another reason may be his lack of vocabulary. He tends to use words that he knows from whichever language that best fits the context. Little-Mr. Z, the smart guy, also inherently identifies and implements phrases that are inseparable from the respective language culture. For example, the last phrase about a giraffe, the phrase only makes sense in Japanese.
There are tons of other factors that trigger code switching..... it is definitely worth researching.