E10: Reflect on Javascript 1
For the first week, we learned the base of Javascript. It is my first time to learn Javascript but It has good modul and practice opportunities. In addition, it has similar construction to other languages. So some parts were a little difficult, but I was able to understand most of the basics. I’ll explain the difference and the similarities.
I learned Java first and C last year. These two languages are very different. For example, these codes are printing out “Hello World” in Java(above),C(below)
public class HelloWorld {
public static void main(String[] args) {
System.out.println("Hello, World!");
}
}
#include <stdio.h>
int main() {
printf("Hello, World!\n");
return 0;
}
Java needs to set a class and some arguments that are the template of Java in first and second line before print, but C language is setting only the integer. In contrast, Javascript also has a different set up for the first sentence. These Javascript codes are the same condition as above.
console.log("Hello, World!");
function() {
// some code
console.log("Hello, World!");
};
It has only one sentence but Javascript has often begun function calls.The syntax and structure of each language different for the same essence. But The four arithmetic operations and loop structures are very similar in each language. So I think It will be easier if we learn these languages.
For learning programming code, it is very important to practice constantly. In my class it has WODs(Workout Of The Daily), it is practicing writing code for a given subject within a set time. It was very hard to complete in the limited time I often get DNF that is too long to complete writing. However, I have never had such a hard practice before, it is very mentally draining but this practice trains my writing code skill and I find it very interesting when I am thinking about it and the code I wrote is right.