DEV Community

Cover image for 'Which programming language should I learn first?'
ladyofcode
ladyofcode

Posted on • Updated on • Originally published at ladyofcode.com

'Which programming language should I learn first?'

Spoiler alert: it's not automatically JavaScript

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.

Top comments (32)

Collapse
 
sreno77 profile image
Scott Reno

I don't think it matters what language you start with because learning to program involves "learning to think like a programmer." Pick whatever language seems to work for you. If you want to learn application programming, consider C/C++. If you want a "general purpose" language, consider Python. If you want to learn web development, maybe try PHP or C#. Programming skills that you learn will be transferrable from language to language.

Collapse
 
ladyofcode profile image
ladyofcode

I've met people who build apps without fully knowing what their code does - especially when they're pasting hacks to solve issues without understanding what's happening. I was initially riled because they weren't really 'thinking like a programmer' and calling themselves a developer (which, technically, they were). To me thinking like a programmer means we take the time to understand a problem, and understand how we solve it too, and in the process do that the best way we can.

I agree that the language doesn't matter all that much, but simply coding doesn't mean everyone will involve 'learning to think like a programmer' - or at least a good one. If thinking like a programmer means something different to you, then fair.

Collapse
 
sinvalfelisberto profile image
Sinval Felisberto

Thats the point, man! We need to know how the things works. They are just tools. We need to understand how the things are done.

Collapse
 
verthon profile image
Krzysztof Sordyl

While I agree with your point, imagine someone will start with COBOL 🤣 For web-development the JS is more versatile, as it can be used on both client and server.

Collapse
 
darkwiiplayer profile image
𒎏Wii 🏳️‍⚧️

If someone were to ask me what language to learn first, the most important question is:

How quickly do you want to find a programming job?

If it's not an immediate concern, I'd recommend learning something like Pascal. Next to zero relevance on the job market, but the language is structured in a way where you still have to build stuff yourself that other languages just give you out of the box, and that forces you to think about how to structure code.

Then read the wizard book, maybe try some lisp to get a sense of just how different programming languages can be, and how best practices in one language can be complete anti-patters in another.

Then start learning some language with more practical applications, like C# or JavaScript, or anything else that you can actually get paid for. At that point you can focus on just learning the language, instead of having to learn programming at the same time.


If the answer is I need a job yesterday, then yea, learn PHP and go build wordpress sites, then figure out how to advance your career from there. It's a lot easier to learn the fundamentals of writing quality software with food on the table.

Collapse
 
oluwalonire profile image
Moshood Abdullahi Ayomide

Hi, I quite support you on this Idea, Learning JavaScript is like an exclamation between all those Languages, It was only Javascript that got my brother his job and now he's all grown to the position of a Senior Front-End Developer

Collapse
 
ladyofcode profile image
ladyofcode

Love this advice for someone! Valid and nuanced to a specific situation, as advice of this kind should be.

Collapse
 
peerreynders profile image
Collapse
 
ladyofcode profile image
ladyofcode

So was Scratch. They certainly have their place - it's just not everywhere. Thanks for the links!

Collapse
 
peerreynders profile image
peerreynders • Edited

Here is one interesting opinion:

One difference between the Scratch/Code.org/Tynker school of thought and the Racket/Pyret school of thought is that only the latter conveys the idea of composition from a minimal base case. The Scratch/Code.org/Tynker design is to have tens of special-cased primitive blocks for multimedia features. The Racket/Pyret school of thought is to have core constructs. For Racket, instructions that manipulate multimedia are normal functions. Maybe the difference is that Scratch, Code.org, and Tynker do not have an actual function call construct, but rather each block has its own syntax for providing arguments. The negative consequence is that learners see programming as combining many special instructions, not building programs from a few primitives. A good programming language has a minimal core calculus that all language features elaborate into, and the “pop coding” languages are not aware of this idea.

Culturally we were expected to learn programming as a side effect of learning a ”useful” programming language. (Has anybody ever learned visual design from CSS?)

This is adequate if you are never going to use another one. There are consequences however if you need to move on later.

”You're first programming language is the hardest” is a misconception; it's largely a result of people simply learning another dialect within the paradigm they are already familiar with. Moving from one paradigm to another tends to involve a lot of frustrating unlearning.

The educators behind How to Design Programs recognized this. They came to the conclusion that commercial PLs contain too many distractions when the focus needs to be on training the thinking behind designing programs—this is what ultimately lead to Pyret.

So if there is a chance that one has to learn more than one programming language in one's career/lifetime “planning to throw one away” could be a profitable strategy.

And it's not like Pyret is useless … you can even use it with Google Sheets … I don't even want to know how many people entered programming via spreadsheets.

Excel is the world’s most widely used functional programming language

Simon Peyton Jones

Collapse
 
devdufutur profile image
Rudy Nappée

Java to learn OOP concepts, then JS to forget all this sh*t 😁

Collapse
 
darkwiiplayer profile image
𒎏Wii 🏳️‍⚧️

You can do some fairly decent OOP in JavaScript these days.

Collapse
 
devdufutur profile image
Rudy Nappée

You can but no need !

Collapse
 
ladyofcode profile image
ladyofcode

I should hope so! JS hasn't thrown that all out of the window.

Collapse
 
ladyofcode profile image
ladyofcode

LOOOOL, accurate. I literally did that a while ago, but it turned out JS still has classes and other OOP concepts I can't quite ditch. React hadn't even switched over their docs for the longest time 😆

Collapse
 
eljayadobe profile image
Eljay-Adobe

The "best" language to learn depends on your interests.

"I want to learn to program." Learn Python. (I learned with BASIC. Python hadn't been invented yet.)

"I want to really learn to program for realz." Read SICP, it is available for free, online (thank you MIT & authors!). It uses Lisp.

"I want to program web applications." Learn JavaScript.

"I want to make awesome iOS programs." Learn Swift.

"I want to make programs for Windows." These days, I recommend learning .NET, and that means programming C#. Although F# is also a good choice, and The Book of F# is excellent.

"I want to make programs for Android." Learn Kotlin.

"I want to be a super-leet-hacker!" Learn assembly language. (I learned 6502. Then 68000.)

Collapse
 
68wooley profile image
Graeme Robinson

Job security? Learn Java. There'll be jobs maintaining the billions of lines of legacy code out there long after the cool kids have decided they're too good to learn it.

It'll be the "lab coat and beard" Cobol job of the next few decades (or at least until AI actually learns to code). :-)

Collapse
 
ladyofcode profile image
ladyofcode

COBOL had a stable release in 2023 😭 We joke about this ish but picking the hottest new tech isn't necessarily conducive to job security. I wouldn't recommend Java every time as that's mostly in government jobs in my area, but the same principle applies!

Collapse
 
pengeszikra profile image
Peter Vivo • Edited

ctrl + shift + j -> javascript
mac: option + command + j

Collapse
 
ladyofcode profile image
ladyofcode

Followed by Alt + F4 and then deciding to run a farm instead

Collapse
 
pengeszikra profile image
Peter Vivo • Edited

Image description

Collapse
 
syxaxis profile image
George Johnson • Edited

I'd narrow it down to languages that you know you will use in production areas you intend to work. Example I'm a sysadmin so I know Perl ( I'm that old! ), C, C++, C#, Golang, I'm OK with Java and even a some Python, I know Unix shell script and Powershell very well. I don't know Javascript or Typescript and have no wish to learn as they will not help me that much as the other langs in my infra/sysadmin career.

Also depending upon your work, you don't have to know a language inside and out unless that's your actual career, most coders I know know enough about each language to get stuff done, most know around 2 langs extremely well, another 4-5 quite well and maybe another 4-5 adequately enough to get by with some basics. It all helps as you're more adaptable and you can always gen up on a specific language if you get a great job offer come along 'cos you know coding as a discipline, not just as a language.

When I started coding as a kid it was 1982 and BASIC was it, then I did Z80 Assembler, then Pascal. When I a teen in high school it was BASIC/C/Pascal. When i got my first job it was shell script/DOS batch/C. By 1994 I was working on DecAlpha and Sun boxes, so I needed shell script, C, Perl. By 2000 I was doing more Windows and Java was big news, so I learned Java. In 2008 I was learning C# so I could work with the dev teams. In 2015 I started learning Python and Golang, I prefer Go right now. I hadn't touched C++ in about 5 years and someone needed some help with an Arduino project, so I spent 6 months doing Arduino coding. I haven't touched Perl since about 2005, it's now basically dead in business. Remember though, I'm not a coder, I'm just an infra engineer and sysadmin on Unix/Linux and Windows. It's just constant change but the discipline remains the same, coding is coding.

So my point is work out where you think your career path is going, pick langs that will work best to secure work for the next few years, keep your options open and be ready to change languages every 7-8 years.

Collapse
 
amulyakumar profile image
Amulya Kumar

To answer your question effectively, it is essential to consider your specific goals, background, and preferred application areas.

If you're new to programming, starting with a versatile language like Python or JavaScript can provide a solid foundation due to its extensive libraries and resources for various applications.

However, if you are interested in web development, learning HTML, CSS, and JavaScript together is also a common beginner's path.

Collapse
 
ladyofcode profile image
ladyofcode

They certainly can! I think beginner web devs have it easier picking tech than some other types of devs, to be honest. Not that the work isn't difficult - just that the entry pathway is a bit clearer. Perhaps because there are SO many of us being vocal 🤣

Collapse
 
citronbrick profile image
CitronBrick

There's a sister i.e. a lightweight version of Java called Processing, which can be used to easily draw shapes & animate them. This was the 1st language that I learned quickly & I love it. Now it's used as JavaScript library.

Collapse
 
lajbel profile image
lajbel

I think you should think in anything you want to do, then learn the language of your tool or framework.

Collapse
 
ladyofcode profile image
ladyofcode

How would you recommend to a total newbie who has never coded before to pick a tool or framework?

Collapse
 
joemama123 profile image
Your Average Roblox Game Dev

I think you should learn Python or Java

hi
Enter fullscreen mode Exit fullscreen mode
Collapse
 
ladyofcode profile image
ladyofcode

Learn both at the same time and recommend Jython 🤣

Collapse
 
dannydev06 profile image
Danny akinola

It also depende's if you want to become a frontend or backend or a freelancer

Collapse
 
ladyofcode profile image
ladyofcode

It definitely does! The nuance concerning someone's situation and goals should be considered properly

Collapse
 
thehamza profile image
Hamza

C, it helps u to understand machine language

Some comments may only be visible to logged-in visitors. Sign in to view all comments.