Whenever someone is looking to learn a programming language, the usual questions are: “What language should I choose?”, “Where should I start?”, and “What are some good resources to use?”.
“What language should I choose?”
This question is typical for someone looking to start in programming and the simple answer to this is “It doesn’t really matter what language you choose, just pick one and go deep on it.”
The main point of this response is that if you’re completely new to programming, you’ll be tasked with learning two additional skills that an experienced programmer will already know: the fundamentals of programming (common data structures and patterns/algorithms) and the ability to properly search for solutions. These skills are transferable to other languages and once mastered will greatly reduce your time to learn a new language.
While the response is great in its simplicity, realistically there are some languages that are better to start with based on the following factors (in priority order):
- Language maturity. You want to choose a language that has good documentation, an engaged community, and at least a few years of production use to ensure that you can find answers/support.
- Field of interest. Most languages can support use in various domains (web development, data science, scripting/dev ops, to name a few), but some languages are a better fit than others. If you have a need for specialization, look for common languages used in that specialized field, otherwise, try to pick a language that can be more universally applied.
- Popularity. You’ll want to avoid picking a language that is not highly used (or is not commonly used in your particular field or industry of interest). This can lead to a reduction in support or opportunities for use in the future.
- Values aligned for beginners. Although it’s not as important a factor (and possibly a controversial one), languages that value readability, “Explicit” over “Implicit” and “Best Approach” over “Any Approach You Want” will make learning the language, and truly understanding what’s happening easier.
Given these factors and assuming you don’t have a specialized field in mind, here are a couple of languages to begin with:
- Python. With its universal use in web development, data science, scripting, and more, Python will be a useful language for about any field. It’s both mature and extremely popular, while also valuing readability, explicitness, and the best approach to things. Python has a huge community (and growing) with lots of resources available (and lots of Stack Overflow answers!).
- Elixir. While it’s a newer language (2011 release), it’s based on a mature language called Erlang (1986) and has been gaining in popularity in web-development and scripting. Elixir’s functional nature coupled with valuing readability, explicitness, and the best approach makes it easier to understand what is happening in the code. Elixir’s docs (https://hexdocs.pm/elixir/) are really well written with lots of code examples and a great UI.
“Where should I start?”
The answer to this question doesn’t really depend on the language as much as it depends on your level of programming experience.
As a beginner, start with a programming course or book that walks you through the fundamentals, ideally while you build an example application. Once through that, you should build an application of your own. There’s no better way to dive deep into a language and really figure things out than to build something yourself! Along the way, you’ll be forced to learn how to find the answers to the problems you have to solve. Reading code, and more importantly documentation, is core to being able to truly unlock the power of any language.
For an experienced programmer, the answer to “Where should I start?” is usually to review the basic structures/patterns of the language, work through some examples, and then ideally build your own application. Oftentimes it’s best to build a similar application in multiple languages (some popular ones include a To-Do List, messaging app, a game, and more). This allows you to identify the differences in the language without the overhead of also learning a new problem space.
“What are some good resources to use?”
Here’s where the answer is more dependent on the language you choose.
A good place to start would be using some of the resources available on https://wiki.python.org/moin/BeginnersGuide/NonProgrammers
For a good step-by-step tutorial, try this…
For Experienced Programmers
As a good quick start review of the data structures and patterns…
It’s always a good idea to go through some koans to build some muscle memory on the basics, so here are some good ones.
If you’re doing web development, Python has a few good options to choose from. If it’s a large application, Django is a great option:
If you’re looking for something light to get up and running, Flask is a great micro-framework.
If you’re looking to use Websockets or long polling (for live updating client-side pages without requiring page refresh), you’ll need a framework like Tornado that can be used standalone, or incorporated into an existing web framework like Django (or just use Django Channels).
If you’re looking to use python for data science, you might want to reach for a more comprehensive framework/platform like Anaconda, which allows you to easily bring in data science libraries.
Along the lines of data science, the Python libraries you’ll most likely encounter will be NumPy.
And as always, get familiar with the Python docs…
Try introductory books like https://pragprog.com/titles/cdc-elixir/, https://pragprog.com/titles/elixir16/, or https://pragprog.com/titles/phoenix14/ are great resources to help you learn the basics while building example apps.
Also, look at https://elixirschool.com/en/ for an online resource to walk you through learning Elixir.
For Experienced Programmers
This is a great reference summarizing the basic operation of Elixir including data structures, functions, working in Elixir, and more!
For a more consolidated “cheat sheet” version of Elixir data structures and operations, try: https://media.pragprog.com/titles/elixir/ElixirCheat.pdf
If you’re looking to practice the basics of working with Elixir data structures and functions, Elixir-koans is a great place to start. Koans are especially useful for experienced programmers transitioning from another language.
After covering the basics, another great step in learning Elixir is to start an Elixir track one exercism.io and solve problems from Easy to Hard.
Of course, you can’t really think to use a language without knowing the docs! Go to https://elixir-lang.org/ as a starting point, and for Elixir, the HEx docs are here https://hexdocs.pm/elixir/1.10.3/Kernel.html
When you’re ready to start building an Elixir application, use the following to help guide your library usage decisions.
If you’re looking to do web development, look no further than Phoenix!
When you’ve conquered the basics of application development in Elixir, take your programming to the next level by learning you some Erlang!
|[**Table of Contents||Learn You Some Erlang for Great Good!**](https://learnyousomeerlang.com/content)|
Caution: resources can grow stale
Above is just a sampling of the resources available. As previously alluded, the maturity of the language will have an impact on the number of resources available. One thing to watch out for is out-of-date (stale) resources. Each programming language has its own level of churn (major and minor revisions to the language that can impact how you would code solutions), and this should govern the reliability of the resource. Preference should be given to resources that are working in the language version you’re using. If a language version is not referenced, you can use the date of the resource publication (if available) and refer to the release history of your selected language to estimate the version. In general, resources from the last 1-2 years should be fairly reliable (especially for a more mature language). Older resources can still have value in providing inspiration, if not providing directly applicable code.
Just get started!
Hopefully, this article has helped in your quest to learn a new language. What’s important is to just get started! It’s easy to feel overwhelmed by the amount of information out there and to get discouraged by not feeling like you’re learning fast enough, just know that you’re not alone. Every programmer has felt that way at some point and even the most experienced programmers can still feel that way when learning a new language, which is probably why the programming community, on the whole, is very helpful and approachable. Take advantage of that experience by joining newsletters, chat channels, meetings, and conferences to further your development and add your perspective to the community.
Best of luck and happy coding to you!