P90X Javascript edition.

30 Aug 2018

Java on Steroids

Having done in Java for the past two semesters, the transition to another language, namely JavaScript, has been a lot smoother than expected as opposed to learning it without any programming experience. Knowing basic programming essentials such as declaring variables, forming loops, creating arrays, creating functions, etc. has proven useful when transitioning to another language. In fact, it seems as if JavaScript is Java on steroids; in Java, you had to specify the type of each variable and the return type of a function while in JavaScript, you use let, const, var to declare variables and you do not specify the return type when making functions. For now, I see JavaScript as more convient compared to Java because the latter seems more strict about variables and syntax.

Access Levels, Syntax, Strictness

To show some examples, in Java, you can specify the access level of your code: public, protected, private. Each can affect how your classes interact with each other; for instance, when a function is modified as private, only the class containing such function is able to call it. In JavaScript, however, you do not use such modifiers.

For instance, when making a function in JavaScript:

function myFunction(myParam) {
  //my code
}

While in Java, writing a function would look like this:

public int myFunction(int myParam) {
  //my code
}

You notice that JavaScript seems very conservative and a lot cleaner when you look at it. Java, on the other hand, wants you to write a couple more words, otherwise it will constantly nag you. Speaking of which, Java does feel restrictive in terms of its syntax. For example, it requires you to tell what type a variable is before declaring it such as int, float, String, etc. whereas in JavaScript, you declare them using var, let, and const.

Javascript:

var foo = 0;
let bar = "";
const fooBar = 3.14;

Java:

int foo = 0;
String bar = "";
static final double fooBar = 3.14;

Overall, JavaScript somewhat feels less constricted compared to Java. One might think this is an advantage for the former over the latter, but I personally think it is just a property that differentiates them both, not necessarily a good or a bad quality. Some might prefer a language that is somewhat more detailed like Java (in terms of syntax) while others prefer more freedom in their codes. Nevertheless, I am very intrigued and eager to learn more about JavaScript and identify its key differences with Java.

Workout of the Day

As for the workout of the day (WOD), they seem to push the students to find solutions in faster and more efficient ways. The timed practice WODs are essential tools not only to practice for class assessments but also to improve our critical thinking and problem-solving skills. It almost feels like I am on the P90X workout program, and it will probably be a tough and gruelling schedule that could potentially yield great results, depending on my concentration and determination to improve. Overall, the teaching style is meant to get students out of the comfort zone, and I do agree that this is a fundamental aspect of deliberate practice. Nevertheless, it is definitely intersting to see my results as I challenge myself through these WODs.