

What We've Learned About Teaching Code - zds
http://www.codecademy.com/blog/9-invisible-stumbling-blocks

======
apsurd
Since I know the codecademy team is always listening, I'll share my feedback
through supporting my two friends through codecademy:

Firstly they love it. The game mechanics and the reward cycle is a great
motivation for them. I think nobody can argue that you've found a great way to
get TONS of people to enjoy "learning to program".

The second part is a bit tricky... are they really learning to program?

IMO the problem with all pragmatic approach is the lack of _the need to
understand_. I know you didn't intend it, but codecademy suffers from the same
tired "tutorial" approach. Users follow instructions to win the prize.

I will say codecademy is better than the tutorial approach, but it's still a
tutorial.

The fundamental problem is my two friends _need_ me to teach them how to think
in code, how to conceptualize the problem, how to understand that "i am taking
this problem, i am working out a solution in my brain, in english, and then i
will write this solution in code" They simply do not have the capacity to do
that. And they are 5 months in through codecademy.

Just yesterday my friend had the idea that when using a for loop, the loop
passed all values at the same time to the nested switch statement, upon which
the switch statement would evaluate ALL the variables at the same time, using
whatever the hell case was the best match.

He couldn't pass the level because he did not visualize in his head that the
for loop passes each value, one at time. Then it procedurely flows down,
_line-by-line_ into the switch statement... and so on.

My friends do not have pictures in their head about how code works, why it
works that way, and how to use those pictures to draw their own.

They don't know how to code.

EDIT: sorry one more thing. The only lifeline they have when they get stuck
(aside from asking me) is to look at the QA. I have _never once_ seen an
answer that explained the answer, nope, it was "here put this magic code in it
and that way it will PASS! YAY!" And I mean answer in the sense of "why", not
why does javascript require a return here instead of there, or why the "right"
answer is to put this code before that code, or the strange reason you need
this bracket here instead of there -- I mean why! why? really...why?

~~~
patio11
That's not the worst thing in the world, since most pedagogy that works is of
the basic format "You should know X. What should you know? _Class repeats X._
Good, because you should know X. Timmy, if I say Y, what do you say? _Timmy
repeats X._ Good job Timmy, because you should know X. Susan, if I say Y, what
do you say? _Susan repeats X._ Good job Susan, because you should know X. You
should also know that if Y', X'. What should you know? _Class repeats if Y'
then X'._ Billy, if Y', what do you know? _Billy says X._ Can anyone point out
Billy's mistake? _June does._ Good job June, because if Y', X'. Billy, try it
again. _Billy does._ Good job, Billy. What if Y instead? _Billy says X._ Good
job Billy. Billy got the right answer because Billy knows X, except when Y',
then X'. Class, what have we learned? _Class repeats X and if Y', X'._ "

While it is true that they don't know how to code, the more specific status is
that they are presently learning to code. That's not the worst thing in the
world -- so am I, and I get paid for it fairly regularly.

~~~
apsurd
Essentially you are saying _something is better than nothing_.

I wholeheartedly agree.

As a person whose purpose in life is more and more "Free information in order
to Free Education", all I'm saying is I think we can do better; a lot better.

Rote memorization certainly works. But I don't think anyone anywhere, has ever
proved that it's an efficient or even particular _good_ way to learn
something. And yet modern civilization takes this for granted.

p.s. I never went to college so this is all outside-in.

~~~
nosignal
At the risk of being pedantic, it's worth noting that some things benefit from
memorisation (e.g. the alphabet) and some things benefit from "higher"
learning (e.g. understanding the concepts of programming). I don't think
patio11 is necessarily saying "something is better than nothing"; sometimes it
is _better_ to teach someone 'if you see the shape O, you say "oh"'.

~~~
apsurd
touché =)

I understand that very clearly when you put it that way. I remember my dad
beating the alphabet into my head. It was the only way that he could
eventually teach me how to read.

Thanks for that.

------
chriszf
When you're teaching something completely new to someone, at first you won't
even have a common vocabulary. This is true no matter what you're teaching,
and you have to dedicate some time to establishing the language (English, not
computer).

One thing that makes coding a little harder is that many of the analogies we
make for non-coders aren't especially clean: A hash is like an set of cubby
holes, each can be named and filled, and the set can be infinitely expanded.
Packet routing is like trying to find your way from New York to California,
only stopping at major cities to ask for a general direction. Memory is like a
big sheet of paper, and x = 5 is like writing 5 somewhere on the paper, and x
somewhere else, and then drawing an arrow between them.

I'm not saying these are the best analogies (or even any good), but I have yet
to hear ones that aren't riddled with holes. The average non-coder doesn't
have the context to back-fill these holes. As an instructor, you need to
realize this and take the time to lay more of a foundation than you think.

~~~
slaundy
Excellent point. Not only that, but analogies always come along with extra
bits that may lead them down the wrong path. It's very tricky to find just the
right metaphor.

~~~
wickeand000
Richard Feynman answering the question "How do magnets work" in an informal
pick-your-brain type interview:

"I can't explain that attraction in terms of anything else that's familiar to
you. For example, if we said the magnets attract like rubber bands, I would be
cheating you. Because they're not connected by rubber bands. I'd soon be in
trouble. And secondly, if you were curious enough, you'd ask me why rubber
bands tend to pull back together again, and I would end up explaining that in
terms of electrical forces, which are the very things that I'm trying to use
the rubber bands to explain. So I have cheated very badly, you see. So I am
not going to be able to give you an answer to why magnets attract each other
except to tell you that they do."

~~~
nosignal
From the 1983 BBC "Fun to Imagine" series. Video for reference:
<http://www.youtube.com/watch?v=wMFPe-DwULM>

~~~
apsurd
this is one of the funniest videos I've ever seen. I love HN!

------
teach
I've had a couple dozen students working through many of the CodeCademy
programs this semester as an experiment. And most of the Javascript lessons
currently on the site are just barely above mediocre.

~~~
zds
Hi teach - would love to hear your feedback after working through it for a
semester. Feel free to shoot us an email!

~~~
teach
The core problem is what you've identified in your blog. You assignments don't
explain many core concepts that students struggle with, they move WAY too
quickly through concepts, and there's no coherent sequence. For example, in
the middle of the "Conditionals in JavaScript" assignment/tutorial, you throw
in arrays and loops. Both are MUCH harder than conditionals.

Zed Shaw, on the other hand, does a marvelous job of not covering concepts
until the prerequisite knowledge is already in place.

~~~
chriszf
Mostly I agree, except for his introduction of %r very early on in python the
hard way. What %r does in the context of the lesson is clear, but many
students ask why and what it's for, and the complete answer is much more
difficult.

Frequently, I just settle for "it adds quotes around strings" because the
truth is a bit much to handle at that point.

------
aridiculous
In college, I listened to some advice about choosing less experienced
instructors because they have more recently been through the same material
that they are teaching. Plus, they'd be more motivated and less jaded. Turns
out that the experience factor is not that important.

At this point, after having many mediocre teachers and very few good ones,
I've come to the conclusion that only a small percentage of "teachers" are
actually worth learning from.

The only good teachers I've had were meticulous about their knowledge AND
really loved teaching. Not one or the other.

It basically requires a full-time teacher. Anyone besides that is actually
worse for me than no teacher because they are apt to ruin my interest in the
subject. Maybe I'm spoiled, but most classes aren't much better than a
textbook and a chat with a good friend.

Who does that leave as worthwhile teachers? Rare people like Feynman, a couple
of instructors on Lynda.com, one or two from my undergraduate classes, and a
couple from the new array of online classes. Again, you can be a grad student
and be a great teacher, but you have to know your domain inside and out, and
love teaching it. That means fielding questions with ease and, probably, being
able to teach without notes if needed.

One of the reasons I like open online courses is that you get to experiment
until you find an experienced professor who had enough initiative to start an
online course in the first place. I really do mourn the downfall of the in-
person class setting, but at least in my experience, a vast majority of them
aren't what they're cracked up to be. Maybe at top 10 schools the situation
changes?

------
mussussu
I am a student at codeacademy, I am 41 years old and I have had always the
urge to learn programming, I have tried many online tutorials in different
programming languages and @ first it is exciting but later on it gets
fustrating and finally I get lost, codecademy has given me hope again that i
dont have a disability in programming, yes I get stuck and I have to do the
exercises 3 or 4 times until I grasp.the concept, but I can feel my progress
and I am allways excited to take the lessons every day

------
Pynkrabbit
I really enjoy codecademy (I am currently at 930 points and 47 badges). I find
its a great way to learn and practice new concepts with a much smaller barrier
to entry and instant feedback. It is by no means perfect. There are a few
issues that come to mind: 1\. Because of the way the code validations are
written there tends to be only one or two ways to pass a lesson. This can lead
to frustration when a student writes a piece of code that performs the task
correctly but because it doesn't validate correctly he/she doesn't pass. 2\. I
found (for me) that the pace is actually to slow. I have cruised through all
the lessons and have participated in beta testing some of the more advanced
javascript modules (i.e. introduction to JSON). It would be nice if there was
more advanced content to move on to but this should be corrected as time goes
by and more content is created. 3\. General spell check and editing could be
better 4\. Currently there is no content that talks about the full stack of
technologies in a web application. This leaves the student studying small
siloed pieces such javascript/html/css on their own without a view of the
bigger picture. How does a web server fit in? How do I communicate with a
database? Why is there no talk of MVC or REST? Basic coding skills are great
but without a comprehensive picture of an application they are pretty useless.

Even with these issues codecademy has been a fantastic resource for me. I have
learned a ton and have gone on to start teaching myself more advanced topics
and have been learning different libraries such as backbone.js, node.js and
d3.js. Without codecademy I would not have been able to get through the
documentation on these libraries. One of the most valuable things that
codecademy has taught me is to not be intimidated by technology. From the
outside the programming world can seem like a pretty intimidating place.
Codecademy makes that first step a little easier...

------
Moneyherd
“There are known knowns; there are things we know we know. We also know there
are known unknowns; that is to say we know there are some things we do not
know. But there are also unknown unknowns – there are things we do not know we
don't know. ” The Johari Window - quote from Donald Rumsfeld

This is the point of user acceptance tests - it doesn't matter if the code
does 100% what it was designed to do. If the users can't make it work, it's no
good.

Nice analysis from Codecademy.

~~~
gmaslov
I love that quote. In a way, this article is talking about the "unknown
knowns" -- the things that are so obvious now that you don't even remember
learning them, or can't imagine not knowing them. These are the lurking biases
and preconceptions that we aren't even aware of having, and may be just as
dangerous as the "unknown unknowns".

------
rikramer
I'm going strong on codecademy. It's great to have a structured approach to
learning. There are so many resources out there that it's difficult to even
begin to learn coding. I don't expect that this will ultimately teach me to
build products with code but it at least will introduce me to common/core
languages and provide a base to continue my studies through other means.

Right now I'm working through the classes nightly. 15 badges down...no clue
how many to go.

------
Laner
Interesing to read this and all the replies. And it got me thinking. Part of
what has been a great learning experience for me is the "detective work" that
I had to do to understand why. That involved a lot of googling, but it paid of
and made me more hungry for knowledge. And when I try to code things on my own
it has helped me to survive the debugging. So perhaps part of the problem also
is the student. When did we start expecting that one webpage would gives all
the answers?

------
RockofStrength
"There is an interesting paradox in teaching: the better you know a subject,
the harder it is to talk to beginners. Experience means you have forgotten
what tripped you up when you were a beginner."

This reminded me of how I always have to clearly explain to my beginner piano
students that the higher the note on the staff, the further right on the piano
it goes. It's very non-intuitive that up/down on the staff = right/left on the
piano.

------
adambrod
I agree 100%. Codecademy is great way to learn the syntax and some of the best
practices. I agree their is a gap in understanding _what_ your doing.

I went through Stanford's Programming Methodologies on iTunes U (free!), and
they go over a lot more of the why, as well as decomposition and other stuff.

What if Codecademy had short video/audio lectures after each section that
would show more of a recap of how/why it works?

------
pitchups
This phenomenon - of the difficulty of being able to teach something once it
is obvious to you - has the rather unfortunate name - "the curse of
knowledge", and it is well documented based on research in other fields too.
There is a good discussion about it here :
<http://37signals.com/svn/posts/213-the-curse-of-knowledge>

~~~
sopooneo
When I was teaching I found that you have to learn the subject, then you have
to learn to teach the subject. In a pinch some teachers do both at the same
time, and as long as they are bright and it is not an advanced level class,
this can actually work _better_.

------
dreamdu5t
Isn't this common sense? If you've ever tried to teach anyone anything, you've
run into this.

~~~
jgmmo
It's obvious, and they should have known.

In my experience the best people to educate the newbies are the people who
were newbies a year ago. They know what the roadblocks were for them, and the
don't know 'too much' as to complicate things.

~~~
karpathy
It's funny because education is actually is backwards here. You're supposed to
want to be taught by an expert in the field.

~~~
sopooneo
A local maximum will come from those who recently acquired the knowledge. But
truly _great_ teachers, that can consistently reach students of diverse
aptitudes and thinking styles, are made over the course of decades.

