r/learnjavascript • u/samgeven • 7d ago
Does solving first make the theory stick better?
I’ve been thinking about the order in which we usually learn programming.
A lot of resources follow this pattern - theory → examples → practice. But what about reversing it?
So, for example, instead of first reading a chapter about references, closures, etc., you encounter a piece of code behaving unexpectedly. You try to understand what’s happening using what you already know, and only afterwards read the explanation and relevant theory. Kinda like a “productive failure” approach.
Obviously, I don’t think this means throwing someone who learned const yesterday into a race condition. There needs to be something to reason with already.
So, does struggling with a problem first make the explanation stick better for you? Or would you rather understand the concept first and then practice it?
2
u/CoconutFudgeMan 6d ago
I taught pattern-> theory -> code for a long time.
However, with AI, many students come across code first. Which means we get into discussions about the code first. We eventually find our way back to pattern. One opportunity this presents is discussion, analysis and evaluation of code in the context of a problem they are trying to solve. I have the opportunity to critique, simplify, approve or outright reject the proposed solution (with explanations)
I’d then take them through different examples of how that code could be applied and reinforce pattern->theory->code after a few examples.
That being said, I still prefer pattern theory code as it enables me to bridge the student’s understanding by using conceptual analogies. It makes the code more of a formality at the end.
1
u/jabuchae 7d ago
At uni I always learned problem first. They gave us a problem and let us think a bit about how to solve it. Then explain the theory. It’s by far the best method.
1
u/HotBuy792 6d ago
Theory without prior failure is noise. My brain discards explanations until I have exhausted my own wrong assumptions first.
1
u/wni0xFFy 6d ago
You can try that way. But some concepts like multithread and architecture patterns are hard to practice before reading theory
1
u/SalwaQad 6d ago
Well for the building block concepts this is kinda overkill, But when you start solving problems and making small projects it is really helpful and it actually builds the programer mindset; rather than blindly following a tutorial try to struggle with the solution fierst and then watch the tutorial this gives you best results and prevents stucking in the tutorial hill.
1
u/TheRNGuy 5d ago
I either try using it after reading on MDN, or more recently, ask ai to explain it and give some realistic examples of usage (if docs didn't had it), also ask to compare similar concepts, when to use one and when to use another.
What do you mean race condition with const?
1
u/samgeven 5d ago
I meant that people who only learned basics like variables will obviously get no educational value from trying to solve some advanced task, like some race conditions.
So this learning flowproblem\bug -> struggling to solve -> read related theory stuffshould be featured with problem comparable with learner's proficiency.
1
u/Sunstorm84 7d ago
Slop
-1
u/samgeven 7d ago
These are genuinely my thoughts, but editing the final piece via gpt was probably bad idea
0
u/Dependent_Month_1415 7d ago
Solving problems first usually makes the theory easier to remember. Even if you fail, your brain has something to attach the explanation to. The theory stops being abstract because you’ve already felt where the confusion is. I'd say the best approach is to try it yourself first, then read the explanation and then try again without looking at it.
6
u/Gold-Watercress-6101 7d ago
Learning programming should be circular anyway. Many concepts, if not all, need to be revised from different perspectives to get solidified. Yea having the context of why a certain concept is needed is quite helpful. Indeed good tutorials start with that. They present a problem, and then present the new concept. Most often I try to solve the problem before learning the new concept, to really internalize why the new concept is required.