Confused Guy Searching for Programming Language
Confused Guy Searching for Programming Language

What Computer Language Should I Learn? A Beginner’s Guide

Starting your programming journey often begins with a simple question typed into Google late at night. It usually goes something like “Learn __“. But the real puzzle is filling in that blank. How do you decide which language to even search for in the first place?

Maybe you’ve heard snippets in pop culture, like:

“Isn’t Java that language they always mention on Silicon Valley? Maybe I should start there.”

Or perhaps you’ve caught wind of trendy languages:

“Haskell seems to be the hot topic right now.”

Or maybe, aesthetics play a role:

“That Go gopher mascot is undeniably cute!”

Then there are those of us who take a more direct approach, searching for something like:

“Which programming language should I learn first?”

This question is so frequently asked that it has even spawned infographics.

Choosing your first programming language can feel like a personality quiz – “Which programming language are you?”. It can be tempting to pick based on fleeting interests. But before you jump into learning a language just because it sounds cool, remember the commitment involved.

Becoming proficient in any programming language, even at a basic level, requires a significant time investment – hundreds of hours of dedicated practice. Therefore, your decision should be well-informed, considering factors that will impact your learning and future opportunities.

Key factors to consider include:

  • Job Market Demand: Is the language actively used by companies and in demand by employers?
  • Long-Term Relevance: Is the language likely to remain relevant and useful in the future?
  • Ease of Learning: How beginner-friendly is the language in terms of syntax and concepts?
  • Project Potential: What kind of projects can you realistically build while learning to stay motivated and build a portfolio?

The landscape of programming languages is constantly evolving, with new languages emerging and academic research expanding. Even the world of webcomics weighs in on this crucial decision!

When it comes to selecting your first programming language, the sheer number of options can be overwhelming. To simplify things, let’s look at Google search trends over the past decade related to learning programming:

The graph reveals some interesting trends. Java, while still significant, has seen fluctuations. Python has steadily climbed to become a dominant choice for many beginners. However, a less obvious but powerful trend is the consistent rise of JavaScript.

Before diving deeper into specific languages, especially JavaScript, let’s clarify a few points:

  • No Objectively “Best” Language: There’s no single programming language that is universally superior to all others. Each has its strengths and weaknesses, and the “best” choice depends on your goals.
  • Learning Multiple Languages is Beneficial: Experienced developers often know multiple languages. Expanding your linguistic toolkit is definitely a good long-term goal.
  • Master One Language First: Focus on gaining a solid foundation in one language before spreading yourself too thin across many. And, as you might guess from the title, this article argues that JavaScript should be that first language.

Let’s begin by examining how programming is traditionally taught in educational institutions.

Computer Science 101: The Academic Approach

Universities have historically framed programming within the broader context of computer science, often linking it to mathematics or electrical engineering. However, it’s important to remember the distinction:

“Computer science education cannot make anybody an expert programmer any more than studying brushes and pigment can make somebody an expert painter.” — Eric S. Raymond

Many universities still approach introductory programming as if it were purely computer science, and computer science as if it were solely mathematics. This often leads to introductory courses emphasizing low-level languages like C or mathematically oriented languages like MATLAB.

Academic departments often rely on programming language rankings like the TIOBE Index or the IEEE Spectrum rankings to justify their curriculum choices:

These rankings often show remarkable consistency over decades. However, even within academia, shifts are happening.

Notably, in 2014, Python surpassed Java as the most popular language for introductory programming courses at top US universities.

But if we look at the languages actually used in the professional world, a different picture emerges.

JavaScript is overwhelmingly the most popular language among developers, according to Stack Overflow’s survey. It’s crucial for front-end web development, increasingly vital for back-end development, and expanding into areas like game development and the Internet of Things.

Job market data echoes this trend. Job postings mention JavaScript more frequently than any language except Java:

Data from Indeed.com, a leading job posting aggregator.

It’s not by chance that communities like freeCodeCamp have built their curricula around JavaScript. Over the past few years, thousands have used platforms like freeCodeCamp to land their first developer jobs.

The argument isn’t to teach JavaScript simply because it’s taught at a specific platform. Instead, JavaScript is advocated because it offers a highly effective pathway to a first developer job.

But is JavaScript the right first language for you? Let’s revisit those key factors mentioned earlier to evaluate JavaScript’s suitability.

Factor #1: The Job Market Realities

If your primary motivation for learning to program is purely intellectual curiosity, this factor might be less relevant. However, if you, like many aspiring programmers, aim to gain job-ready skills, the job market is a crucial consideration.

As previously noted, Java appears in slightly more job postings than JavaScript. However, the context is important. JavaScript, despite being around for two decades, has only recently become the backbone for large-scale applications at companies like Netflix, Walmart, and PayPal.

This rapid rise means that the demand for JavaScript developers is surging, often outpacing the supply of skilled professionals.

Data from Indeed.com illustrating the developer-to-job-opening ratio.

For every open Java position, there are approximately 2.7 Java developers vying for it. PHP and iOS development jobs face similar competitive landscapes. In contrast, for each JavaScript job opening, there are only about 0.6 JavaScript developers available. This indicates a strong “seller’s market” for those with JavaScript expertise.

Factor #2: Long-Term Prospects and Growth

JavaScript projects on platforms like GitHub see, on average, twice as many pull requests compared to Java, Python, or Ruby projects. Furthermore, JavaScript is experiencing faster growth than any other widely adopted language.

A graph from GitHub’s Octoverse report showing JavaScript as a leading language in terms of repository usage and contributor growth.

JavaScript’s dominance in GitHub projects, reflecting its overall popularity and active community.

The JavaScript ecosystem benefits from substantial investment and contributions from tech giants like Google, Microsoft, Facebook, and Netflix. For instance, TypeScript, a statically-typed superset of JavaScript, boasts a vibrant open-source community with over 100 contributors, many of whom are employees of Microsoft and Google working on it as part of their jobs.

This level of inter-company collaboration is less common in the Java world. Oracle, which owns Java through its acquisition of Sun Microsystems, has been known to legally challenge companies attempting to extend or modify Java.

Factor #3: Learning Curve and Difficulty

(Intended image was a difficulty meme, placeholder image used. Original alt text was a parody of an XKCD comic about language difficulty).

Most programmers agree that high-level, scripting languages are generally easier to learn. JavaScript, along with Python and Ruby, falls into this category.

While universities often still start with languages like Java and C++, these are significantly more challenging for beginners due to their complexity and lower level of abstraction.

Factor #4: Project Versatility and Accessibility

This is where JavaScript truly excels. JavaScript runs directly in web browsers, which are ubiquitous across virtually every device. This “run anywhere” capability makes JavaScript incredibly versatile. You can build a wide range of projects and easily share them with anyone.

Jeff Atwood, co-founder of Stack Overflow, famously articulated this with Atwood’s Law:

“Any application that can be written in JavaScript, will eventually be written in JavaScript.”

And this law continues to hold true as JavaScript’s capabilities expand.

Java once aimed for cross-platform compatibility with Java Applets, but these have become obsolete and were officially discontinued.

Python, while versatile, faces challenges in easy distribution of projects, particularly for web-based or readily accessible applications:

“How can I give this game I made to my friend? Even better, is there a way can I put this on my phone so I can show it to kids at school without them having to install it? Um.” — James Hague in “Retiring Python as a Teaching Language”

In contrast, JavaScript projects, especially web-based ones, are inherently shareable. Here are examples of projects built by the online coding community and hosted on platforms like CodePen, accessible directly through your browser:

A visual representation of Conway’s Game of Life implemented in JavaScript and running in a web browser.

Conway’s Game of Life

1970s-style Simon game

A web application themed around Star Wars that allows users to search Wikipedia, showcasing JavaScript’s ability to create interactive web experiences.

Star Wars-themed Wikipedia Search

(Intended image was of a dungeon crawler game, placeholder image used. Original alt text was for a rogue-like dungeon crawler game in JavaScript.)

A rougelike dungeon crawler game

Focus on Mastery First, Then Expansion

Jumping between languages too quickly can hinder your progress. Deeply understanding your first language is crucial. Once you have a solid foundation, learning subsequent languages becomes significantly easier and more efficient.

From there, you can broaden your skillset and become a more versatile developer by exploring other languages:

  • C: Excellent for understanding computer architecture, memory management, and high-performance computing.
  • C++: Powerful for game development and performance-critical applications.
  • Python: Ideal for data science, scripting, and backend development.
  • Java: Important for enterprise-level applications and large tech companies.

However, start with JavaScript.

Now, let’s address some common counterarguments or objections you might encounter.

Addressing Common Objections About JavaScript

Objection #1: Isn’t JavaScript Slow?

Modern JavaScript, particularly when run with engines like Node.js, is surprisingly fast. For most practical applications, it performs on par with or even faster than many high-performance languages.

JavaScript (Node.js) significantly outperforms languages like Python, Ruby, and PHP in speed. It also rivals the performance of languages like C++, Java, and Go in many benchmarks.

Objection #2: JavaScript is Dynamically Typed

JavaScript’s dynamic typing, similar to Python and Ruby, offers flexibility but can also lead to runtime errors if type mismatches occur.

For example, if you intend exampleArray to be an array:

exampleArray = [1, 2] // -> [1, 2]
exampleArray.length // -> 2

But accidentally reassign it as a string:

exampleArray = "text" // -> "text"
exampleArray.length // -> 4

Such errors are common in dynamically typed languages. Experienced developers mitigate these with careful coding practices, type checking, and thorough testing.

If you strongly prefer static typing from the outset, consider learning TypeScript after mastering JavaScript.

“Typescript has a learning curve, but if you already know JavaScript, it will be a smooth one.” — Alex Ewerlöf on TypeScript

Objection #3: I Want to Build Mobile Apps

JavaScript is still a strong starting point even if mobile app development is your ultimate goal.

  1. JavaScript Mobile Frameworks: Frameworks like React Native and Angular with Cordova enable building native mobile apps using JavaScript.
  2. Backend Development: Mobile apps often require robust backends, and JavaScript (Node.js + Express.js) is well-suited for building them.

Furthermore, the mobile app landscape is evolving. While apps are heavily used, app downloads are plateauing. Web development dominates the job market, while mobile-specific roles are a smaller percentage.

Data from the Stack Overflow 2023 Developer Survey showing the breakdown of developer occupations, with web development being the most prevalent.

Developer occupations based on the 2023 Stack Overflow Survey.

The future of development is increasingly intertwined with the web. Even mobile apps and emerging technologies rely heavily on web technologies and infrastructure. JavaScript’s web-centric nature positions it well for this evolving landscape.

Objection #4: Isn’t JavaScript a “Toy” Language?

JavaScript does have a somewhat unconventional history and has been the subject of criticism. However, like C++, another language often criticized, JavaScript has achieved widespread success and is now a dominant force in software development.

As Bjarne Stroustrup, the creator of C++, famously said:

“There are only two kinds of programming languages: those people always bitch about and those nobody uses.”

In Conclusion: Learn JavaScript First

For aspiring programmers wondering “What Computer Language Should I Learn?”, JavaScript emerges as a highly practical and strategic choice. Its job market demand, long-term relevance, relative ease of learning, and project versatility make it an excellent first language for beginners seeking a successful entry into the world of programming.

Comments

No comments yet. Why don’t you start the discussion?

Leave a Reply

Your email address will not be published. Required fields are marked *