Introduction
This hypothesis is an offspring of a conversation between me and a buddy of mine, Devin Leamy. The conversation started with why people are comfortable with certain programming languages and why it is hard to migrate to a new programming language / framework.
The conversation naturally shifted to an exploration of human languages, bilingualism and how people learn spoken languages and eventually the both of us reached a profound insight into how programming languages define and shape our views of the world. The following blog post is a sliver of an exploration of this hypothesis
Sapir-Whorf and Origins.
The Sapir-Whorf Hypothesis (aka the Linguistic Relativity Hypothesis) is a hypothesis that states that the structure of a language influences the way in which its speakers conceptualize the world. The hypothesis was developed by Edward Sapir and Benjamin Lee Whorf.
For example, Australian aboriginals do not have words for relative directions like left and right. So if they wanted something from my right hand they would say "Give me that thing in your north-east hand". At any time, they will use cardinal directions to describe the position of an object. Hence, they must have an internal "compass" that is always congizant of true north, consequently making them exceptional navigators.
This even extends to time and social dynamics as well. My favourite sci-fi movie of all time is Arrival and one of its themes is how language shapes our perception of time. Non-linear orthography warps our understanding of past and future.
You can learn more about Linguistics and Sapir-Whorf here
The Next Step.
We thought that there surely must be an extension of this hypothesis to programming languages. After all, programming languages are not meant for the computer, they are meant for humans. So just like spoken languages, these are human constructs meant to communicate ideas and actions. We express these ideas and actions through our programming languages and we have tools like compilers and interpreters to translate our ideas into something the machine works on.
Just like spoken languages, we are taught the correct use of a programming language. We are taught the syntax, the semantics and the idioms of a programming language as well as the best practices. We are taught the "right" way to use a programming language. However, there is still much debate as to whether all language abilities is learned or whether we possess an innate ability to learn language.
Given these parallels, we thought that there must be a way to apply the Sapir-Whorf Hypothesis to programming languages. Some fundamental questions that we might ask are:
- Does the programming language we use influence the way we think about problems?
- Why do some people prefer one programming language over another?
- Why is it hard to migrate to a new programming language?
- Does learning two language at the same time influence the way we think about the world (just like bilingualism)?
The Leamy-Moraes Hypothesis
The Leamy-Moraes Hypothesis effectively states that
The programming language paradigms you are most comfortable with is representative of your view of the world.
For example, people who are most comfortable with Java would design a CarEngine as follows:
public class Engine {
private boolean isOn;
public Engine() {
isOn = false;
}
public void start() {
...
}
...
}
// Car class
public class Car {
private Engine engine;
public Car() {
engine = new Engine();
}
public void startCar() {
engine.start();
}
...
}
This might reinforce the creators view that the world can be defined as monolitic yet malleable objects with causal relationships with one another.
Someone most comfortable with Javascript and React might define the same Engine as follows :
import React, { useState } from 'react';
// Engine component
const Engine = () => {
const [isOn, setIsOn] = useState(false);
const start = () => {
if (!isOn) {
console.log("Starting the engine.");
setIsOn(true);
} else {
console.log("The engine is already on.");
}
};
...
return (
...
);
};
// Car component
const Car = () => {
return (
<div>
<h2>Car Dashboard</h2>
<Engine />
</div>
);
};
// Usage
const App = () => {
...
};
export default App;
This might reinforce their outlook of the world being a cyclical state that can continually be updated and changed by actors.
With this we can segue into the preference of programming languages. Everybody has a different story, a unique belief system, a unique set of actions (almost like an agent in Game Theory). I believe people gravitate programming languages whose paradigms most closely align with their stories.
The Barrier to Shift
Why is it hard to migrate to a new programming language?
Some programming languages are closer together paradigmatically than others. For example, it is easier to migrate from Java to C# than it is to migrate from Java to Haskell. The shift to learning a new language is harder when you break the mold of your current paradigm. You have to force yourself to adapt to a novel means of expressing your ideas. It is possible however. But just like a new spoken language, a new programming language quite literally rewires your brain.
Being proficient in two languages can help you leverage some concepts and 'meta' from one language to another. We might even unconsciously borrow concepts from one language to another.
Conclusion
This is a very rough draft of the hypothesis and maybe in the future I will explore this further. For now this is all I could come up with.