Picking a first programming language
Tags: beginners, career
Published: 2022-10-15 02:39:53

![Screenshot of some javascript](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9z1x8r4dotueca5wgl4l.png)

<!-- wp:paragraph -->
<p>The first step in making the decision to get into programming is to <a href="https://onrampdev.com/?p=27">develop the right mindset</a>. The second step is to decide what language you're going to choose as your first. This can feel pretty overwhelming when starting out. There's Ruby, Python, Javascript, something called C, something that sounds like C called C++ and some coffee language called Java. Rust, Dart, Go, Scala, ...the list goes on. So which should you choose first? </p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>I won't bury the lede - Javascript is your safest bet, with Python as a good alternative pick. Read on to find out why.</p>
<!-- /wp:paragraph -->

<!-- wp:heading {"level":4} -->
<h4>Why Are There So Many? Shakespeare in Spanish</h4>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>So why exactly are there <em>so many</em> programming languages and what do they all mean?</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>If you've ever studied a foreign language you'll know that usually you don't translate the same sentences word-for-word. If want to say "I'm thirsty" in Spanish I might say "Tengo sed" which literally translates to "I have thirst". It's close but as a native English speaker the latter sounds a little weird to me. Different programming languages are a means of expressing the same concepts using different patterns.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>Here is a program that adds 2 numbers together in 3 different languages:</p>
<!-- /wp:paragraph -->

```ruby
def add(x, y)
  x + y
end
add 1, 2
```

```c
int add(int x, int y) {
  return x + y;
}
add(1,2);
```

```clojure
(defn add [x y] (+ x y))
(add 1 2)
```

<!-- wp:paragraph -->
<p>The first is Ruby, the second is C, and the third is Clojure. These are very different programs that create the same result. But there are tradeoffs in each. C code will beat equivalent Ruby code in performance, hands-down. But it'll take you longer to write and will probably be insecure and buggy if you're not careful (which takes even <em>longer</em>). Clojure is what's called a "functional" language, meaning some things are just <em>harder</em> to do (side-effects) but it makes some ideas much easier to communicate.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>Circling back on the language analogy, I'm sure someone has translated Shakespeare to Spanish but I bet it doesn't have the same qualities as in English. Some ideas are probably harder to express and some may be downright impossible. It's the same with programming languages. And it turns out programming languages are written by people as creative and diverse as the world around us, meaning different people prefer to express ideas in different ways. So lots of people will create new languages just for fun, or because a particular language doesn't do what they want in the exact way they want it (programmers are finicky).</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>There are pragmatic engineering concerns as well. Google created Go in part to make it easier to reason about what's called "concurrent" programming. If they do their job right this means software running in Go will get better utilization out of the underlying hardware (vs. say, Ruby). This translates to actual cost in terms of engineering time and how expensive it is to run the software.</p>
<!-- /wp:paragraph -->
<!-- wp:heading {"level":4} -->
<h4>What Makes a Good First Programming Language</h4>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>Ok, that's all well and fine. We've learned that people like to create programming languages because they want to be Shakespeare...or something. How does that help in choosing a first language? Well it doesn't but hopefully you have a slightly better understanding of the landscape. </p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>In my humble opinion, a programming language well-suited to beginners should be 1) flexible, 2) used in the industry, and 3) have a large community and resources behind it.</p>
<!-- /wp:paragraph -->

<!-- wp:heading {"level":5} -->
<h5>Versatility</h5>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>A good first language shouldn't box you into any specific paradigms. And by that I mean it should be <em>somewhat</em> un-opinionated in how you write your code. Clojure, from earlier, isn't a great language to start with unless you have very specific reasons to do so. It's built to impose certain constraints on what you can do because it's opinionated about how good software programs are built. This makes it a very interesting language to learn at some point, but not a great starter choice.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p><strong>P.S.</strong> I've heard it said that everyone should learn a Lisp-based language at some point and this is a great one to pick up.</p>
<!-- /wp:paragraph -->

<!-- wp:heading {"level":5} -->
<h5>Usage</h5>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p><a href="https://en.wikipedia.org/wiki/ALGOL">ALGOL</a> is the Latin of programming languages. I'm oversimplifying and I'm sure there's some computer somewhere in the world running an ancient ALGOL program that only hooded mages know how to modify. But unless you're planning to throw on a hood yourself, stick to languages that lots of people use today, which brings me to the next point...</p>
<!-- /wp:paragraph -->

<!-- wp:heading {"level":5} -->
<h5>Community</h5>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>Community is good because it means there are lots of resources for when you inevitably get stuck. If I wrote a programming language tomorrow and asked you to learn it, would you? Aww, you're sweet, but that'd be a terrible idea. You won't be able to Google the error messages. There won't be any plugins in your favorite text editor. Again continuing with our language analogy it'd be the equivalent of learning Dothraki or High Valyrian.</p>
<!-- /wp:paragraph -->

<!-- wp:heading {"level":4} -->
<h4>And The Winner Is...</h4>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>Finally we come to the end and the TL;DR is that you should just pick Javascript or Python. Let me explain...</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>Both Javascript and Python are largely built around Object-Oriented Programming which is a specific way of modeling the world in software (i.e. they're kind of opinionated), <em>but</em> you don't actually have to write OO style code (under the hood everything is modeled as objects anyway but that's a different story). Contrast this to say, Java, where you have to create a <em>class</em> before you even know or care what you're modeling and it's a big difference.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>Javascript is used <em>everywhere.</em> It's actually a little frightening since I don't know it as well myself :). But if you're writing code for the web then you're writing Javascript at some point. And of all the different kinds of programming work you could do web development will be the easiest to break into. Python is pretty popular too and cool open-source projects like <a href="https://www.djangoproject.com/">Django</a>, <a href="https://pandas.pydata.org/">Pandas</a>, and <a href="https://www.sqlalchemy.org/">SQLAlchemy</a> demonstrate its versatility.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>Finally, you can Google any message you get running Python or Javascript code and you will find an answer.</p>
<!-- /wp:paragraph -->

<!-- wp:heading {"level":4} -->
<h4>Wrapping Up</h4>
<!-- /wp:heading -->

<!-- wp:paragraph -->
<p>We talked about different kinds of programming languages and how they differ. We discussed Shakespeare, Spanish, and talked a little Latin too (in vino veritas). Most importantly, we talked about why Javascript and Python are very safe choices as first programming languages, <em>especially</em> if you plan to pursue web development.</p>
<!-- /wp:paragraph -->

<!-- wp:paragraph -->
<p>Hope this helps. By the way, don't forget to <a href="https://artisanal-knitter-4166.ck.page/7a08f37f37">join my mailing list</a> so I can continue my language rants in your inbox and tell you why I secretly want you to learn Clojure. :)</p>
<!-- /wp:paragraph -->

P.S. This is reposted from my main site at https://onrampdev.com/ - check it out for insights.