The objective of this research was to obtain get empirical data about some aspect displace code and mingle code, and describe factors which was happening of code switching and code mixing. This research represented qualitative method with content analysis technique by using sociolinguistics approach. Data collecting technique was done through observation, note book, internet, journal, related to research object especially sosiolinguistics science explaining about code switching and code mixing. From result of investigation, it was found out that there were some reasons why teachers did code switching and code mixing. They were: (1) teachers define again situation that have been mentioned previously redefinition to be student more is comprehending of intention from its utterance, (2) teachers try to liquefy class atmosphere which monoton by using displacing code and mingle code to evoke humorous impression, and (3) the teacher must reinforce his command (strengthen command) so that students better understand that what the teacher instructed must be followed. The social phenomenon that underlies many or at least cases of code transfers and code mixes in Indonesian language teaching is the level of language skills of the teachers who teach the language. The higher the language capability, the less cases of code change occur, and vice versa. Keywords: code switching, code mixing, teaching Indonesian language Daftar Pustaka Coulmas, F (ed). (2005). The Handbook of Sociolinguistics. USA: Blackwell Publishers. Blackwell Reference Online. Fasold, R. (1984). The Sociolinguistics of Society. Oxford: Basil Blackwell. Finegan, E. (2004). Language: Its Structure and Use. Massachussets: Thomas Corp. Hoffman, C. (1991). An Introduction to Bilingualism. London: Longman. Koentjono, D. (1990). Dasar-Dasar Linguistik Umum. Jakarta: Fakultas Sastra UI. Poplack, Shanna. (1980). Code Switching: Anthropological and Sociolinguistic Perspectives. Berlin/New York: Mounton de Gruyter. Rulyandi, Muhammad Rohmadi & Sulistyo, Edy Tri. (2014). Alih Kode dan Campur Kode dalam Pembelajaran Bahasa Indonesia di SMA. Paedagogia, 17(1), pp. 27-39. Saville-Troike, M. 2003. The Ethnography of Communication: An Introduction. Blackwell Publishing Ltd. Suwandi, Sarwiji. (2010). Serba Linguistik: Mengupas Berbagai Praktik Bahasa. Surakarta: Universitas Sebelas Maret Press. Wardhaugh, R. (2002). An Introduction to Sociolinguistics. Massachussets: Blackwell.