0%

Understanding language jargon to be a better programmer

In this article, I will use Javascript Jargons as an example.

A lot of developers or programmers(specially to the country where I came from), You and Me and mostly Junior to Mid-level developers have been through this. At some point in time we wrote codes that we barely know what it means as long as we know that it works the way we want it to be or even not in the way that we want (this will make us wonder why?).

Language Jargon

Consider the following:

1
2
3
4
5
6
var animal = 'dog'
function whatAnimal() {
console.log(animal) // undefined (not dog)
var animal = 'cow'
console.log(animal) // cow
}

You might wonder why line 3 is “undefined”, specially if your coming from other programming language. Like Java perhaps.

Here’s another one:

1
2
3
4
hello() // Hello there
function hello() {
console.log('Hello there')
}

The function hello() works even before it was declared.

In Javascript, this called Hoisting.

Hoisting

Hoisting in JavaScript means that variable and function declarations are moved to the top of their containing scope. Before your code is executed it will first be evaluated or compiled in Lexical Environment or the Lexing phase (this is another Jargon.. ;-). Which means that variables and function declarations are moved to the top of their scope, hence Hoisting.

I don’t want to go any further on explaining these Technical Jargons in Javascript (But there’s a lot more about hoisting), and so we can stick on our main topic.

Now, going back to the main topic. A lot of the developers these days ignore these Jargons or Terms in their respective programming language of choice (I am so guilty on this). Knowing if…else…, for…, while.., switch… (these are statements by the way) are not enough. Knowing all these Terms and Jargons will give you a better understanding of how things works and it will make you the better programmer in the process.

If your a javascript developer or insterested on using javascript. Here a couple to start with.