DEV Community

Cover image for Coding? Languages? Which to Pick?
The Nebula Developers
The Nebula Developers

Posted on

Coding? Languages? Which to Pick?

Continuing from last week, we at Nebula Developers aim to answer this burning question:

Out of so many programming languages, which one do we learn and master first?

If you’re new: Hi! In this series of articles, we will analyze the top ten coding languages. Through dissecting their pros, cons and their overall purpose, we will make our recommendations such that you can learn the best language for you

Like always, the best programming language for you will always be related to your purpose. Are you coding to make games? Or do you want to make websites? Maybe you want to be a data analyst?

This week we are doing a deep dive into the world’s infamous coding language:

Javascript

This coding language is the ultimate language when it comes to web development. Do you want a frontend programming language? Javascript. What about the backend? Javascript. Trying to show graphs on your website? Javascript. Creating useful API (plug-ins) for your website users? Javascript is your man. To summarize, Javascript is used for:

  • Front-end Development
  • Back-end Development
  • Data Visualisation
  • APIs

The main benefit of learning Javascript is that it is extremely useful. Come on, all of us here would have used a website in their lives. Heck, you’re reading from one right now! So it comes with no surprise that Javascript is extremely useful in terms of a coding language. Theoretically, if you don’t count HTML or CSS as a programming language, Javascript is the only programming language you’ll need to code an entire website.

Another benefit is its immense popularity. While Python has many modules to import from, Javascript takes that to the next notch. Besides the many imports that its developers have, it also has an array of frameworks to choose from Vue.js to Next.js. Within these frameworks, there are thriving communities that continuously improve while helping each other. So if you’re learning a framework for the first time, don’t be afraid to ask for help!

Now, let’s go through its flaws. Starting with how Javascript mostly uses an Object Oriented Paradigm which has a higher learning curve when compared to other simpler ones. As a newcomer, this may cause lots of confusion when trying to pick up a language for the first time. For example, let say this is the first time you’re learning javascript, all is going well until you see this:

class Person {
  constructor(name, age) {
    this.name = name;
    this.age = age;
  }
  sayHello() {
    console.log(`Hello, my name is ${this.name} and I am ${this.age} years old.`);
  }
}
const person1 = new Person('Alice', 25);
const person2 = new Person('Bob', 30);
Enter fullscreen mode Exit fullscreen mode

To explain it simply, we are creating a new ‘object’ called a Person who has two properties called name and age. In it, they also have a ‘method’ called sayHello() where they will say the string “Hello my name is {their name} and I am {their age} years old’. The last two lines just create two of such objects with the names ‘Alice’ and ‘Bob’.

Confused?

Yeah, this is a big portion of Javascript where you would need to interact with objects and use it to its fullest potential. Problem is that OOP has a high learning floor because for one to learn it, they must understand abstraction and encapsulation which are difficult concepts to learn for a beginner.

Another problem is how it is weakly typed. Previously we discussed how dynamically typed causes a variable to be overridden if there’s another variable with the same name as it. But this is a little different. In programming, data types are the types of data that are present in your code.
Some common examples are int (numbers), str (words), boolean (True/False).

Dynamically typed refers to how variables can change their types and be overridden in the later code. While weak typed refers to how different data typed variables interact with each other which causes a lot of confusion. Take this for example:

“123” - 1

Usually in other programming languages, since they are different data types (first one is a word while the other is a number), it will produce an error. However, Javascript allows this interaction by making the string into a number, the output is instead 122 (a number) Now try this:

"123" + 1

If you guessed 124, you are sadly wrong. The actual answer is instead “1231” treating the number as a string and combining both of them together. These are just some of the many quirks with Javascript which could cause various problems when trying to code. It also doesn’t have static typing, which is used to ensure that variables are only of a certain type. It was so bad that they made a new language called Typescript to fix this problem.

Finally, another critical flaw with Javascript is how it handles errors. Unlike how a standard error message, javascript code can fail on its own and not be noticed. THis can be catastrophic later on in the project where a single error causes the whole website to fail.

In my personal experience, I don’t really like Javascript. I thought it was too confusing and overwhelming for me to learn with the number of frameworks there are. But if you are a passionate web developer, you must eventually learn this language for the front end at least.

If you enjoyed reading so far, do consider joining us at The Nebula Devs. We are a passionate community of aspiring developers and graphic designers. Joining us will allow you to have a friendly environment where you can nurture, learn and grow. We will also have several paid services such as web development and discord bot development.

Click here to join our discord!

Conclusion:
If you want to build and design websites, I highly recommend picking Javascript as your first language before moving onto Typescript. Its overwhelming popularity and prevalence in the web development industry are nothing to scoff at. However, the weak typing, error handling and object oriented paradigm would be a difficult challenge to overcome.

Regardless, if you had enough of Javascript’s quirks, you could always switch to Typescript and continue your web development journey!

Top comments (3)

Collapse
 
kaamkiya profile image
Kaamkiya

JavaScript is the weirdest language when it comes to operators ('123' - 1).

Just look at this!

Image description

Collapse
 
glntn101 profile image
Luke

Great article, thank you!

Collapse
 
thenebuladeveloper profile image
The Nebula Developers

Hey! Thanks!