We Started From The Top and Now We're Here
Why JavaScript Might be a Bad Language to Learn for Beginners
I became aware that there was a thing called coding when I made a website with Tripod. It was the early 2000’s and Tripod was a web hosting service that also provided a blogging tool. Tripod and similar services like Geocities preceded CMS(Content Management Systems) and blogging platforms like WordPress with their WYSIWYG(What you See is What you Get) editors that made it easier for people to put stuff on the internet.
I didn’t do much with that blog and I don’t know if it’s still out there, but I do remember creating a “logo” for the main page. The “logo” was an image of a lightbulb, and when you hovered over the image with your mouse, the lightbulb “turned on”. I was able to achieve this trick by writing some HTML and CSS, replacing the original image with an image of a turned on lightbulb by using the CSS :hover pseudo selector on the image. What a time to be alive!
Initial Encounters with JavaScript
My memory is a little fuzzy on when exactly I became aware of JavaScript, but the first thing I remember attempting to make was an image carousel. Image carousels are also known as image sliders and they do exactly what you expect. Different images slide into view one at time based on some timed interval.
It was the end of the 2000’s and I remember googling how to create an image carousel, finding some code snippets, and getting it to work, sort of, after some frustration. I had no idea how the code worked of course, so I didn’t stick with learning JavaScript. I just messed with HTML and CSS every now and then when I wanted to customize my blog with Blogger and when I switched to Wordpress.com in the 2010’s.
The Early Days of Web Design and Frontend Development
It wasn’t until I studied and majored in Graphic and Interactive Design when I truly started learning JavaScript and when my interest in programming started growing. At the beginning I was more interested in being a Designer than a Developer, but by the end I was leaning more into the coding. It was around 2013 and back then I called myself a Web Designer slash Frontend Developer. However, the Designer route wasn’t for me, so this lead me to a Fullstack Web Development Coding Bootcamp.
Like many “Fullstack” Web Development coding bootcamps, the stack was JavaScript on both, the client and the server. This meant Node, Express, Sequelize, Handlebars, and React. The only extra language I learned, besides HTML and CSS, was SQL.
In 2020 I completed the 24 week Coding Bootcamp. Since then, I have learned and toyed around with other Programming languages. I learned a bit a C when I went through the CS50 course. Learning C was super helpful in understanding and learning TypeScript better. I have played around with other languages where I’ve done at least a Hello World program with most of the popular languages like Java, PHP, Ruby, and recently Golang, but the ones that I have probably dedicated more time to learning have been Python and Rust.
Top to Bottom vs Bottom to Top
All this backstory to show that I’ve been programming for quite some time and that my path wasn’t the typical path of doing a Computer Science degree. I like to say that my path was top to bottom in contrast to the bottom to top you get with a CS degree. What I mean by this is that I started at a higher level of abstraction with simple DSL(Domain Specific Languages) like HTML and CSS, to one of the highest level programming languages, JavaScript.
JavaScript is definitely the language I’m most competent at, but after some years I’ve have started to question if JavaScript is the best language to learn as a beginner. At least in the long term. I think it made it more difficult for me to go down a level. For example, I found it harder to understand Node.js at the beginning. Before learning C, TypeScript and the concept of statically typed languages was completely alien to me. I also found the idea of learning other programming languages as something akin to learning another human language. It seemed inconceivable to me that I could pick up another programming language.
However, I also wonder if I would’ve kept learning to code if my first language was a language like C. What’s cool about high-level languages like JavaScript is that it offers immediate gratification for beginners. Particularly JavaScript on the browser. It is easier to make a button do something and to make something happen on the screen with JavaScript, than it is with a language like C. But that immediacy is only temporary. On the long term it will make it more challenging to transition into more complex or statically typed languages.
Take TypeScript for example. While the Bootcamp does teach you about the primitive types like numbers, booleans, and strings, these concepts are quickly forgotten once you memorize that using the === (triple equals sign) is better than using the == (double equals sign) when doing conditional logic. For me it wasn’t until I wrote some C code, where I had to be explicit about what type of data my variables were, that I had a more solid understanding on why the triple equal sign was better for comparing things. Also, learning about memory management with languages like C and Rust has had the effect of making me better at a JavaScript in the sense that JavaScript is an interpreted language vs a compiled language.
We can also keep going down the stack, get closer to the metal and argue that you don’t fully understand programming until you’ve written Assembly code, or designed your own logic gates. We don’t need to go down that low, but knowing about these levels wouldn’t hurt either.
So if JavaScript is a bad first language to learn for beginners, which language should you learn first? I’m unsure here, but I would go with C because it is both, statically typed and you have to handle memory. C is closer to machine language compared to higher-level languages, which means it provides a clearer understanding of how the hardware operates. C's syntax and concepts form the basis of many other languages like C++, Java, and even Python. Learning C can make learning these other languages easier because you'll recognize the underlying principles.
Even though languages like JavaScript are great because the barrier to entry and learning curve are lower, this is only a short term gain if the goal is to become a well rounded Software Engineer. Knowing what I know now, I would start from the bottom.