Javascript is a type of programming language that was reportedly created over a weekend. With just a weekend, I think it is crazy how intricate and complex, yet simple and efficient it is! As my only prior experience with programming languages being primarily Java with some experience in C and C++, Javascript gave me the impression that it is an informal version of Java. For example, when declaring a variable in Java, you have to also specify the type of variable you are trying to declare. However, in Javascript, it is not required.
As I relate Javascript to a real world application in terms of comprehension, I relate it to Gen-Z texting, or internet slang. Oftentimes, newer generations create abbreviations to common phrases. For example, “LOL” means “Laugh(ing) Out Loud,” or “IDK” means “I don’t know.” This reminds me of Javascript because instead of calling a function with multiple lines when all it does is something simple, we can abbreviate it to a single line of code.
For example, this simple function from ChatGPT,
function myFunction() {
console.log("Hello World!")
}
can be abbreviated to:
const myFunction = () => { console.log("Hello World!") };
using JavaScript’s ES6.
Rather than typing the full function, we can put it into an “arrow function,” which is particularly efficient for simple and short functions.
Just like internet slang, there are advantages, but also disadvantages. While it’s easy, fun, and fast, misinterpretation errors can occur. Because Javascript doesn’t require types when declaring/creating a variable, it can commonly be mistaken for a different type and get confused further down the line. Such miscommunication can take a lot of time to find and fix. However, on the other hand, this little “shortcut” of not using types can also save a lot of time when planning and typing the code.
As stated in the introduction, JavaScript, to me, is the informal version of Java, just like internet slang is the informal version of formal or standard writing. This interpretation helped me comprehend the parts of Java I knew to the learning process of JavaScript. For example, learning about classes, functions, types, and loops is similar, if not the same, between Java and JavaScript. Although I do not know everything about Java, being able to better compare and relate the two helped me understand how JavaScript works.
Overall, I found Javascript to be very informative not only as a language, but also how it compares to other languages I’ve learned so far. I liked how the small fraction of what I learned is easily relatable to internet slang. I also hope I am able to do more comparisons in the future with future languages. I also enjoy how simple and effective it is for the coder themselves. I think it is ideal for short, simple programs and I agree when Professor Johnson said it has some really good things, but also a few really bad things. Overall, I see why it has stuck around since 1995 as it offers many useful features.