Quick Tips for Learning Javascript

Despite being one of the most widely-used programming languages on the web, JavaScript has a bit of a bad reputation. But the truth is, JavaScript can be an incredibly powerful tool for creating client-side and server-side applications.

JavaScript’s flexibility and ease of use have made it a popular programming language, but these benefits can also have drawbacks. Without strict typing and with many processes already abstracted, it can be easy to make errors in JavaScript without realizing it.

It’s as if you’re walking in a forest where it’s easy to take the wrong path without any warning signs or guidance. On the other hand, in other programming languages, the language itself acts as a guide, leading you to learn algorithms, data structures, and memory management, making it more difficult to lose your way.

Let’s dive deeper into the details.

Dynamic typing

JavaScript doesn’t have types. We can do whatever we want.

let value = 2023;

value = [ 1, 2, 3 ];
value.push({ firstname: 'John' });

value[2] = true;

value[3].firstname = function() {};

We can create and manage a variable however we like. Well, JavaScript allows us to do that, but it’s not something which will be beneficial for us or for the engine. This approach is problematic because when we use different types of values for a variable, we may lose track of its intended value over time. Additionally, the engine may not perform efficiently when constantly changing its understanding of the variable.

When learning JavaScript, it’s important to focus on avoiding this type of code. It’s not worth spending too much time trying to understand it since you’re unlikely to encounter it in real-world projects. Even if you do understand it, you may forget why it produces a certain result in the future.

{} + 12 + [] + true 

Later point in case you would like to have types like in any other programming language then you can use TypeScript.

let age: number = 18;

let fruits: Array<string> = [ 'Apple', 'Orange', 'Banana' ];

// ...

So it’s a myth and misunderstanding that in JavaScript we don’t have types and etc …

Built-in data structures

People who start learning programming via Java, C# or similar programming languages, tend to know about many things related to data structures, algorithms, strict typings and etc. Java offers built-in data structures like LinkedList, Stack, and Queue, while JavaScript does not.

It’s rare for instructors to begin teaching JavaScript with data structures and algorithms, as it’s often taught alongside HTML and CSS. As a result, some developers may lack fundamental programming skills when they start their careers, leading to negative perceptions of JavaScript in the industry.

Success hinges on choosing the right path.

It would be better to take a quick course about fundamental computers since and learn about basic data structures and algorithms.

Learning data structures and algorithms can be effectively done in JavaScript by implementing them through the use of Arrays and Objects. This approach can enhance our understanding of these concepts and allow us to practice them in real-world scenarios using JavaScript.

It’s not only for web

Although JavaScript was originally developed for use in web browsers, it has evolved over the years and can now be utilized in a variety of contexts. Today, it is widely used not only for client-side web development, but also for server-side programming, IoT, and more.

This is the key point which makes JavaScript so unique!

Multiple ways to achieve the same thing

If you are a developer who learned programming using other languages, you may find yourself wondering why there are so many similar tools available when working with JavaScript.

function -> function, arrow function, generator function
variable -> var, let, const
class -> function, class

It’s true that there are many different tools available to achieve the same thing in JavaScript. This can be attributed to the language’s history and standardization process, which allows for continual improvement year after year.

Initially, JavaScript was a fairly simple language that was primarily used in web development. As it became standardized under the name ECMAScript, the community began making proposals for improvements and new tools each year.

If you want to gain a comprehensive understanding of JavaScript and become a skilled engineer, it’s important to learn the language’s history and become familiar with its tools in a systematic order.

Summary

JavaScript is a truly powerful programming language that has been consistently improving every year. Its large and active community is a priceless asset. Although it may seem like some problems in JavaScript have complex solutions, the reality is that there is usually a simple answer that can be found by delving deeper into the language. However, due to its non-traditional nature, learning JavaScript may present some difficulties. In fact, at times, understanding the entire concept of the language can be challenging.

Post a Comment

Previous Post Next Post