'Which programming language should I learn first?'

Spoiler alert: it's not automatically JavaScript

Saturday 27 January 2024

We have on our hands another contentious topic (at least according to Tech Twitter/X): recommending a language to learn. People are often so unfoundedly opinionated on which language to recommend to coders and staunchly back specific languages much like the fanboying behind PS2 vs. Xbox of yesteryear (yes, emo millennial present 🙋🏽‍♀️). Why aren’t we recommending languages the way we’d pick them for projects - or do you just pick your ‘favourite’ language and roll with it regardless of whether it’s appropriate or not for every project?

I’ve encountered a variety of opinions on the web:

  • Why do people even bother recommending C or C++
  • Learn JavaScript or Python; it’s more beginner-friendly
  • Everyone should recommend JavaScript because the barrier to entry is easier

and far too many other, equally grating statements.

I find the advice varies more with developers who are paradigm-agnostic and can code in a variety of languages; y’know, the kind of expert who has their preferences but doesn’t behave like their favourite fandom ship sailing around the very core of their identity is being attacked.

The List

The following scenarios I give are not exhaustive. Here are some languages and stacks I’ve recommended based on people’s situations:

‘I need to freelance ASAP [with a future in web]’

WordPress, HTML+CSS, and PHP if they can’t afford to be selective about clients. Any popular CMS stack works - see what’s common in their local area. Copy and paste JavaScript to start with. Use a site builder they must. Doing work for small businesses is an easy way to get started, build a portfolio, and then raise rates. See also: Shopify and Liquid.

Some agencies just want basic templating skills from a beginner because they do work for smaller businesses or departments. Though few, there are roles that exist requiring just HTML and CSS with minimal JavaScript. UI design skills would likely be more beneficial here than advanced programming skills.

‘I want to learn enough to get a web dev job’

Pick a popular backend/frontend language and/or framework that jobs popularly request in their local area and start building projects. Companies with a good culture want to invest in their employees and products; they will train them to have good habits. Companies with crappy cultures may not train new employees, or may encourage hacking (the quick-fix kind that breaks things down the line), so be wary. Agencies and companies might want different stacks; have a look.

The same applies to remote work, but it’ll be more difficult to land a junior role without a solid portfolio, particularly without networking.

‘I want to program well’

C (procedural), followed by object-oriented (perhaps some Objective C =/C++, then Java/C#), then Haskell/equivalent (for functional programming). You’ll cover a lot of paradigms, system knowledge, and hone habits you don’t even know you’ll benefit from until later. Throw in a logic programming language like PROLOG, or assembly (MIPS, anyone?) for additional pain. Algorithms and data structures are good to study. They’re prepared for this undergrad level of effort. They’ll probably find it easier to pick up other languages after they’ve willingly spent time tearing their hair out. If my hair were thinning I’d have a valid excuse.

‘I want to work for govt or large institutional organisations’

Look at the job ads for positions in those departments, and the tech they use in their deliverables. Start with those languages. I can tell you straight off that in my area I know the government uses Java, Spring, .NET, and Angular. SharePoint too. Agencies tend to use Drupal for government department projects. It’ll be different in other locales and countries.

‘I want to analyse my data’

Python, R, etc. Usually, academics or students are asking me this, and they’re doing mostly light work: copying and pasting with a bit of editing. Whatever is most suited to the data they need to process should be the language and tool suite. Sometimes they might just need enough to use a Jupyter notebook and be done with it.

‘I just feel I should know some code’

Tell code to piss off. If one must, learn problem-solving and planning skills because that is at least transferrable. Most people likely will not be set back by not knowing how to program in their lifetime. Sorry, Gen Alpha <3.

Juggling priorities

So to even get to the above, in choosing a language one should consider:

  • What is being created and why
  • The ultimate purpose of the projects
  • The nature of the projects
  • The intentions for the deliverable (some people only want to learn to code to bootstrap apps they can then use to generate income and do something else, and that’s fine)
  • The job market
  • Whether the need for income is dire
  • The intentions of the coder for themselves (not everyone cares about being an expert or becoming a senior developer)
  • The level of tutorials and documentation available (newer languages often have far less support, especially at the beginner level)

In summary

Recommending a language or tool is subjective. It always should be. We spend time debating and considering stacks for every new project we undertake - why should someone seeking advice not benefit from an iota of that deliberation? If someone is already choosing a solution without understanding personal, user, and project needs, perhaps consider what that says about their attitude towards problem-solving.