It's Like Python But: Towards Supporting Transfer of Programming Language Knowledge

by   Nischal Shrestha, et al.
NC State University

Expertise in programming traditionally assumes a binary novice-expert divide. Learning resources typically target programmers who are learning programming for the first time, or expert programmers for that language. An underrepresented, yet important group of programmers are those that are experienced in one programming language, but desire to author code in a different language. For this scenario, we postulate that an effective form of feedback is presented as a transfer from concepts in the first language to the second. Current programming environments do not support this form of feedback. In this study, we apply the theory of learning transfer to teach a language that programmers are less familiar with--such as R--in terms of a programming language they already know--such as Python. We investigate learning transfer using a new tool called Transfer Tutor that presents explanations for R code in terms of the equivalent Python code. Our study found that participants leveraged learning transfer as a cognitive strategy, even when unprompted. Participants found Transfer Tutor to be useful across a number of affordances like stepping through and highlighting facts that may have been missed or misunderstood. However, participants were reluctant to accept facts without code execution or sometimes had difficulty reading explanations that are verbose or complex. These results provide guidance for future designs and research directions that can support learning transfer when learning new programming languages.



page 3


Catalogs of C and Python Antipatterns by CS1 Students

Understanding students' programming misconceptions is critical. Doing so...

Retrofitting Parallelism onto OCaml

OCaml is an industrial-strength, multi-paradigm programming language, wi...

Quantifying the Impact on Software Complexity of Composable Inductive Programming using Zoea

Composable inductive programming as implemented in the Zoea programming ...

Toward a Theory of Programming Language and Reasoning Assistant Design: Minimizing Cognitive Load

Current approaches to making programming languages and reasoning assista...

Lowering the learning curve for declarative programming: a Python API for the IDP system

Programmers may be hesitant to use declarative systems, because of the a...

PyDraw: a GUI drawing generator based on Tkinter and its design concept

The emergence of GUI is a great progress in the history of computer scie...

Modeling Creativity: Case Studies in Python

Modeling Creativity (doctoral dissertation, 2013) explores how creativit...
This week in AI

Get the week's most popular data science and artificial intelligence research sent straight to your inbox every Saturday.

I Introduction

Programmers are expected to be fluent in multiple programming languages. When a programmer switches to a new project or job, there is a ramp-up problem where they need to become proficient in a new language [sim1998ramp]. For example, if a programmer was proficient in Python, but needed to learn R, they would need to consult numerous learning resources such as documentation, code examples, and training lessons. Unfortunately, current learning resources typically do not take advantage of a programmer’s existing knowledge and instead present material as if they were a novice programmer [loksa2016programming]. This style of presentation does not support experienced programmers [berlin1993] who are already proficient in one or more languages and harms their ability to learn effectively and efficiently [kalyuga:expertise].

Furthermore, the new language may contain many inconsistencies and differences to previous languages which actively inhibit learning. For example, several blogs and books [burns:inferno] have been written for those who have become frustrated or confused with the R programming language. In an online document [arggh], Smith lists numerous differences of R from other high-level languages which can confuse programmers such as the following:

Sequence indexing is base-one. Accessing the zeroth element does not give an error but is never useful.

In this paper, we explore supporting learning of programming languages through the lens of learning transfer, which occurs when learning in one context either enhances (positive transfer) or undermines (negative transfer) a related performance in another context [Perkins:transfer]. Past research has explored transfer of cognitive skills across programming tasks like comprehension, coding and debugging [pirolli:transfer, kessler1988transfer, pennington1995transfer]. There has also been research exploring the various difficulties of learning new programming languages [Scholtz:subsequent, quanfeng] and identifying programming misconceptions held by novices [kaczmarczyk2010identifying]. However, limited research has focused on the difficulties of learning languages for experienced programmers and the interactions and tools necessary to support transfer.

To learn how to support transfer, we built a new training tool called Transfer Tutor that guides programmers through code snippets of two programming languages and highlights reusable concepts from a familiar language to learn a new language. Transfer Tutor also warns programmers about potential misconceptions carried over from the previous language [Fix].

We conducted a user study of Transfer Tutor with 20 participants from a graduate Computer Science course at North Carolina State University. A qualitative analysis on think-aloud protocols revealed that participants made use of learning transfer even without explicit guidance. According to the responses to a user satisfaction survey, participants found several features useful when learning R, such as making analogies to Python syntax and semantics. However, participants also pointed out that Transfer Tutor lacks code executability and brevity. Despite these limitations, we believe a learning transfer tool can be successful in supporting expert learning of programming languages, as well as other idioms within the same language. We discuss future applications of learning transfer in other software engineering contexts, such as assisting in code translation tasks and generating documentation for programming languages.

Ii Motivating Example