Many researchers have noticed that instructors who teach English as a foreign language (EFL) in language-learning institutions worldwide frequently implement code-switching (CS). Through this study, we investigate the functions of CS, specifically topic-switching, affective, and repetitive functions, as a pedagogical tool in an English for Specific Purposes classroom. The study is based on the perceptions of lecturers and students from two higher education institutions, Digital Colleges and Yanbu Industrial College, in Saudi Arabia. A quantitative research design was employed, with data collected through a questionnaire. The study incorporated a sample of 24 female EFL lecturers and 193 Saudi female students. The results indicate that both groups acknowledge using CS for topic shifting, with students displaying slightly higher acceptance. Additionally, both lecturers and students recognize the affective aspects of code-switching, with the students exhibiting greater agreement. Furthermore, lecturers and students agree regarding clearly identifying all repetitive functions. The study highlights the potential of CS functions as an educational tool to enhance interaction between EFL lecturers and students, encouraging engagement, cooperation, and academic achievements. It also underscores the significance of determining appropriate functions for various circumstances and shows that although acceptance may differ, there is general agreement on the various purposes for which CS is utilized in the EFL context.