Practice makes perfect

22 Jan 2020

As we know, there are many different coding languages and they all have some similarities and differences with each other. In the past week, I have learned a language called javascript which is very easy to use. In my opinion, javascript is a beautiful language and it has some special attraction to me.

Advantage

The language I learned before are java, c and c++, so javascript is totally new to me. The first impression of javascript to me is that it is a very loose language. All variable can be initialized with var, for example, we can have var to replace string, int or other variable type.

var s = "this is a string.";
var i = 0;

Javascript has a significant difference from other languages, which is that objects are mutable in JavaScript. It is possible to add or delete properties to existing JavaScript objects.

var student = {
  "name": "Adam",
  "age": 20
};

student.gpa = 3.5;

The other important difference between javascript and other language I learned is that we can write a function very easily with ES6. Programmer can write a function in a few lines, which saves plenty of time for programmer.

Disadvantage

We can see that JavaScript is a convenient language but it may be too weak from software engineering perspective. In my opinion, this language is nice for programmer but also will have some disadvantages. For example, as I mentioned above, the properties of objects can be added the same way we modify them. If the programmer intense to modify a property but he happened spell the wrong property name, the program will not have error and create a new property with that wrong name. This is not the problem of JavaScript, but the programmer has to be more careful about it when coding with JavaScript.

Conclusion

Although JavaScript is not a perfect language, we still need to master it. The practice WODs is one of the ways to make me more familiar with JavaScript. Practice makes perfect. In order to master a language, what we have to do is practice. The counting time WODs gives me stress every class, so we will practice problems at home several times to make us familiar with solving problems. For me, I like WODs because it is a challenge for me and it can also help me to check how well I digest the knowledge I learned.