I’m a regular attendee of the local FreeCodeCamp meetup, and recently they have decided to restart the curriculum and start from the basics to help newcomers along in their journey of learning to code. This got me to thinking about JavaScript recently. The FreeCodeCamp curriculum focuses on JavaScript as the main programming language. For a program meant to get newcomers to the field of web development, this is the obvious, if not only choice.

However, leaving aside the fact that it’s required for web development, I think that JavaScript is a good choice of language for beginner programmers. When I had begun learning JavaScript, I had gotten more proficient in it than Java which was basically the only language we used in class for over 2 years. In this blog post I wanted to list some of the elements of the language and resources that make JavaScript easy to learn despite the general dislike of the language.

Type System

When declaring a variable in JavaScript we don’t need to specify the type of the value. While many sing praises about static typing, I see this as an advantage for new programmers. This allows them to use variables without having to worry about the different data types like you normally would have to in Java or C++. While it is true that static typing has its advantages, for newcomers I see it more as just another bit of detail that acts as a hurdle for learning actual programming concepts.

C-like syntax

Yet another feature of the syntax itself. JavaScript uses a very C-like syntax, and this is good because it establishes a familiarity with the syntax of other popular languages like Java, C++, and of course C. While sporting its own quirks, the structure of loop and conditional blocks using curly braces look exactly the same between all of these languages. For example, a for loop written in JavaScript can be copied and pasted into any of the other ones mentioned above and work just fine (barring some differences in variable declarations).

Object Oriented + Functional

While most of the starting curriculum for FreeCodeCamp focuses on object-oriented teaching, it also touches on functional programming aspects of the language a little further on. This is another aspect of JavaScript which made it stand out. Being able to use functional methods such as map, filter, and reduce makes data transformations look much cleaner, concise, and easier to read. While Java 8 does now include some of these functions, they do not work as nicely as the ones in JavaScript, and in my opinion harder to read than just using a loop.

Mozilla Developer Network

The Mozilla Developer Network (MDN) is not so much a part of JavaScript itself, but it is one of the elements that facilitated learning JavaScript. The MDN Web Docs is a comprehensive open source documentation for not only JavaScript, but also HTML, CSS, and other web development technologies. All the JavaScript functions are thoroughly documented with detailed examples, but also keeping the language and jargon use to a reasonable level, which is something I’ve always wanted with Java and C++. The formatting and styling of the pages on MDN makes it much easier to read and look for what you need, giving it a much more inviting look compared to, say, the C++ Reference site that usually comes up at the top of search results for help with C++.