DEV Community

Cover image for How long does it take to learn to code?

How long does it take to learn to code?

Coderslang: Become a Software Engineer on May 21, 2021

In one word, FOREVER! You might think I am exaggerating, but learning to code is an iterative and lifelong process. Every day new technologies are...
Collapse
 
pengeszikra profile image
Peter Vivo
const dateList = [];

function recordDate(date) {
    dateList.push(date);
}

function displayDates() {
    console.log(dateList);
}
Enter fullscreen mode Exit fullscreen mode

The problem with this code piece are recordDate and displayDates have outer dependency: dateList. Without that variable these two function is useless.

Collapse
 
jamesthomson profile image
James Thomson

100%. Much better to use pure functions.

Collapse
 
rafarochas91 profile image
Rafael Rocha

Or provide the dependency as a parameter even if it contains side effects you have overall control. Following the Inversion of Control principle.

Collapse
 
dakujem profile image
Andrej Rypo

You would export the functions from the module and keep the variable private. It's not the point of the example.

Collapse
 
coderslang profile image
Coderslang: Become a Software Engineer

I absolutely agree. And it's another proof of the fact that learning never stops 🚀

Collapse
 
jmfayard profile image
Jean-Michel 🕵🏻‍♂️ Fayard

Right, it's like dancing, you are never done learning, so focus on enjoying every moment

Collapse
 
coderslang profile image
Coderslang: Become a Software Engineer

Absolutely agree! Enjoy the ride or change the track :)

Collapse
 
dakujem profile image
Andrej Rypo

I was almost expecting an answer like "Two months." or "All you need is this one course.", but this article actually sheds some light on the topic the right way.

Collapse
 
coderslang profile image
Coderslang: Become a Software Engineer

Two months is a reasonable timeframe to study the basics of JS. But realistically it's more like 6-12 months to get from zero to the first job as a software engineer. And then you really start learning :)

Collapse
 
teallarson profile image
Teal Larson

My thought as well.
Andre 3000 Forever Ever

Collapse
 
chupavn profile image
chupavn

Thanks for your sharing!!! 😃👍

Collapse
 
coderslang profile image
Coderslang: Become a Software Engineer

I'm glad you liked it 🙏

Collapse
 
arian_chauhan profile image
Arian Chauhan

A bug will still haunt you as you walk into your after life. FOREVER AND EVER