JS - Functional yet Narrow

30 Aug 2023

Introduction

JavaScript is like the friend you have who is always down for anything. As a programming language, it works flexibly as needed, letting you bend it to your will in ways other languages resist.

Structure

To me, JavaScript feels like a functional, but imperfect fusion between Python’s looseness and Java’s structure. It embraces dynamic typing like Python, so you don’t have to explicitly declare data types. But it retains syntax like semicolons and curly braces that provide the structure Java relies on. I’ve never loved Python’s lack of syntax, so getting that structure back feels refreshing. However, I do think that there is some comfort to the rigidity that languages like C++ and Java enforce.

Data Structures

JavaScript also lets you modify arrays on the fly using methods like push and unshift. Coming from Java and C, where arrays feel rigidly static, this freedom is a godsend for simple tasks. No more defining a new array just to add a singular item in what should be a 4-line task! However, I do think that the lack of a standard, immutable array is a little confusing.

Learning Process

As someone who is completely new to JavaScript, it was very pleasant to learn. The logic just clicks. Most things work exactly how you’d expect them to if you’re coming from other languages. This intuitive flow is a huge advantage…though maybe too much of one. Without strict rules, JavaScript lets you get away with messy, dysfunctional spaghetti code. That might just be the opinion of someone that tends to write code with a few loose ends, but it is what it is.

Limitations and Scope

Within its niche, JavaScript shines. For web development, it’s a perfect fit. But it isn’t and shouldn’t be the only tool in a developer’s knowledge base. You wouldn’t use a hammer for everything, and you shouldn’t use JavaScript for everything either. It was made for the front end, not the back end. JavaScript knows its role and sticks to it, which makes it a solid programming language. While other languages may be a bit better from a generalist’s perspective, I actually value languages that are fine tuned to a specific usecase.

Athletic Software Engineering

ICS 314, the class where I’m learning JavaScript, takes an “athletic software engineering” approach with daily JavaScript practice. Repetition cements syntax fundamentals no matter your skill level, so I appreciate the consistency. The daily exercises haven’t gotten too intense yet as we build up our basics. But I know that there is potential for stress to build as the semester goes on. I’ll be tracking my progress in reading code snippets and writing my own efficient, readable code. Mastering both skills will be vital if I want to become a better software engineer and programmer in general.

Conclusion

So overall, JavaScript is a functional language that works within its scope. It doesn’t try to be anything that it isn’t, which is something that I value in both a friend and a programming language. I am looking forward to learning more about JavaScript and taking it as far as I possibly can within the semester!