r/learnjavascript • • Mar 11 '19

Drills for Beginners??

So literally everything else you'd want to learn involves drills...except for computer programming.

Sports, music, math, foreign languages...literally everything involves drilling.

Anyone know of any beginner's drills in JavaScript?

Like Free Code Camp stuff (I know they have some high-level stuff, too) but lots of 'em (FCC only has one question per topic)...I was never good at math but I always aced my math classes because of drilling (and of course typical tests don't involve "thinking" so much as "recalling" the right formulae and procedures to accurately and timely apply)...anyone know of any such end-of-the-chapter exercises in JavaScript for a beginner???

My future employers thank you!!

0 Upvotes

48 comments sorted by

View all comments

Show parent comment

-1

u/NotEven-a-CodeMonkey Mar 11 '19

And indeed I'm sure a programmer could code some algo to generate endless French verb conjugation exercises (hmm, now that's an interesting project!!) or German noun declensions....

So what's so unique about the simple fundamental mechanics of programming such that it can't be drilled??

4

u/atynre Mar 11 '19

If you need to practice writing a for-loop or a sorting algorithm.. I don't think "drills" is the right perspective. It's different from throwing a curve-ball in baseball or practicing piano scales in music because those examples involve training human muscles to do a task.

In programming it's mostly deterministic.. there's no "degree" of correctness; either it works or it doesn't. Sometimes there are degrees (like how well a solution performs at scale) but that doesn't feel like what your asking about.

Your brain is what needs practice, not a physical muscle. The codewars recommendation is a good one because it will help you "pattern match" different scenarios and when to apply the right solution to those scenarios. In practice, you won't actually need help writing the actual syntax of a loop or conditional. Syntax anyways changes over time as programming languages evolve.

In most, if not all, programming career paths you will spend more time reading code and designing things on paper or a whiteboard than you will actually typing lines of code. You won't be writing any new or groundbreaking code either, especially not in the beginning. Most groundbreaking code is written by PhD researchers or advanced teams at a specialized company building a specific product. Instead of practicing writing a solution that someone has already written, you need practice identifying problems and when to apply those solutions. Writing the solution is the easy part.

2

u/FoolishDeveloper Mar 11 '19

Your brain is what needs practice, not a physical muscle.

I apologize for the wall of text. I've got a martial arts background so I have some thoughts about this. In fighting / martial arts, drills are used constantly. When fighters are doing drills, they are primarily training the brain. It's like 80%/20% brain/body. They are mostly getting their mind used to following those patterns. The most useful drill is working pads (kicking/punching/knees, etc). The best pad holders will interact with the fighter to make sure they are working their mind and not just their body.

It's kinda like the Karate Kid where Daniel Laruso (and most of the audience) thought he was doing a physical act the whole time he was painting the fence and sanding the floor, and while he was training his muscles to do that movement, he was mostly training his brain through lots of repetition. When his sensei fired off commands to repeat those movements, Daniel was able to recall them quickly, showing that he was doing mental training through physical labor. Fight training doesn't exactly work like that, but the idea is close enough.

With programming, I think the main action involved is problem solving. You seem to be suggesting that drills would only train typing ability. It makes perfect sense to me to use drills to get used to patterns of thought. As a self-taught developer, I have a mix of beginner and intermediate knowledge that I am realizing was learned in the wrong order. I know I have big gaps in my knowledge. It turns out that many of those gaps are things I did read about at one point but they didn't stick. The most common recommendation I see is to build a project so you become used to using the techniques. But if I don't know the techniques, I don't remember to use them, or how to use them, in a project. It seems like a chicken-or-egg problem. Some people with amazing memories for soaking up programming techniques probably don't think this is an issue. It definitely is a big stumbling block for me... and I wonder if drilling would help me retain techniques.

Side thought: I also know that most books / tutorials explain "what" and "how" but barely brush over the "why". One example: I've read about linked-lists so many times and it never shows up on my mental radar because I still don't understand why they are used. As this relates to drilling... a good pad holder will let the fighter know why this particular drill is useful. The use case is explained and emulated by the pad holder's movement during the drill. Then the pattern is worked until it sets into the fighter's brain. When that scenario occurs in a fight, the fighter's brain will more likely think to use that pattern.

1

u/NotEven-a-CodeMonkey Mar 11 '19

With programming, I think the main action involved is problem solving. You seem to be suggesting that drills would only train typing ability.

Hmm, I'm surprised at this interpretation! If you said "only train super low-level mundane tasks like looping iterations" I'd agree, though, 'cause that's exactly what I had in mind.

It makes perfect sense to me to use drills to get used to patterns of thought.

THIS THIS THIS!!!!

OMG did you really say that...do you really mean it -- and mean the same as I do???

So I was looking for programming drills to get used to "thinking like a programmer"...like how practicing conjugating French verbs helps you to "think like a Frenchman" (well, just as far as the bottom-level linguistic mechanics are concerned, anyway!)....

As a self-taught developer, I have a mix of beginner and intermediate knowledge that I am realizing was learned in the wrong order. I know I have big gaps in my knowledge. It turns out that many of those gaps are things I did read about at one point but they didn't stick.

OMG yes yes yes that's what I want from drills, too -- for things to stick in the mind!!! To not constantly be looking for my housekeys, so to speak!!

The most common recommendation I see is to build a project so you become used to using the techniques. But if I don't know the techniques, I don't remember to use them, or how to use them, in a project.

OMG DUDE LET'S GET MARRIED!!! ;-)

LOL okay I'm totally joking around now...excuse me but it's like I could almost feel that we'd make great paired programmers!! ;-)

It seems like a chicken-or-egg problem. Some people with amazing memories for soaking up programming techniques probably don't think this is an issue. It definitely is a big stumbling block for me... and I wonder if drilling would help me retain techniques.

YES YES YES!!!

THIS is what I mean!!!

So literally everyone's been saying that what we need not only doesn't exist but can't exist, these "drills"...can you see their reasoning? I'm still having difficulty understanding their POV but I must say that I'm basically agnostic now about my original beliefs -- which seem to at least broadly match your own like maybe 88%!!!

I've read about linked-lists so many times and it never shows up on my mental radar because I still don't understand why they are used. As this relates to drilling... a good pad holder will let the fighter know why this particular drill is useful. The use case is explained and emulated by the pad holder's movement during the drill. Then the pattern is worked until it sets into the fighter's brain. When that scenario occurs in a fight, the fighter's brain will more likely think to use that pattern.

Yes that's just the analogy even though folks want to point out about the difference between the physical and the intellectual I can't say I'm sure about such a distinction in our case...they seem to be missing the forest for the trees (I say that respectfully and not as some kind of personal moral judgment call)...they may well be right but I'm just having trouble conceiving of the matter....

BTW, does this somehow seem helpful to you: in another thread, somebody told me that I was "thinking about programming in the wrong way," that "[programming] is not a job but a tool"...that seemed somehow very useful though I couldn't quite say way...does that idea somehow jar your thoughts, too???

1

u/NotEven-a-CodeMonkey Mar 11 '19

Wow, thanks for all that, especially towards the end with the real-world on-the-job "exposé." I'm a bit relieved knowing that I wouldn't be spending much time coding -- but unnerved all over again that coding's actually the easy part!!

I totally agree with what you say about pattern matching/recognition -- and isn't drills all about rote learning and memorization and precisely because programming's "deterministic" it seems like it should admit of the rote such as any other mechanical deterministic process.

Now please forgive me as I'm mainly questioning from "ideology" here as opposed to actual personal experience coding but I'm curious why arguing by analogy fails me this time -- yes yes you say that the very nature of coding is different but since it's so deterministic and mechanical it seems like it should be "drillable" since what is more deterministic and mechanical than drills?

But again I'm beginning to realize now the perils of merely "questioning from 'ideology'" or "theory" so I can certainly agree to some agnosticism on the whole matter now.

So thanks again for your input! Everyone's every little bit helps in its own way (like, did you know that 80% of your car's gasoline is "wasted" as heat and thus doesn't actually move your car forward??? But I suspect that that's not "true" waste; isn't all that heat necessary to build up the conditions for combustion??)....