Javascript - A Programming Language That Has a Good Intuition

19 Jan 2018

According to an article by PsychologyToday, a famous digital magazine for human psychology, intuition is defined as “Intuition is a process that gives us the ability to know something directly without analytic reasoning, bridging the gap between the conscious and nonconscious parts of our mind, and also between instinct and reason.” In other words, it is the ability to identify something without the need of it being evident. I believe that Javascript has this ability. It has a good intuition because it knows what the programmer wants without he/she coding everything plainly. A good example for this ability is in identifying data types (String, integers, boolean, etc.). For many other programming language, such as Java, the programmer would have to tell the compiler what the data type of the variable is, in order for the codes to be executed successfuly. However, the same thing does not happen in Javascript, this language “intuitively” knows what the programmer wants based on the input of the variable. The difference between the two are shown below:

In Java:

int x = 123; // x is a number
boolean x = true; // x is a Boolean
String x = "hello"; // x is a String

In Javascript:

let x = 123; //x is a number
let x = true; // x is a Boolean
let x = "hello"; // x is a String

As shown in the code above, Javascript understands what the programmer wants based on the input, while Java requires the data types to be explicitly stated.

Because of its intuition, programming Javascript is much more intuitive for me. I cannot help but feel this is a much more “modern” programming language.

The experience I have been getting in class helps me to enjoy this programming language more. I get to use the language to solve all the programming challenges in projectEuler website. Since I have done a lot of the challenges in Java before, having to do them again in Javascript helps me to see the difference between the two languages. I cannot wait to get better at Javascript as I will have a lot of oppurtunities in this class to use it to develop cool things.