28 January 2020: Yale-NUS professor teaches Computer Science to students through the art of narrative discourse

By Kelly Ng 

Professor Olivier Danvy teaching a computer science class. Image by Yasunari Watanabe for Yale-NUS College.  

At Yale-NUS College, students interested in Information Technology or Computing have the opportunity to acquire foundational skills through courses offered in the Mathematical, Computational and Statistical Sciences (MCS) major.

In the course, Introduction to Computer Science, taught by Professor of Science (Computer Science) Olivier Danvy, the first two weeks of classes are dedicated to introducing students to the concepts and vocabulary of computing, starting with Aristotle and including ethics, and continuing with the computational analogue of language and thought. The course explicitly builds on the education dispensed in the Common Curriculum. “For example, take the critical skill of debugging (i.e., troubleshooting, in programming jargon), students are introduced to it as an instance of the scientific method, instead of as yet another ad-hoc skill, and that resonates a lot in the classroom,”
he said.

Professor Danvy believes that the study of computer science should not be confined to the digital world. Rather, he uses narrative discourse to foster the understanding of computer science concepts. Prof Danvy explained that narratives include “drawing data to represent information and becoming mindful of linguistic constructs, from lexical units to syntactic units to the underlying formal grammar and logic. Syntactically, a programme needs to be grammatically correct to be considered, and semantically, it needs to be type correct too, lest one adds apples to oranges, which opens the door to insecurities.” Such an approach to computer science, he highlighted, is hardly new. For example, the late Peter Naur, computer-science pioneer, Turing-award winner, and originator of the term “data science”, made his students write a users’ manual for each of the programmes they wrote.

Professor Olivier Danvy teaching a computer science class. Image by Yasunari Watanabe for Yale-NUS College.  

He added, “The use of narratives is critical here in that it makes the students aware that what they have learnt is useful since they can reuse it and that their knowledge is actionable. Students also emerge more secure of their knowledge. They don’t just realise, but also, appreciate that everything in computer science is logical and can be figured out”.

In his class, Prof Danvy tasks students to write reports that describe what is represented and why they chose to represent it this way. Students are encouraged to find their own voice and to make connections with their own growing culture, e.g., by identifying relevant materials outside the classroom and splicing it in as supportive or illustrative quotes. To this end they can also consult the writing peer tutors from the Yale-NUS’ Writers’ Centre.

Jonas Tan (Class of 2021), who has taken several of Prof Danvy’s courses, commented that writing reports helps him build a strong foundation and understanding of the tools used in computer science. “Nowadays, much of coding that’s taught in online courses and books involves the copying and pasting of code that can be found online. Although this solves your problems, it does not demonstrate understanding of the code or the solution. Explaining your code in a report forces you to think through your code line by line and always think of the bigger picture,” he shared.

Similarly, Sviatlana Yasiukova (Class of 2021), noted that while producing a full-fledged report every week was time-consuming, it helped her to actively engage with the material, make connections with other parts of the course and reflect on the larger significance of what she was learning.

For Jonas, this logical and structured approach towards problem-solving has proven to be of value to his other courses beyond MCS. He explained that writing narratives reinforces meta-learning (learning how to learn), because it teaches one how to break down a problem statement logically and efficiently. This skill can be applied to mathematics problems or essay questions in the humanities.

Citing an example from his coding internships, Jonas said he observed that there was often a lack of proper documentation of code. “Because no one is trained to communicate their code well, when someone else takes over, the transition process is messy and painful for many parties involved. By using the narrative-focused approach, students are trained to explain their problem-solving process and code well, especially since coding projects are now often done in teams rather than individuals.”

For Sviatlana, her biggest takeaway is learning that you can only solve the problem if you understand it and you can only understand the solution if you can explain it. “The adoption of such a learning method and standard has helped me immensely when working on research and presenting my findings”.

“The measure of one’s understanding is the clarity of one’s discourse”, said Prof Danvy. “This clarity gives Yale-NUS students an edge compared to pure computer-science students who have been exposed to a lot more computer science but to a lot less science and to no liberal arts at all.”

Finally, Prof Danvy pointed out that even for students who do not intend to pursue a career in computer science, understanding how computer scientists think and work will be beneficial for all; while some of our computer-science students may not do computer science themselves in the course of their career, for sure they will interact with computer scientists.