<em>This study investigates, through a qualitative approach, code-switching practices of young Moroccans in their Facebook interactions. The purpose behind this research is to analyse the functions of code-switching in Facebook comments, that were extracted from 30 Facebook accounts, and find out whether the choice of switching between languages is a conscious act that serves certain communicative functions, or it is a random choice made by young Moroccan Facebook users to compensate for a linguistic incompetence. Functions were coded and analysed using a grounded theory. Results achieved through the analysis of code-switching functions that occurred in the participants’ Facebook comments revealed that code-switching appeared, mainly, to serve notions of quotation, addressee specification, availability, principle of economy, indicating emotions, clarification, emphasis, habitual expressions, creativity and euphemism. Therefore, code-switching in young Moroccans’ Facebook comments is considered as a communication strategy that aims at enhancing their interactions in Facebook and making them more fluid and vibrant.</em>