DEV Community

How do you learn a new programming language?

Marco Suárez on November 17, 2017

Sign for a course maybe? Look for video tutorials on YouTube? Head-first into a book? Which one do you think is the best way?

I want to know your methodology, I'd be great if you pointed out your level of experience so we can maybe see if learning habits change with it.

Collapse
 
13hoop profile image
yongSir

start

read Doc

do Some Demo

read Doc ...

do ...

Lied myself already learned

end

:)

Collapse
 
andy profile image
Andy Zhao (he/him)

Hahaha I hate to say this but this is pretty much me.

Collapse
 
arandilopez profile image
Arandi López

Same, I prefer to Lear docs and API... Build something and then add to the known languages

Collapse
 
soupwaylee profile image
Stefan Su (he/him) • Edited
  1. Go to the "well-known homepage of the language" and get an overview of the most important keywords via breadth-first-search.
  2. Start with YouTube tutorials. If there is live coding, I try to copy what happens in the videos and take small notes. Helps to see what set of tools are used and what the workflow looks like.
  3. Look up terms that were mentioned (but not elaborated on) in the official documentation and learn to navigate through it.
  4. Look at code that has been written before to acquire the flavour of the language. (Github, stackoverflow etc.)
  5. Apply in own projects / playgrounds and gain deeper understanding of important topics via depth-first-search-reading.
Collapse
 
buntine profile image
Andrew Buntine

For me, the most effective approach to learning a new language has always been diving in and creating something. I typically write a program that solves a problem I know relatively well.

My GOTO programs are generally one of Conway's Game of Life, a Brainfuck interpreter or an EAN13 barcode encoder.

I generally read the docmentation of the language and keep a tab open on the API docs, also. If the language is a large paradigm shift from where I've been spending a lot of time I will probably start with much smaller programs and work my way up.

The general advice from me is to always write code. Don't simply do contrived tutorials that are only designed to demonstrate the major selling points of the language in question.

Collapse
 
dwd profile image
Dave Cridland

I have to admit, I've not learned new languages recently - beyond some basic fiddling to alter an existing program. I look them over and get an idea of what I might want to learn them for eventually, and then sigh about not having the time.

But when I used to learn new ones more often, I'd first block out some time. I generally went for 24 hours - a bit arbitrary, but it worked.

Then I'd write a rough webserver. I'd make it handle HTML, images, and a CGI program - which probably dates this technique - and support HTTP/1.1 (which was a bit bleeding edge back then). In those days, there weren't, typically, library functions for HTTP, so this was written from first principles.

This got me a good feel for a few things:

1) Network handling. Often asycnhronous event-driven stuff, but sometimes I'd have to use forking or threading. Usually I'd pick whatever worked best in the language, sometimes I'd deliberately try a few approaches.

2) Text and binary data handling. Some languages I learned couldn't handle binary data very well - the Tcl webserver I wrote suffered from this badly, for example. Others handled text and binary data equivalently (C++, Python2).

3) Parsing. HTTP headers, being RFC 822, are a disaster to parse - which is why mail servers were written to avoid this. HTTP servers, however, can't avoid it. Folding is particularly fun.

4) IPC. That's Inter Process Communication. This is probably less useful now than it was, but handling external programs got me a good feel for how well the language and its environment exposed the platform functionality.

Whatever I needed to find out, I'd go hunting for on the Internet - but it meant I wasn't looking for "How to write Tcl", but "How do I XYZ in Tcl", which meant my research for more focused and goal-driven.

Looking back, while it provided pretty good coverage, it missed several aspects which are really quite interesting to me now, like data storage, for example. I don't know what project I'd pick now that would be any better, either - an XMPP server would be fun, but that's really quite a huge thing.

Collapse
 
nijeesh4all profile image
Nijeesh Joshy

Go read the documentation. Now you will think that you have learned all. Open an IDE try to build something you will get stuck and there will be errors.Try to solve it if you can't, Go search for the answer. Come back and finish it .
Do this in a loop. Then you can say you learned a language.

Collapse
 
izumisy profile image
Seiya Izumi

I have been coding almost for 4 or 5 years long, but always when I start learning a new language, video tutorials come to the first place to start. If those kind of learning materials are not available, I try to look for another documented stuff on the internet.

Some guys recommend reading books on programming, frameworks, but IMAO books are always going to be outdated after several years, so it could be waste of money. Plus, recent technologies have up-to-date documents on the internet in their official website or something like that, so the materials scattered on the internet, particularly video tutorials are the best ways for learning something new at first for me.

After grasping the core concept and syntax of the language or framework, with these technologies I will make my own small product like TODO app, SNS-like app, or something that has basic functionality and publish it on Github or Heroku. It is always important to take advantage of my own knowledge to understand what I need to learn next in addition. This process helps you find some ambiguous points in your knowledge.

Using the knowledge after learning it is the most important methodology.

Collapse
 
bgadrian profile image
Adrian B.G.

I am an experienced developer, the process of learning a new language take less and less time, as more languages and paradigms you know, because you make associations, see the Polyglots.

I actually wrote how exactly am I learning Go, now. As you can see I "attacked" it on all fronts (watch tons of videos, read the manual, do a course, chat, write code every day).

Collapse
 
lancecontreras profile image
Lance Contreras

Majority of the learning process is through getting a training in my work. I mean you learn a lot in school but in the corporate world it could be different.

I'm fortunate enough to be employed in a company where you can learn from a lot of people around you. And they sponsor a classroom training for the newbies.

Right now I'm trying to learn C and to do that on my own, I am following a set of exercises online. I realized doing exercises is the fastest way to learn and appreciate a programming language. After all, experience is the best teacher.

Collapse
 
farnabaz profile image
Ahad Birang
  • Read a hello world tutorial
  • Write a sample project and start to develope it and add more features to it
  • Search and read docs to find best practice
  • Join StackOverflow and try to solve others problem
Collapse
 
jacoby profile image
Dave Jacoby
  1. Can I write the thing? Can I make it run? Hello World
  2. Can I input data and interact with it? Input name: Dave Hello, Dave
  3. Loops and control structures. Iterative Fibonacci
  4. Functions and passing argument. Recursive Fibonacci

Beyond that, I've "learned" the language, but am not an expert.

Collapse
 
pokhrelchintan profile image
Chintan Pokhrel

encounters a language and finds it attractive

Find the official hello world

Setup environment

Execute hello world - feel elated

Try something borderline useful

Doesn't work - get frustrated and forget about it

Months later, frustration wanes

Try it again, it works. Declare yourself an expert

Teach friends how to write hello world

Collapse
 
nnao45 profile image
nnao45 • Edited

for {
write_code()
if !be_understanding {
read_doc()
google()
continue
}
}

Collapse
 
djangotricks profile image
Aidas Bendoraitis

When it comes to learning a programming language, framework, or technique, I would start with tutorials, then would use the reference, then would learn from the source. And most important is to practice doing it yourself all the way.

Collapse
 
strredwolf profile image
STrRedWolf
  1. Cheat Sheet 2-4 page reference.
  2. The O'Reily book on the subject for stuff that isn't covered in the condensed version.
  3. Online documentation for APIs.

Seriously. I don't have time to wade through loads of documentation and tutorials. Most languages are an off-shoot of:

  • C (Ex: C++, C#, Perl, Go, Java, Javascript)
  • QuickBasic/Visual Basic (Ex: Informix 4GL, Python, Ruby)
  • Assembly (Ex: 6502, x86, WebAssembly, BrainF**k)
  • Conway's Game of Life*

Note, they may not be off-shoots by timing, but in terms of language structure and style.

Most tutorials are "here's how to program, we'll use X language to teach you." Did that too many times. Don't need to do it again.

So condense it down, give me a ref with some examples, and make sure someone's got a book on it from O'Reily. Rarely will I see a "C does it this way, X lang does it that way" document.

(* I threw that in because a team of bored folk made Tetris in CGoL. Talk about really low level programming!)

Collapse
 
aghost7 profile image
Jonathan Boudreau

I start with reading on the language and watching videos. During that period of time I also ask myself if the language is worth learning at all. After that I normally make the jump and start a side project with the language.

Collapse
 
k4ml profile image
Kamal Mustafa

I wrote about this before - dev.to/k4ml/first-step-in-learning...