
How can I teach a  bright person with no programming experience how to program? - ekm2
http://programmers.stackexchange.com/questions/96504/how-can-i-teach-a-bright-person-with-no-programming-experience-how-to-program/96506#96506
======
araneae
The top comment is bullshit.

I could not get through those three books but I get paid to program. My code
is repetitive and shitty but I can produce a working web app as long as it
doesn't have to support too many users, and it's fine.

My husband never read any books about formal programming and taught himself
from those random "learn Java" or "learn python" books. He's a mathematician
and programs to write simulations/solve equations, and he gets paid for it
too.

If you can't get through those three books maybe you can't hope to be a
computer scientist, fine. But you can certainly _program,_ in the same way you
don't have to be an English major to read or write.

~~~
mquander
Most programmers write code that other people have to read, maintain, or
extend at some point. If you write repetitive, shitty code, you may be
qualified to write some useful programs for yourself, or write a web app that
doesn't have to support too many users -- which are valuable skills -- but it
is not fine for the majority of programming jobs. Incidentally, given that you
can do what you described, I'm also pretty sure you could get through those
three books if you tried; they are not rocket surgery.

~~~
araneae
My point is that programming is useful in a variety of contexts and you don't
have to be that great at it to accomplish something.

You're right, I probably wouldn't work out at most programming jobs. I do
contract work; the web app I'm writing now I had about 3 weeks to knock out,
will be used by 2,000 people, and will only be used for about a month. But I'm
still a "programmer," because I program.

We're not all writing mongodb or working at Google or whatnot.

~~~
mquander
Well, I agree with that, so I suppose I won't argue any further about it.

~~~
jiss
Cool!

------
RockyMcNuts
K&R is awesome but... C would not be my first choice for a beginning language.

Things like pointer arithmetic, memory allocation, etc. distract from the
basics and high-level concepts.

I would start with Python or Ruby these days. If Python is good enough for
intros at places like MIT, it's good enough for me.

C is a masterpiece of elegance and simplicity and gives you a mental model of
how a real computer works, and it gives you a foundation for understanding
Unix, but I just think it overloads a beginner with stuff that gets in the
way.

came to comments expecting a lot of reasons why Scheme or Lisp was a better
choice LOL

~~~
alextgordon
It's tempting for us, as programmers, to consider Python an easier language to
learn than C. I'm not so sure. Python is simple for programmers to learn
because it uses a large number of common programmery things: lists, hash
tables, classes, modules, etc. Things that beginners won't have a clue about.
C doesn't _have_ any of these.

Sure, it takes a while for you to wrap your head around pointers. But it also
takes a while for you to wrap your head around inheritance. By virtue of being
a smaller language, C has less of these things to wrap your head around.

If you need a dynamic array, you have to build it yourself from what you
already know. Instead of having to learn yet another opaque concept, you're
_reinforcing_ your knowledge of pointers and dynamic memory allocation. Double
benefit!

And once you know C, it can give you a boost towards learning other languages
- most of them are implemented using C! If I don't understand something, I can
always look at the source to see how it works. Since they're implemented in C,
many languages tend to map easily to C concepts.

The same cannot be said about going the other way. A Ruby programmer learning
C has to unlearn all the assumptions and niceties Ruby has spoiled them with.
How much of Ruby is going to be applicable to C?

~~~
henrikschroder
> A Ruby programmer learning C has to unlearn all the assumptions and niceties
> Ruby has spoiled them with.

Only if he wants to learn C.

But why bother? For the overwhelming absolute majority of programmers it's a
complete waste of time.

~~~
exDM69
There's so much existing C code in the world powering almost everything we do
that you just have to know C in order to get a thorough understanding of
computing.

C is to computer science as latin is to medicine. All medical doctors need to
know a little bit of latin

------
mquander
I suppose most of us would give a similar answer as what Joel gave, but I
found this nice pair of comments:

 _Is this really the only way to be a good programmer? I'm someone that wants
to study programming in my spare time and that's a bit of a daunting list for
someone new to the industry..._ – toleero Jul 28 at 14:54

 _No, it is not the only way to be a good programmer. But if three books is a
"daunting list" than you might be underestimating what it is that programmers
do. – Joel Spolsky_ Jul 28 at 15:05

Seriously.

~~~
araneae
Not all "programmers" are Joel. Not all programmers do something hard. For
instance, writing an online survey is not hard. It is programming, but it is
relatively easy, but boring and repetitive. It's also something that is
commonly done by "programmers."

Not all programming is cutting edge computer science.

~~~
icebraining
Most easy programming being done nowadays probably have pre-built solutions
available that you'd just have to configure. Online surveys are a great
example.

------
cek
I am firmly convinced that if you don't enjoy programming you'll never
actually become a programmer.

It does not matter how smart you are.

It does not matter how much you WANT to become a programmer.

So the first thing I do when introducing someone to programming is point them
at tools that will allow them to be productive quickly to see if they "get a
kick" out of creating things with code.

I think Joel's advice to start with C is GREAT. But only if the question is "I
think I love to program. But I'm a noob. I want to become a great programmer.
How do I start to become one?"

~~~
Hyena
I believe this is largely incorrect.

You can learn to love something, largely because you find yourself successful
at it. On other threads you can hear from people who hated math until they
learned logic and they were off to the races. I am sure that programming has
the same thing; in fact, I know programming has the same dynamic. I know this
because there is a steady stream of "how Python/Ruby/mobile apps/ditching my
boss made me fall in love with programming again" which suggests strongly that
one can change affect. Too strongly for it not to be true.

~~~
chrisguitarguy
>You can learn to love something

True. Nothing is fun until you're good at it.

~~~
cek
I agree you can learn to love something, but to say that nothing is fun until
you are good at it is simply Not True.

When I got my Apple ][ in 1980 I was not good at programming. But I had a
freaking BLAST writing AppleSoft BASIC code till the cows came home. Weeks
previously I probably couldn't have even SPELLED programmer.

~~~
wccrawford
Agreed. I've done plenty of things that I was bad at, but enjoyed anyhow.

Programming is first on the list, though you might say I had a natural
aptitude for it. Despite the long road of learning (mostly) on my own, I
enjoyed it all the way. (I say 'mostly' because there was a short programming
class in 4th grade that introduced me to it.)

Bowling is another. I'm really not good at it. With practice I might be, but I
don't practice enough. I enjoy it anyhow.

------
antoncohen
Maybe Joel is right, maybe not. It might depend on the person. At 13 years old
I tried learning C++, at 14 Java, at 16 C.

None of them stuck. Part of it was that the concepts were too difficult to
understand. In which case Joel's list might help, as it is more about concepts
than teaching programming. I think a bigger part of the problem was that it
was too difficult to write anything useful in those languages. After a
semester of C (Intro to Programming) I don't think I could write a single
useful program. If it was a semester of Python I'm damn sure I could write
useful code after it.

I wish a book like "Learn Python The Hard Way" existed back then. It would
have been great to understand the basic concepts of programming, and see the
code actually work. I remember a C class where the instructor was teaching
about arrays. I don't think a single person in the class really understood
what he was talking about. Compare that to Python lists and dictionaries, you
can see them work, you understand what they do and how to use them
immediately.

I'll take Joel's advice and read those books. But I'm not sure they are best
way for people to start.

------
devs1010
Why not make them start in machine language, I mean since they need to learn
how everything works before they can program in the language they choose
right? I find it somewhat funny that C and C++ are the default "starting
point" languages to learn programming when there are still lower-level
languages than these. I see no problem with starting out at a higher level
language and going from there, part of programming is having enthusiasm and
being able to play around. By starting with easier languages, a person's
interest may better be captured and can lead to more self-learning, the way I
see it, the natural progression is to want to learn the harder, lower-level
stuff as you move along in a development career anyways.

~~~
DanBC
_Code_ is pretty much explaining machine code.

------
joshcrews
I'm a bright person, and I learned to program in 6 months with only
"programming" experience being Excel VBA scripts.

Joel's method would have made me drop out and convinced me that programming
was terribly boring-- much like a how a kid who wants to play the piano would
feel after starting out on 6-months of only scales.

I learned so quickly because I loved it, and I loved it because I could be
instantly productive making apps with Ruby on Rails. There was still a lot to
learn, but those things could be learned later "in the field" as they were
relevant.

~~~
ceol
I completely agree. My initial foray into programming was writing sites in
PHP, and I learned a lot about logic, functions, classes, and structuring
projects because of it— and my transition into other languages. Had I said I
wanted to learn to program and someone tossed K&R at me and told me to "work
through it by sheer force", I doubt I would have found the subject to be so
interesting.

Certainly K&R is a must-read, but Joel's advice...

 _"If you can't get through this sequence, you're not going to be able to
program, so you might as well give up now."_

...is terrible. There is more than one way to introduce someone to
programming.

------
sunsu
The first programs I wrote were complex BASH scripts that solved specific
problems I needed solving. I had a friend that was there to help me a long the
way. But the main reasons I continued learning were because I had the
immediate benefit of having my problems solved and also because I had tangible
evidence of my progress. The rest snowballed from there.

I understand where Joel is coming from with his advice, but I don't think I
agree with it. I had read quite a few programming books in the past (C &
Java), muddled through the exercises, and thought I understood the concepts,
but until I dived into solving real problems, I didn't "get it".

~~~
edtechdev
Exactly - that's how I learned programming, too. It didn't matter so much
about the syntax, but what problem you could solve. For me it was a Perl CGI
script for letter writing and earlier a Hypercard registration system that got
me into programming, despite my father and teachers repeatedly trying to teach
me BASIC. Today it might be adding javascript to a page, or customizing/coding
a game using tools like Scratch or Gamemaker.

And there is decades worth of research backing this up (problem-based
learning, situated cognition), but CS education has been slow to adapt.

------
Daishiman
I did this. It's not for everyone, but for a highly motivated person it's not
that hard either.

A friend who's in Med School wanted better working conditions than working at
crappy call centers. I gave him a high-level overview of what programming is
about and threw him the Django tutorial and made myself available for
questions. As I gave him practical requests for useful web code, I delved into
the details of Python and web programming in general, while slowly introducing
him to tools of the trade like the shell, debuggers, and data structures,
trying to make every step of the way easier for him.

Six months later he got a job at a biomedical NGO. He began by documenting and
testing existing code, but now does quite a bit of coding by himself.

I've found that teaching theory along with the tools that utilize it to be a
very good strategy.

------
teyc
I'm surprised no one made any mention of what this bright person knows in the
first place.

One of the best ways to teach is to map known concepts to new concepts. For
instance, I might introduce methods to people who already know what functions
are, but talk about messages to those who don't.

------
derekreed
Yeah, Joel is dead on for how to learn to program. Unfortunately, I think we
need to question that question more.

What folks are often asking when they ask "how do I program?" is something
entirely different.

How do I learn how to make a website? Use wordpress or yola or squarespace.

How do I learn how to make that website look better? Read design blogs, some
starter tutorials on html and css and start diving into the CSS. It's not that
hard a standalone thing to learn.

How do I learn how to make that website do something fancy like fade things
out? Start diving into the javascript in the same way.

How do I learn how to make that website do something functional like send an
email, or save a session? Pick a modern framework (Ruby on Rails, Node on
Express), read/watch the starter tutorials on it, and dive in.

How do I learn how to make that website do something functional and NOT have
it be a horrendous hack job? Time to start reading those programming books :D

Just sayin' it's not always step 1. Depends on what you need to get done, and
what you really want to learn how to do. Yeah?

------
edtechdev
To get some of the concepts of computer science and most basic features of
programming, see:

<http://csunplugged.org/>

<http://scratch.mit.edu/>

For application development, I'd start with an environment that actually tried
to make things simpler for the programmer and showed how you can use
programming to tweak a design first before programming from scratch - an IDE
(see Microsoft's beginner resources <http://msdn.microsoft.com/en-
us/beginner/default.aspx> ) or game development environment (like gamemaker or
XNA).

See also actual curricula for high school or non-computer science students
(CS0 courses), like

<http://csta.acm.org/>

<http://coweb.cc.gatech.edu/mediaComp-teach>

I would not throw SICP at someone who didn't already know how to program.

------
andymoe
Joel likes the sink or swim approach apparently.

The first book, Code - Charles Petzold, is only ten bucks on the Kindle right
now (SOLD) and I own the other two.

I remember SICP being like 90 bucks for my hardcover copy and I'm pretty sure
I bought it after reading the Joel on Software article "The Perils of Java
Schools" while I was loving life as a bank IT guy so this is workable advice.
It only took five years to become a "real" programmer after that. Also I sure
don't remember K&R being $68[1]. (Yes I know SICP and K&R are both online for
free)

[1] [http://www.amazon.com/Programming-Language-2nd-Brian-
Kernigh...](http://www.amazon.com/Programming-Language-2nd-Brian-
Kernighan/dp/0131103628)

[2]
[http://www.joelonsoftware.com/articles/ThePerilsofJavaSchool...](http://www.joelonsoftware.com/articles/ThePerilsofJavaSchools.html)

~~~
aiham
Could you link to a free (and legal) version of K&R?

For anyone interested, I found SICP at <http://mitpress.mit.edu/sicp/>

~~~
skystorm
For completeness, SICP in .mobi format for Kindle:
<https://github.com/twcamper/sicp-kindle>

------
jay_kyburz
I think in addition to studying these books, the student should be put right
to work coding simple tasks. The best way to learn is by doing, not by theory.

The student should get in and start hacking away at some non critical part of
the code base. Perhaps the UI, or some reporting or tests. Something it's OK
to break for a day or two.

Pair them up with a more experienced developer and make sure they do code
reviews. Discus the code and talk about what went right and what went wrong.

~~~
inuhj
Agreed. I wish more books would adopt this strategy: "Ok, stop. To move
forward with the application we will need code that does X, Y, and Z. Here is
the spec that I want you to code for the next step. Work on it for a bit. If
you're having trouble check out our forum for other people's attempts at a
response and you can see 10 ways to solve the problem. On the next page you
will see the code answer and the book will continue with an explanation of the
code."

Even as a beginner you can tackle small snippets of code using the basic
control structures.

~~~
hackinthebochs
>Even as a beginner you can tackle small snippets of code using the basic
control structures.

Sadly, this is how programming books used to be written. Case in point: about
a decade ago in high school we learned programming from a book called C by
example. It had a handful of well thought out programming exercises after
every section. A few years later I went looking for the book to give to a
friend who was starting out. Lo and behold, in an updated version the
exercises were all removed! It's mind-boggling that somehow the publisher
thought _removing_ the exercises was adding value to the book. Perhaps your
average reader feels exercises makes a book seem too technical, so they skip
it for the Learn X in Y hours style books? Nowadays you can't find good
programming exercises outside of a dry textbook.

------
thok
What the fuck?

Here is how I read this thread: Q: How do I quickly get a complete coder
newbie up to speed to support .NET apps? A: Teach him Lisp and C

What a silly, dogmatic, and unpractical answer. No one even bothered to ask
about what kind of work this person is going to be doing, what sort of apps
he'll be writing, what industry he's working in, etc.

Obviously, the company where this guy works is giving him a shot at a super-
entry-level programming job. If he has any hope of succeeding (which means
being productive ASAP) in this job, learning C and Lisp is not going to help
him.

------
iradik
The only well-known language worse than C to start with would be C++. We used
this in high school AP Computer Science before they switched to Java. Spent
about 80% of our time learning pass by reference, templates, and about
segfaults. The other 20% was on algorithms. Made programming seem horribly
complex.

~~~
ajross
Don't knows about you, but I wouldn't consider someone a "programmer" unless
the had a solid grounding in pass by value vs. reference, generic programming,
and hardware memory protection mechanisms. Yeah, and algorithms are important
too.

~~~
iradik
Yes, but not C++

~~~
ajross
I actually don't disagree with your opinion: I wouldn't pick C++ as an
environment to introduce programming either. But your reasoning was frankly
awful. If _those_ are the reasons you think C++ is "too complicated", then you
_really_ need to spend some more time learning C++.

~~~
iradik
You're right, those aren't good reasons for why C++ is awful. I think ERR i
give up. You're right my whole rationale is pretty confusing. The class wasn't
so bad in reality. We didn't really look deeply into the horrible "features"
of C++.

------
antoinehersen
I am helping a friend learn to program. He was doing "Learn Python The Hard
Way" but was loosing steam. I created a project for him to do, a simple ASCII
game: <https://github.com/antoinehersen/ASCII-Dungeon-of-DOOM>. Having a
project with visual and interactive elements is far more motivating. Also it
push you to learn the real skills needed for programing, not only knowing what
a loop is or how to open a file, but figuring what to use when, and how to
organize and connect it all. This experience will create a reference frame for
everything he might subsequently read in a book.

I strongly believe that accomplishing a small scale project that as some value
is the best way to learn.

------
iradik
wow, i disagree! i can't even imagine starting with C. that's like saying the
only way to learn to build with legos is to learn how to mold plastic first.
sure it's possible, but desirable?

~~~
einhverfr
What's the most important thing when learning to program?

My answer: Exacting logic.

C is a great language at teaching exacting logic. "Wax on, Wax off" kinds of
things.....

------
skurry
Learning how to write code is actually fairly easy. Kids can do it. The hard
part is to write code that doesn't make your co-workers hate your guts because
they have to maintain it. I'd recommend getting a copy of McConnell's "Code
Complete".

------
apitaru
I found a simple method that works really well: ask the student to invent
their own language syntax on paper. We start with a simple language that can
draw on screen, and proceed from there.

I'm noticing that Students naturally discover many of the issues and tricks
that they would otherwise have to "study" (such as flow of execution, nesting,
variables)

I occasionally teach at schools in NY, and this semester my students
"invented" the smalltalk syntax. It was heartwarming to witness.

------
Volpe
Weird to recommend not starting on the most relevant language (C#) but instead
with C and Scheme...

Sounds more like "old-hats" regurgitating their learning process.

Why the line is always drawn with C as well, is interesting. Not assembly, not
Java, or Python... but C.

An analogy: Go and learn to use a mouse and keyboard, before you get an
iPhone, otherwise things like the "On-Screen Keyboard" and the idea of
"Touching (Clicking)" things is too difficult to grasp.

~~~
burgerbrain
If you want to get someone hireable as quickly as possible, tell them to learn
C# or Java by all means.

But if you want them to "achieve enlightenment", you've got to get them on
scheme. And if you want them to see through all the smoke and mirrors, and
gaze upon the simplicity that is the machine, you've got to teach them C.
Assembly will work too, _with the proper arch_ (and x86 is not it).

~~~
Androsynth
I completely agree with you. I think Joel was answering the 'how do I achieve
enlightenment' question. Maybe he only considers someone a programmer if they
are enlightened; seems kind of narrow-minded to me.

------
xrd
No one wants to learn to program.

The question is fundamentally flawed.

People want to build _something_ , not learn to program.

To teach someone to build something, teach them how to use the tools of the
trade. No carpenter ever learned the physics behind wood in order to build
their first table.

The answers to this question all come from people with a perspective that this
is what they would do if they wanted to take a bright person and put them into
a developer role at their company. And, they all have the defeatist attitude
that unless you read these three theory books, and spend four months of
intense study, you cannot be a programmer. What hogwash.

Most people cannot take four months off from work and intensely study
programming. But, anyone can learn to tinker on something they care about with
the right mentorship and using the right tools. Anyone can learn to use
jQuery, Ruby on Rails or HTML if-and-only-if the point of doing so is not to
learn jQuery, RoR or HTML but is to build something that inspires them. All
you need is a path with baby steps and inspiration.

------
JoeAltmaier
Inspire them, forget the details. Show them how to get a computer to leap into
life with their creation, and they will take it from there.

Showed my middle son how to animate a java graphic on a website. He never
stopped. Now is a CS graduate student at CM designing/implementing the next
internet routing protocols (and writing Kinect games).

------
scott_s
Give them progressively harder programming problems to solve. Each new problem
should be just _baaaarely_ within their capability to solve, so they are
forced to learn something new with each new problem. Each new problem should
also 1) build on the foundations of the previous problem, and 2) introduce new
fundamental concepts.

I know of no other way. You learn programming by programming. This, by the
way, is exactly what a good CS curriculum will do.

------
untitledwiz
I could not agree more with Joel. To be a good/proper programmer you need to
know C inside out. I would never, ever hire anyone who doesn't understand
pointers.

------
Skywing
tl;dr: If a book were going to teach somebody how to program then you wouldn't
be asking this question. A book requires a self-motivated person to pick it up
and read it. Assuming you're trying to teach somebody who didn't have the
desire to learn on their own, then you're going to have to relate to them and
explain it in a way that they'll understand. Getting them interested and
excited about it usually seems to be the best kick-starter.

You know what? I've actually unintentionally taught several people the basics
of programming. I work at a small company with other bright people who are not
programmers by study, but have learned how to communicate programming with me.
I truly believe that teaching somebody to program is as easy as figuring out
how to best explain something sequential to them. Usually, I begin my stealth
teachings under the guise of me just trying to help them communicate their
program requirements or ideas to me. I quickly jump into the lower level
explanations of things and somehow I manage to get them excited or interested
enough that they actually feel like talking "programming" with me will be
cool. I try to explain to them that programming is like giving the computer an
ordered list of things to do, and it'll do them exactly in that order. As
simple as 1, 2, 3. I then explain loops. I don't get into functions and
classes because that's not necessarily important to them understanding the
flow of logic. Most people seem to easily grasp the concepts of if-then, and
loops ... this is all really simple stuff for most people to understand at a
basic level. I don't even necessarily mean code, but more so logically what an
if-else means. I find that most people generally give you the "yea yea I got
it" type of response while explaining this. Once I get them to this point,
they're where I wanted them to be. I then try to include them in scenarios
where I'm debugging something. I don't deliberately ask them to help me do my
job, but I more so start talking out loud and usually they'll come over to
help brainstorm. I show them my code, and explain the logic flow (if-else,
loops, etc). You'll be surprised at how easy it is for people to actually help
out here. Sometimes it's the non-programmers who can give the most obvious
advice. At this point in time, it's up to them. If they're interested enough
they'll progress from them, otherwise it may just no be their thing. I work
with 8 people, and I have actually had one guy learn Python and he now writes
Python tools for us - he knew zero programming. I also got our accountant into
programming because he would always ask me the status of projects, and slowly
over time I got him speaking "programmer-speak" with me, and now he basically
understands all my programming yammer. I realize that these guys are not
writing the next Redis or Twitter, but they were non-technical guys who are
now on their way to being on their way to writing those things. :)

~~~
stfu
Great posting! You actually have an idea of how to self-motivate people in
order to learn something. The suggestion "come back after reading three books"
looks to me as one of the best ways to make sure that they will never ever
become interested in coding again. It is like telling a person interested in
learning a language that they should come back after learning the dictionary.
Just completely inable to relate to non-coding people.

------
yason
On a generic level, the best way to make a smart non-programmer write programs
is to describe how to do it but not tell them it's programming.

------
zachgalant
I'm pretty sure this is the only way: <http://abstrusegoose.com/249>

------
darasen
I would think that the Stanford open class CS106a with Prof. Sahami would be
an excellent start.

~~~
rufibarbatus
Playlist: <http://www.youtube.com/playlist?list=PL84A56BC7F4A1F852>

Course resources: <http://www.stanford.edu/class/cs106a/cgi-bin/>

------
HilbertSpace
[http://www.avc.com/a_vc/2011/10/program-or-be-
programmed.htm...](http://www.avc.com/a_vc/2011/10/program-or-be-
programmed.html#comment-351671965)

"To get 'skills' and expertise in the technical parts of computing, especially
for Web 2.0, here is an outline in 8 steps:"

Also it happens that that post, like the OP, is aimed at .NET.

Also the post emphasizes just one book which has introductions to HTML, CSS,
Visual Basic .NET, ASP.NET, and ADO.NET, including relational database normal
forms, and contains nothing on 'algorithms' such as in Knuth's TACP or
subsequent, similar books. Also the post has nothing on C, C++, Java, Python,
PHP, Ruby, or Linux.

