Saturday, February 10, 2018

Syntactic Interference

In second language acquisition research, there is a concept known as interference. The core idea is fairly simple and refers to the influence that one known language has on the use of another for a person who speaks multiple languages. Having a "foreign accent" may be an obvious example of interference on pronunciation, but there can also be syntactic interference (influence on grammar) lexical interference (influence on words).

This same phenomenon can be seen in programming languages. Subtle variations in function names or usage can be sources of interference, such as R's head(df)versus Pandas df.head() or Python's len()versus R's length().  There are also more global issues such as how one expresses their intentions over several lines of code. Just as it is possible to make yourself understood in another language even if you don't phrase things the way a native speaker would, one can write working code which is regarded as "not Pythonic" by an expert programmer. 

Perhaps this explains why my code sometimes feels like gibberish.   

No comments: