The problem is the mindset
A lot of smart, educated folks tend to struggle with code and the common limiting belief is that code is hard to grasp and takes many hours to comprehend.
However, they also don’t quite understand why so many people are able to pick up on it so quickly and build these elaborate web or mobile applications. Not mention how they can explain programming concepts with such ease and spot where you’re making your logic errors and hard to spot syntax errors.
“Why is this so hard to understand? I’ve read and followed along to the coding walkthroughs. Though, writing it out is an absolute struggle! IT SHOULDN’T TAKE ME THREE DAYS TO WRITE THIS JS ALGORITHM”
What exactly is the problem
And it shouldn’t! algorithms can be difficult, but not at the cost of sheer effort. In fact, if one can write it out by hand and think it through, they become much easier to manage. Stepping through to your solution as a problem solver is going to make life a lot easier. On the other hand, trying to remember array methods from rote and sticking values inside syntax like you would using an academical mindset is going to make things very, very difficult.
Academical vs Problem Solving Mindset
Taking an academical approach is basically taking a linear approach. There are a start and an end. You first learn fundamentals in introductory courses, then move on to more in-depth courses that explain the “why” details, and finally, you finish with your curriculum.
Congratulations, you’re a doctor (or lawyer, or engineer, or English teacher or whatever)
I figured if I went through the walkthroughs and thought about the different concepts of arrays, objects, variables, prototypes, functions, closures, and the different predefined methods it would help me to think like a programmer. However, I still struggled through the algorithms. I would write out what I think I needed to build the algorithm but soon got quickly confused what to do next to pass the next test. After that, you start mixing up the “why” with the “how” and get decision paralysis. That confusion soon turned into becoming overwhelmed, and I was literally trying anything to get it to work with all the stuff I learned through rote. It was much like those homework applications you got in pre-algebra in college, where you worked through a series of problems until you completed enough them before a certain deadline.
You felt awesome when you got through them, but that was just it, you got through them. You didn’t really learn anything other than what answer belonged to what problem. I would be stuck on intermediate algorithms for days, sometimes for a week’s time. This was even with all the help I could get on the gitter chat when that was still around. The only way I got the solution is when other experienced campers would spoon-feed me the solution.
How vs. Why
It wasn’t until I hit an epiphany after doing one of the front-end projects that my mindset wasn’t going to cut it. I had to take on more of a problem-solver mindset.
There are several factors that make the problem-solver mindset different from an academical mindset. A problem-solver doesn’t learn in a synchronous fashion. She dives in the middle and learns bi-laterally between concepts. This is because she just needs to learn what’s needed to fix the problem. The “how” always comes first. Then when the problem is solved, she’ll determine the “why” behind her solution. For instances, take the approach to solve an algorithm. Trying to solve it with the code will open you up to both figuring out the logic AND which syntax to use. It’s much easier to think it out and manually write your solution on paper. For one, it’s a piece of cake to double your values in your written array. Just start with your first item, multiply in your head with two, add that value in a new array, and keep doing it till you run out of values in your array. From there you figured out your “how” through the shortest and easiest path.
Transferring that manual work into code will be a breeze. The only thing you need to do is use the right syntax to build it. I challenge you to use this approach on your next coding problem by manually writing out your solution and then coding it.
Studying vs. Building
“Well, that’s great and all but I’m still getting confused on the concepts. Array methods, prototypes,
this context… don’t you think I have to study these concepts to use them effectively??”
Yes. That is a valid point.
And I won’t argue with you that some rote learning and ahem, “studying” is needed to understand a language’s constructs.
Stop “Studying” and Start Building
Seriously, you need to stop “studying” code and start building small, iterable applications with what you learn.
Take whatever you learned from FreeCodeCamp, pull up https://repl.it, and start fiddling with it. Try to see what you can create. What happens if I put a null value as a parameter? Can I take all these arrays of arrays and combine it into one array? How can I make this more readable? This is how a problem-solver mindset works. They use this opportunity to learn by building.
Most smart, bright people end up giving up on becoming a developer because they end up using an academical mindset to approach coding problems. Their approach involves learning in steps from start to finish because they are taught to learn synchronously. However, programming is an applied science and requires one to learn based on the problem she is solving. She’s more of an effective learner when she takes programming concepts and uses it to solve tiny problems to satisfy her curiosity. Thus, the problem-solving mindset is a better approach.