Hacker News new | past | comments | ask | show | jobs | submit login
Khan Academy: Computer Science (khanacademy.org)
307 points by keiferski on Nov 1, 2011 | hide | past | favorite | 181 comments



High school CS teacher here.

I really hate taking shots at Khan Academy, because I love what they do and his other videos have really helped a lot of my students in chemistry, economics, etc.

However, he's moving through the material MUCH more quickly than I've ever been able to do as a teacher. And I get nearly 5 hours a week of face time with my students.

For example, his third lecture is on for loops. My students, on the other hand, complete literally 80 assignments before beginning for loops. And they still have some trouble.

Admittedly I'm using Java, and Python is simpler, but I think he's VASTLY underestimating how slowly you need to move through seemly obvious concepts for the average total beginner.


My students, on the other hand, complete literally 80 assignments before beginning for loops.

80 assignments? What are these assignments? Are you teaching them how to use recursion before looping in Java? I get that Java has some ceremony, but not 70 assignments worth.

The first day I learned to program (with BASIC) I learned looping. I didn't know the details of it (like there was an index variable I could access), but it was as easy as anything else.

Seriously, what are they learning before looping?


How to use a compiler. Basic shell of a Java program. That statements occur in a sequence. Practice with getting details right. Mathematical expressions. What variables are, and how assignments to expressions differ from formulas (in Excel, say). If statements and conditions. The concept of "incrementing" a variable or accumulators in general. Loops in general.

See for yourself: http://cs.leanderisd.org/current/cs1/assignments.html


Wow. Not quite 80, but still an order of magnitude more than I would have expected. Interesting they learn Swing before loops. For me, the first thing I learned was printing, then goto, then for-loop. Maybe just a function of language you learn with.


Yeah, it's 70, not 80. Not sure what I was thinking there, and now it's too late to edit my original comment.

Anyway, the "Swing" assignments are there in the sequence for four reasons:

1) To break up the monotony a little bit. 2) To give them more practice copying details accurately. 3) To make them say, "That was kind of cool." 4) To explain why we're not doing "real" programs (a.k.a. GUI) yet. "It takes that much code just to display a blank window on the screen? Guess I can live with the command prompt a while longer."


Yep, me too. Of course, that was in BASIC around 1983.


I learned ruby in 2006-2005 as my first programming language. I don't remember loop being all that difficult to learn.


time-travel ftw!


In 2005 Ruby 1.8 was already out, I don't get your comment...


I think the stupid joke is in the 2006-2005.


Self-taught-programmer here.

I've done a lot of pondering about how to teach programming because I tried to learn several times myself, both on my own and in classes.

I bounced off each time, until finally sticking. I always wonder what made it different that last time, and if it applies to others.

===

Have you considered starting with something with less conceptual overhead than java-in-a-shell? There's so much you need to understand before you can even get to writing code that way. You need to learn how to start and navigate a shell on your computer (different on each type, and depends on your system configuration). You need to learn about paths, and java versions, and sdks, and what 'compiling' even means, and the concept of source code vs a binary.

This doesn't seem like much to people in the field, but I remember it being really intimidating.

In contrast, I really love codecademy.org:

http://www.codecademy.com/

You're writing code within seconds. You can access it on any computer and it always works the same way. Which is to say, it works like any other web site. You start seeing things happen right away, and you don't need to understand all the infrastructure initially.

===

I feel like getting people to that first high where they see their code generate output is really important. If you can get them quickly to feeling a little bit of that power that comes from software, that starts the fire, and they'll have more motivation to figure out terminals and paths and verisons and OSes and everything else.


I agree. I don't get to choose whether or not I teach Java; that's determined by the state. However, in my class, we write our first working program on the first day of coding.

We install the JDK, do a basic DOS primer, type in our first program (in Notepad), and compile and run it on the command line in a single 90-minute period, like the 3rd day of class.

Getting to the "bang" as quickly as possible is HUGELY important.


Do the students move on to using an IDE? I realize that Eclipse or Visual Studio comes with a lot of overhead and you can easily spend a whole semester getting bogged down in all the options, but I would think that an editor with syntax highlighting and parenthesis matching would make a big difference.


Yes, I only make them do the first ten assignments in Notepad and a command-line compiler. Then we switch to JCreator, which is a pretty unremarkable IDE, but it does have syntax highlighting and a few other niceties that make it a much more efficient code editor.


I think the online classes with ready-to-go coding insie the browser are something to be really excited about. They lower the barrier into programming by so many levels...


I agree. I LOVE the python-in-javascript REPLs, but so far NONE of them have console i/o. (Python's raw_input command isn't implemented, for example.) And that makes these a non-starter for my courses unless I completely rewrite all my assignments. And that's a HUGE time investment for an uncertain payoff.


Initially, I thought this sounded ridiculous. But when I look carefully at what you've done, I'm impressed by your thoroughness. I think you have an excellent course for weak-to-average students.

I do wonder if your most able students might appreciate more opportunity to "play" and be creative, but in all honesty, they just need to stick with it into the Project Euler stuff at the end.

Is this a whole-year course?


First, thanks for the kind words. This curriculum has been relentlessly pivoted and iterated based on feedback from over a thousand real students for the past fifteen years.

Yes, this is a whole year (36 weeks).

The material you're seeing is only the intro material, though. I teach three other courses, including video game development. The faster students are encouraged to skip assignments if they're coding something they already understand, and they get bonus points if they do something creative with an existing assignment.

I've tried to optimize for the normal case: the weak-to-average student. The great ones however, don't need much help from me to learn a ton very quickly.


Your CS curriculum is much better than my schools! I just started my first year of Computer Engineering and the Java course so far is horrible compared to this.

I'm a bit disappointed to be honest.

I am very glad I already have been coding for years because our teacher and the planned curriculum seems to confuse people even more.

I think I will refer some people to your assignments, if that's okay? Hopefully someone can learn more from this :-)


I'd be honored for you to point some folks at my assignments, although please only share the link one-on-one: a few of the assignments on there (the ones with an author of "Stacey Armstrong") are part of a curriculum that our district pays to license. Technically I could get in trouble for having his assignments on a public website without permission.


Interesting schedule. My school's AP Comp Sci A class (also teaches Java) is designed for people who are completely new to programming, but we are introduced to loops fairly early. After first being introduced to the different variable types, mathematical expressions, and how to read user input, the students jump directly into boolean, if, switch, and then the for/while/do-while loops.


How many kids take the class? How many do well?

I have 75 kids in three sections, and I'd have 100 kids in four sections if they'd open up a fourth section. And all of my students except maybe the bottom 5-10% are moving confidently through the material at their own pace.

I'll bet your school either has 1) a lot fewer students 2) a much more hand-picked set of kids, or 3) is leaving a much higher percentage of kids behind, who are either lost or cheating.


We only have 12 students. I'd estimate that of those 12, about 6 do well in the course. Of the remaining 6, only 1 or 2 are actually struggling with the course.

My school is a small (~130 per grade), but renowned international school in Shanghai, China. Your first two guesses are very much spot-on, but I'd have to disagree with the third. Those of us that are ahead help out with the one's who are struggling and in the end, I'd like to think that it all works out well.

With that in mind, however, your numbers are indeed more impressive. Because our class size is so small, we're constantly involved in face-to-face interaction with our instructor and with our peers. I doubt our pace would translate into the same success in your school. Is your course designed for the AP exam?


We learn to read before we learn to write well. Why do we start out writing programs?

I've always thought programming classes should start with reading and understanding a program that has some loops, assignments, etc. Maybe a program that draws some shapes or parses/prints some strings. Then have students modify it some. Then afterward, start writing your own stuff from scratch.


It's an interesting idea, but I disagree:

I think you remember things much easier if you write them out (and have to make them compile/execute) yourself. If I read some code in a language I haven't encountered before, I find I don't absorb any of the little details of syntax.

Moreover, I think it makes sense to expose learners to the fun of programming early. And to me that means seeing something that you wrote running.


According to my parents, at the public elementary school I went to for first grade in Toronto, Canada they taught writing before (or at least concurrently with) reading. Each kid had a diary in which we would at first draw and eventually write about something that happened each day. Kids would start with just pictures and gradually add more and more text. I don't remember any of this, but I can still read and write English even though we moved back to Mexico the following year, so I guess it worked.


Your point seems detached from reality. You don't learn any language (native or foreign) just by reading it for months. You are instructed to use it yourself and create sentences, paragraphs, essays, and speeches. You build up your writing skills in tandem with your reading.

Perhaps you don't write well until you've read a lot - but nobody expects you to write well as a novice.


Heh. From the way I've heard some parents talk about Leander ISD, I would have figured the kids would have for loops down by 4th grade. :)


I wish we could start teaching real programming in middle school at least. I think just variables, if statements and some sort of looping construct ought to be mandatory in education.


Thanks for posting that. I love how thorough and paced it is. I'm definitely bookmarking that link, as well as /cs2/assignments.html


You're welcome. Happy coding!


SICP doesn't introduce assignment until two hundred pages in.


And, if I remember correctly, it never introduces loops.

On the other hand, you learn about laziness, higher-order functions, deterministic and logic programming and how to implement the aforementioned, on top of a bunch of stuff you would learn in a Java class like recursion, OOP and networking. All this in the first four chapters; the fifth one introduces a low-level register based language but my class never got to it :( It is pretty cool.

Ultimately, SICP just has drastically different (and I think better) priorities and topics than any course taught in Java or Python. I also suspect that a good SICP course moves even faster than the material here, simply because of the sheer density of big ideas in the book and the simplicity of Scheme.


Assignment isn't idiomatic in functional programming.


The functional programming is a side effect of the desire to teach computer science in a low-friction way. It's nice to not have to also teach Java along with your CS concepts.

I know that when I teach myself anything it's best to focus on one new concept at a time. Scheme's light weight allows all but the CS concepts to fall away from the new coder's consideration.


The functional programming is a side effect of the desire to teach computer science in a low-friction way.

And why not code in a low-friction way even when not being taught? I wasn't intending to defend FP, but I think it's silly to think of assignment as a fundamental part of CS or the art of coding. It's just one tool.


When I first learned programming YEARS ago starting with Acorn BBC Basic it actually took me quite some time before I learned how to do 'proper' loops (e.g for , while etc).

I was initially far more interested in how I could change the colours of things on screen and get the speaker to make funny noises. Most of what I wrote were text based adventure games so I didn't really need to loop very often.

When I did need to loop I just implemented this using a conditional IF with a GOTO that jumped back to the start of the "block" (I kept paper notes as to which line numbers each subroutine started on) if required or continued to the next line of code.

Later when I started using MS Visual Basic and figured out how to use GOSUB I would do loops essentially with recursion that would call the same subroutine again if required.

It wasn't until I decided to learn C and php that I learnt about real loop structures. At this point I assumed that everything I had done before was stupid and wrong, it was not until I took formal CS classes where I was introduced to recursion and assemly language (JMP and JE) that I realised that pherhaps I hadn't been quite so naieve before.


This goes to prove that java is a pretty bad language to teach pogramming.

in logo this is how you draw a square forward 100 Right 90 Forward 100 Right 90 Forward 100 Right 90 Forward 100 Right 90

Then in the second lesson you introduce loops repeat 4 Forward 100 Right 90 End

then you ask kids to draw hexagons octagons etc. and they will never forget what a for loop does.

Edit changed repeat 8 to repeat 4. Thank you.


You could do that in Java if you just imported a turtle graphics library. A quick search brings up one such library, http://www.bfoit.org/itp/JavaTurtleGraphics.html. I agree that Java is a hard language to learn with, but its faults are not related to being unable to use turtle graphics as examples.


No, you couldn't. Did you look at that link? You have to wrap all this OO ceremony around it.

I don't think it's optimal to make someone type

  class Cross extends TurtleGraphicsWindow { public void myTurtleCmds() ...
at the start of every program when they don't yet have the background to understand what a single one of those words are for. It instills a habit of doing crazy shit mindlessly to try to satisfy the mysterious computer.


I remember learning Java for the first time. I literally thought of "public static void main(String[] args)" as an incantation I just had to know. It took some practice to memorize it. It took far longer to actually learn what it meant.


My point is that there are good tools to learn programming. I think that there are languages in which difficult concepts befome easier to explain. logo being the prime example of such a teaching language.


Repeat 4 (right?)


I’ve been programming professionally for over ten years, and when I have to look at Java code that other professionals have written, I am constantly irritated by how the actual point of the code is buried in… mquader’s “OO ceremony” label elsethread is an apt phrase, although “Java ceremony” might be more fair. It wouldn’t surprise me at all if high-school students learning Java as their first language got confused much more readily than students learning Python (which was, after all, originally designed as a language for teaching OO concepts).

Of course, the College Board, in its infinite wisdom, has decreed that the AP Computer Science tests be given in Java. I suppose we should be grateful that they no longer do it in C++.


>>... Python (which was, after all, originally designed as a language for teaching OO concepts).

This isn't quite right. The teaching language was ABC, a different project that Guido worked on. Python was his own language, created for the Amoeba project (an OS research project), inspired and influenced by, but not the same as, ABC, which was not object oriented. Guido says that the purpose of python for the Amoeba project was to: "bridge the gap between C and the shell"

http://en.wikipedia.org/wiki/ABC_%28programming_language%29

http://python-history.blogspot.com/2009/01/personal-history-...

However, if you have additional information, I'd love to hear about it. I've heard the "Python was originally a teaching language" several times, but as far as I can tell, that's not actually true.


You actually write very little code for AP Computer Science. If I recall correctly, the test tries to bring OO abstractions into the standards using Java's classes and wrappers, which should be a pretty good filter for dumb unpatterns like 'Car inherits from Garage'. So there are questions like 'How do you design this class hierarchy?' or 'Trace this code, what are the values of x...'

I don't think there was ever any of the boilerplate required to make a Java program actually run. When I took the exam, I'd never compiled a single line of Java in my life (yep, there are far better ways to get things done).


I'd bet $100 that the AP exam will switch to Python within ten years. And probably not much more than 5.

(No sooner than that though, or they'd have to have announced it already; major changes in public education need a LOT of lead time.)

However, I'll disagree that Python would be that much easier than Java for a beginner's course. It's lower-friction, to be sure, but the VAST majority of student difficulties are with precise logical thinking, not with the syntax.

Decomposing a problem into discrete, correctly-ordered steps is the core difficulty. This is unrelated to syntax.


I think that just starting out with the assumption that OOP is the "one true way"--AP CS really comes across that way--is flawed. A languages like Scheme would be a much better choice for an intro CS class.


Worse than “OOP is the one true way” is “OOP is the one true way and Java’s style of OOP is the one true OOP”.

I’ve heard of a CS curriculum that starts by teaching Scheme and ends with a segment on “OK, now you know how to program in Scheme, here is how to do it in Java”. I don’t know if that can fit in one high-school class, though.


I think there is a world of difference in the "average total beginner" high school students taking a class to meet a district mandate, and the "average total beginner" self-motivated learners actually interested in computer science.


My class is an honors elective, fulfills no state requirements, and there's a waiting list to get in. My kids are already pretty motivated.

You really, really have no idea how difficult precise logical thinking is for an average person.


What other languages have you used? Im starting to teach an intro cs course n highschool next semester and would love to hear some real experiences on this.

have you looked at: etoys scratch starlogo alice or scheme ?


I'm doing scratch with some middle school students (grade (6-8). Most of them got looping within a class or two. Hell, we had kids doing chase games in the first hour and a half of messing with it. Oe of the kids now is working on space invaders, and star ting to get where scratch falls down on maintainability and repeating onesself. and the royal pita it is when you can't type in things, and have to rely on shaky mouse movement.

At some point soon, I'm planning on moving to something where they can distribute what they're doing, either as JavaScript, or pygame, or something. I'm hoping to be able to literally translate a scratch program to the n+1 environment so that they can see the equivalence of the looping constructs and the event handlers and everything else.


I think JavaScript would be a great option here: you could have them show off what they've written online, the language makes drawing pretty pictures and the like relatively easy and JavaScript is simply a nice language overall.

I can't imagine anything that would have pleased me more than being able to show off my own web site when I was that age. Of course, making silly web sites for myself is how I got into programming in the first place, so I'm probably biased ;)


Right now, The plusses on javascript are:

* Runs everywhere. It's the BASIC of this age * It's not that bad. * They can do stuff their friends can see

I'd rather do python, since it's that much cleaner, less curly braces and semicolons and better loops. But, the results aren't as public, and it's a harder environment to set up. And given that I have to work with the school's IT, I think I'm going to be lucky that we can load chrome on the system.

So, clarity for teaching, or ubiquity. Still deciding.


The other high schools in my district do a more breadth-oriented first-year course using Scratch, Jeroo, Alice and Python, and that works pretty well for them.

I will say that Stacy Armstrong's "A+ Computer Science" curriculum is quite good and well worth the money.

I've taught Pascal and C++ before, and dabbled in Scheme, too. In my opinion, Scheme is lower-friction than Java, but precise logical thinking is hard in any language, and precise logical recursive thinking is even harder for the average student, which negates any syntax-related benefits.

My kids are very successful in Java, and so I'll stick with what's working until the College Board changes the language of the AP exam on me.


I think Khan is moving too fast through them, too. Have you tried these:

http://www.thenewboston.com/?cat=40&pOpen=tutorial


I have been using these to learn programming (Python specifically, which is my first language). I am curious as to what others think of these tutorials if they've seen them before?


I taught my 6yo for loops in the first lesson using Scratch, but I think our treatment may have rather less rigorous/complete ...


I guess that I taught myself programming from a book makes me a kind of super genius? Or maybe frontal teaching simply is not the right way to teach programming?


I taught myself programming from a book, too. We're super geniuses, yes.


I taught myself programming from outdated JavaScript tutorials. What does that make me? (Probably a little crazy.)


I wish I had a CS teacher go that in-depth before covering loops. My first CS class was in c++ and the material came off as extremely unintuitive (like what the hell is int main()?!?!). Learning CS is definitely a slow process. Actually understanding CS took me as long as understanding music theory enough to be able to improv/solo on a musical instrument (piano and guitar in my case).


If I may ask, what is your credential in? There seems to be quite a mess in regards to how to get in to the field since there doesn't seem to be a computer science credential, and coming in with a math credential will almost certainly get you assigned to teaching math classes and math teachers are always in demand.


I've got a bachelor's in CS, and teaching certificates in both mathematics and "computer information systems", which was what the CS certificate was called 15 years ago.

There is now a teaching certificate in just "Computer Science", although it wasn't offered in Texas for a few years while they were switching from one to the other.

Other states vary widely, I'm sure.


Isn't a core credo of teaching that you should first draw the wide vistas so students will have an easier time comprehending where all the details go in the big picture?

It seems that you would at least mention loops early on, to tell them that repetition is something a computer is very good at.


You seem to imply the speed at which the Kahn Academy teaches loops is a bad thing? I'm catching that vibe from your post.

What if the Kahn Academy is teaching the concept in a more clear, concise way than you are? Maybe Java isn't the best language to teach these concepts? Maybe your lessons could be more effective? I don't know what your particular situation is, but I encourage you to play around with your lessons to see if you can teach it as fast as the Kahn Academy. Then again, they could have it totally wrong.


It's unlikely that Khan Academy's curriculum is better than mine. My curriculum has been relentlessly pivoted and iterated based on feedback from over a thousand real students for the past fifteen years.

I've taught literally one thousand teenagers to program, face to face. I'd be shocked if Salman Khan had taught even a couple dozen students face to face.

Edit: I accidentally submitted this too early, and then replied instead of editing. See my reply for the rest of this thought.


So what I'm suggesting is: take 200 students, and have 100 go through Khan's material, and 100 go through mine. Khan's kids would finish faster.

Then, have all 200 kids attempt to code FizzBuzz on their own, with no assistance. I think probably 60-70% of my students could get it working. I suspect less than 20% of Khan's would have understood/retained enough to get it done.

You are in the 20%, so it's hard for you to see the difference. Salman Khan is in the 1%, and he hasn't been in the trenches long enough to see the difference.

That's what I'm saying.


He does say that java isn't his language of choice, but it's one he has to stick with. But if you've got a CS course as introductory to programming than his assignments go a long way to learning stuff. Bear in mind that this is not a class designed for elementary or high-school students, but for college, for people that really want to learn how to program, and how everything works.


My class is a high-school course. Not sure if you're suggesting that Khan Academy's material is pitched at college students, but I don't think that's true.


I've never used a Khan Academy video but that's out of pure negligence on my part, not skepticism.

That said, I have always wondered how effective video is as a teaching tool for programming? I guess when I think about it, it's the same delivery tool as an in-person lecture, but in some ways, more effective since you can pause, rewind, etc.

See the comments on this article about how to do a Fibonacci recursive example (which seems to be well done; the teacher takes it as slow as humanly possible): http://www.khanacademy.org/video/recursive-fibonacci-example...

The top comments are from people not knowing the difference between the equality and assignment operators:

"Why do I get an error with a single equal, but not with a double? This is what hung me up for a while."

...I don't know the history of this particular user, it's possible he/she skipped a bunch of the basic lessons and decided to learn recursion...but I wonder if there's a better way to somehow make sure people get the basics down, in an online teaching environment.


> That said, I have always wondered how effective video is as a teaching tool for programming? I guess when I think about it, it's the same delivery tool as an in-person lecture, but in some ways, more effective since you can pause, rewind, etc.

I've dug up a lot of papers on effectiveness of teaching strategies in physics in particular (since I'm a physics student), and it seems in physics that your time spent working practice problems and making predictions about experiments is more important than actual lectures.

An example:

http://www.sciencemag.org/content/332/6031/862.abstract

If anything, I think the Khan Academy is best suited for a mixed approach where students watch lecture videos, then attend a problem session or help session to work examples, get help on exercises, and so on. The Khan Academy's exercise framework is an important step in this direction, and I hope they continue to improve it.


I remember I first bought a Java book to learn to program when I was around 15-16. I tried for days but couldn't figure out why the first example program wouldn't work, it was because it wasn't System.out.print1n but System.out.println. In the font the code was written in, I couldn't tell. Because of that it wasn't until at least a year later that I didn't try again.


Exact same thing happened to me when trying to do my first cs problem set. It was some filename that I was sure had a 1 in it but it was an l. It's almost as if courier tries as hard as possible to make the two look the same.


Courier was intended to look like a traditional typewriter font. For many decades, most typewriters didn't have a key for 1 (one), you were supposed to use the lower-case l (ell) instead.

Teletypes did have a one key, probably because they were all-uppercase, so there wasn't a lowercase ell available.


Happened to me while learning C++. endl or end1...so confused.


Good point. That's why I am big fan of teaching "Computational Thinking" before any specific programming language. Personally used Scratch (from MIT) to teach my nephews and niece. It worked well to cement their core concepts.

http://scratch.mit.edu/ http://info.scratch.mit.edu/sites/infoscratch.media.mit.edu/...


Do you know of a basic introductory course using Scratch so I don't have to ad-hoc it so much? We're supposed to be building a game but I need something, like KhanAcademy, that I can give my primary-aged son space to explore by himself without me hovering over him.


You may want to refer to the curriculum link I posted in the thread below. I don't think it is sufficient for what you are looking for. In fact, these days I am spending time on developing such a course (actually it is more than just programming; it includes intro to hardware and communications). Happy to share it with you when it is done. Also, would be open to receiving suggestions for it (based on your experience)


I'm pretty much winging it with the Middle Schoolers. Normally I throw a quick demo up on the big screen, talk about it for a couple of minutes pointing out what it does that they were struggling with in the last class.

Then they work on doing something interesting while I answer questions and ask "What happens if...".


In case you are interested, there is a curriculum that ScratchEd team has developed. http://scratched.media.mit.edu/resources/scratch-curriculum-... Personally, I also "wing it". I encourage them to come up with ideas for games, animations that implicitly requires them to cover all aspects of "computational thinking". It's implicitly because I don't want them to think of this as too academic; let them have fun while learning (for a change!)


Looks interesting -- they posted that a week or two after I was searching. We're heavily into animations and games right now, including one where the student is building up space invaders, one complication at a time.


My nine-year-old son learned Scratch last year. Oh, if only I had that when I was nine....


>I have always wondered how effective video is as a teaching tool for programming? I guess when I think about it, it's the same delivery tool as an in-person lecture, but in some ways, more effective since you can pause, rewind, etc.

It's a lot better than some of in-person lectures I've taken, but maybe that's just me. I've been encouraging my peers to use online videos as a source to learn stuff they have a hard time grasping in class for quite a while. They don't listen, but that's another matter...

Anyways, I'm glad Khan Academy is coming out with this. I was freaking out when I couldn't solve some project Eular questions, and pretty much lost all of confidence in my programming abilities for a while. Online tutorials helped me a lot, and I think I've become a better programmer because of that.

One small nitpick: I haven't seen the videos yet, but it looks like they'll be in python. I'd rather it be C or C++. From what little I know of the language, it's pretty easy to pick up, and doesn't put pressure on the programmer to take care of details like memory management etc. I know for a fact that many algorithms that I've implementer in C++ that take over 100 LOC, I've found solutions online that have the same algorithm in 20-30 LOC. Used to irritate me a lot. :P


C or C++ are definitely not a good idea. The beginners' brains will be too occupied with curly brackets and semi-colon. There's also the brain-dead notation for types (see function pointers). The poor souls already have a hard time differentiating assignment and comparison, just because of counter-intuitive notation (compared to high school).

As experts, syntax doesn't annoy us. We see past the curly brackets (or the parentheses), because we can quickly see the internal AST that derive from them. Beginners can't.

Now, it would be wonderful to teach them a systems language that forces them to manage their own memory. I think a good candidate would be to keep most of the semantics of C, but simplifying its syntax (and find a solution to simplify includes).


Yeah, but I still advocate the use of C++ over Python. Just because of the fact that I can now appreciate what goes on under the hood instead of groaning that why should I learn it when the "language takes care of it". Many classmates of mine really enjoy Java because of they had learned C++ first. It's a harder learning curve, but I think it's worth it.


If you have to, pick C. Never ever touch C++, especially its standard IO library. Classes are of very little interest anyway (C easily emulates modules), they can learn it later.

There is a crucial point that should not be ignored. The first two languages someone learns should be easy. Monstrosities like C++ give the poor beginner the impression that learning any language is hard to learn, and that would discourage such learning in the future.


I agree with you 100%, if you're learning to program on your own.

I disagree 100%, if you're talking about a college curriculum. The intro class at my university [1] used C, and I'm incredibly grateful. If I hadn't been forced to grok pointers and malloc, I'm not sure I ever would have (I haven't done any C programming since then). But even though I'm not writing C directly, knowing how things work at a lower level has helped me understand all sorts of concepts in higher-level languages.

[1] http://cs50.tv


Err, I agree with much of your "I disagree" paragraph. Maybe you should re-read my previous comments.

I don't loathe C nearly as much as C++. I understand that learning about low level is useful. Pointers are indeed a very important concept (though not so difficult once you understand that variables themselves are already a form of indirection). So is Manual memory management.

But if you are tempted to put C++ in the same basket, don't. C++ is a very very different language from C. Sure, it looks like it just has some additional features here and there, but those features make C++ practices very different from C ones.


I disagree. I don't have any data to base this on, but I think it would be easier for a new programmer to learn logic first and then worry about what goes on under the hood. There are plenty of reasons to learn C aside from just to know what goes on at a lower level.


> "I was freaking out when I couldn't solve some Project > Euler questions, and pretty much lost all of confidence in > my programming abilities for a while.

I've read way too many people online suggest Project Euler as a way to "teach yourself programming". This is almost a sadistic suggestion. Project Euler is way too hard to teach yourself programming.

Evidence: nearly 180,000 people have solved problem #1. Only 76,000 have solved problem #10. Losing 60% of your audience by problem #10 is pretty bad question design for learning.

Anecdote: I've been programming for over 25 years. I was near the top of my class in a top-10 computer science university program. And I've solved 30 Project Euler problems in the last 3-1/2 years. But I still can't solve problem # 18. I've worked on it off and on since December 2007. Only recently, quite by accident I learned that it is probably a "dynamic programming" question, which is something I've never done before.

Never lose confidence in your coding ability because Project Euler stumps you now and again.


Kahn makes a big mistake in pronouncing the assignment operator as "equals" in the first video. The assignment operator should be pronounced as "gets".


I think I'm going to steal this for my Python classes. I usually say "is" or "is now", but "gets" I think is a more adroit phrasing. Cheers.


Personally I prefer "becomes".

"David Gries recalled a time when he was lecturing with Dijkstra in the audience when he read "x=a" as "x equals a". This is of course a short hand for "assign a to x" and not a statement that x really is logically equal to a. From the back of the room Dijkstra shouted "becomes" and the room fell silent. Gries thought about it for a moment and said, "Thank you Edsger, for correcting me. If I make the same mistake again, stop me." Everything went fine until twenty minutes later he made the same mistake when the shout from the back of the room came again - "becomes". Gries once again thanked Dijkstra and claims to never have made the mistake again."


I also say "becomes".


gets is, unfortunately, a common function name for string input, so I avoid it.

The first language I was taught was Object Pascal, and the assignment operator ":=" was pronounced "becomes equal to".


When I read it in my head, I read it as "let". As in "x = 5" -> "let x be 5".


In my head, I reserve the word "let" for immutable bindings. Or at least local bindings that people probably aren't going to mutate. I read it as "x equals five".

So, between three of us, we saw that simple line of code in three different ways. I wonder what other people see in more complicated code.


The point is that if you pronounce if(x=5) and if(x==5) both as "if x equals 5", then you are making things confusing for students. You as the teacher are saying the exact same words, but mean two completely different things. Kahn made this mistake and there are student comments showing the confusion.

Not correctly understanding assignment is one of the biggest failure points for beginners learning programming. The '=' operator has little relation to '=' in any form the students have encountered before. It means something like "evaluate the shit on the right hand side, and store it in a variable with the name on the left hand side". That meaning is not really even close to the meaning of the english word "equals".

You can personally call it whatever you want, but if you want to be a good teacher to beginning programmers, then you don't call both = and == the same thing. "x gets 5", "set x to 5" or "x is now 5" are all acceptable, but "x equals 5" is not acceptable for teaching purposes.


I note that the biggest mistake probably comes from C itself. If only it had chosen for assignment a syntax such as :

  x <- 5;
It would be more clear that "the shit on the right" goes to that garbage on the left. But no, they had to use the `=` sign, as if saving one character where more important than not changing the meaning of one of the most used sign of all mathematics. And now nearly all popular language is making the same damn mistake.


The only thing I liked about PL/SQL back in the day was its use of := for assignment and = for equivalence.


I pronounce "==" as "equalsequals", sort of slurring the two words together for speed, so they sound like all one word. This is consistent with the way I treat the bitwise-versus-boolean operator confusion, e.g. "&" is "and" while "&&" is "andand".

I agree with your main point, though, that failure to understand assignment is one of the biggest failure points for beginners. What programmers need to be able to do is trace through the execution of a program in their head, thinking "once this statement executes, the state will change in so-and-such way."

If I had to teach introductory programming again, I would focus more on having people fiddle around with variables in a REPL, just to get a feel for that sort of thing.


'x equals 5'. or something like 'the value inside x is now 5', an important view for me, when was learning c++'s pointers.


(idk how to edit) im just fine with 'x = 5'. lets see 'x = 1+1'. then the 1+1 will be 2, and then that value will be in 'x'. so, after that, 'x equals 2', right? or 'x equals 1+1'.


I found video to be every effective teaching tool for programming. I don't know why, but I can read something 10 times and didn't get it but If I see video covering the same material it clicks.

The only thing I don't like about video is that I can't do search for it. Sometime they show you a piece of code and you don't remember exactly where, you can't easily go to that part of the video.


Video search is coming along quite nicely. In one of my previous jobs, we employed Everyzing and the results were pretty good.


I've wondered this too. I wonder whether "doing" with some hints like Code Academy or watching videos and then doing is more helpful for programming and then how that applies to other disciplines like writing, math, etc. Seems like eventually we'll find a way to converge where I can do both side by side.


No matter how you slice the education process, you're always going to have instruction and practice.

It seems Khan Academy has a great model for instruction and Code Academy has a great model for practice; it seems reasonable to posit that a combination of the two would be superior to either one on their own.

I would further posit that the blend between the two models of instruction and practice would be something that might be tailored to the learning style of each individual student. Some people learn well by understanding before doing, others by doing first then understanding.


Code School (i.e. Rails for Zombies) is a combination of the two! It's not quite what you're hoping for, though (it's always Instruction then Practice, rather than giving you the option to mix it up).


I've had a lot of success with the tutorials at thenewboston.com The instructor there explains everything in a very ELI5 (explain like im 5) manner and tone and it works very well for beginners like me.


That's awesome, but I think it would be much more accessible for newbies if they included download links and installation steps. I have friends who might be interested in this for whom just the installation could be a daunting hurdle.


Agree.

To me the biggest hurdle in programming is not the programming itself but the sys-admin effort to setup a development environment.


I know this is a shot in the dark, but if you're a Rails developer, use Heroku. It takes a lot of pain out of an applications deployment.


development environment, not deployment. You're certainly right about deployment but it's sort of a non-sequitor to the post you're responding to :)



Right, but do you understand how unintelligible that page is for most people? My dad is smart enough that I'm sure he could learn how to program, but I'm almost certain that he wouldn't know what to do on that page. Also, I think last time I encouraged a non-compsci friend to install python, they had issues with the PATH not being set right, and quickly lost interest.

Compare that to the Firefox download page, where it auto-detects everything it needs to know about your computer and gives you one simple, unambiguous giant "download me" button that just works. If this was a conversion funnel, python would be losing most of their money (i.e. potential users) at this step.


navigating the internet and reading through some basic documentation seems like a pretty basic requirement for a 'programmer'. It might be unintelligible at first, but a little struggle is a better teacher than constant hand holding.

The old cruel IRC days of RTFM made me a better, more independent problem solver.


Strangely, he has a video that describes just that, but it's on vimeo: http://vimeo.com/28743348


http://codepad.org/

Click on Python.

I'm not sure how many of the Khan Academy tutorials you could get through...


Javascript FTW, a text editor and a browser and you are already programming!


For the record, Khan Academy is going to eventually scrap all the Python videos. John Resig, creator of jQuery, is going to redo all the videos narrated by him and with the code written in JavaScript.


JS doesn't sound like a wise choice to me.


Yeah that's slightly disconcerting. I'm not a compsci expert, I know enough scripting to get by as a full-time web developer, but javascript seems like it has a lot of hard-to-grasp idioms that would be hell for a beginner. I've read The Good Parts and I still don't totally understand the intricacies of prototypal inheritance. :p

I'd say stick with something a bit simpler, especially given that it's Khan Academy, not Stanford, so it's likely to attract far more casual lay-users who just want to know "a little bit about programming." The casual nature of the engagement means there is probably a very low threshold for quitting if the program is resulting in more confusion/frustration than "aha moments."

I think it's great they're doing it, tho! More people should learn "a little bit about programming."


Prototypal inheritance isn't inherently more complicated than what we're used to. Familiarity is not the same as simplicity.

In fact, it may be what holds us back from genuinely better paradigms.


Indeed. I find it a bit odd that prototypal inheritance (in some more powerful form than JS's) isn't the normal way of doing OO in scripting languages.


It has a very low barrier to entry, and it's not a bad first language. Also, while this has nothing to do with JavaScript per se, I'm reluctant to bet against John Resig.


Come on, it's the Basic of this decade.


Exactly. Just think how many people got started programming because BASIC was right there, and easy to get started with. JavaScript is a strictly better language, and I would bet that the Khan Academy guys are planning to make JS as instantly rewarding as BASIC was back in ancient times.


Interesting. Care to elaborate on why? Because it seems like a perfect fit.


John goes over how and why the new CS videos will be taught using JavaScript+HTML5 in these youtube videos:

http://www.youtube.com/watch?v=k0Fi8EnSInE

http://www.youtube.com/watch?v=L_EU6w8iIGQ


Have they mentioned it somewhere?


This is hardly computer science, it's only programming. Calling this computer science is similar to saying that a course in grammar and spelling is a course in literature. Programming, while vital to most forms of computer science, and the most marketable skill of a computer scientist nowadays, is just a tool.


It is a "marketing tool" so to speak; is much cooler to say "I am a self-taught computer scientist" than "I am a self-taught programmer". And like you may know, with kids, coolness matters.


I'm not a programmer - my biggest issue with all the tutorials that I've seen for Python, Ruby and even js on codeademy.com is that none of them actually teach you how to do things within a web environment.

I realize that this is meant to be an "intro to CS" class and not a web dev class, but a product can teach me how to create a simple web app that connects to a popular API, retrieves data and displays the data on a web page is the product that will get my money.


For JavaScript that's a mostly valid point since 99.9% of all JavaScript is executed in the browser. When we teach basic JavaScript we include a week on accessing the DOM because we know that's where people are going to go with the language.

For Python and Ruby, it's best to have a handle on the languages first before throwing in Web stuff. That's the case for two reasons: first, particularly with Python, the web might not be the student's ultimate objective. But more importantly, you want to start in manageable chunks and throwing in web stuff can muddle things early on.


And this is why PHP is used for web-dev. The "Hello, World" webapp in PHP is trivial to anybody who has ever done any html markup, and is usually the first example. That makes it a gateway like this: 1) Do some HTML to make a webpage 2) I want to add <something dynamic> 3) Oh, I just ad <?PHP ... ?> to my page, that was easy 4) I want to do <something harder>, oh, cut and paste 5) Now I need to tweak this...

Which is part of why PHP is so popular, especially among people with more of a web background and less of a programming background. I agree that it's better to have a handle on the langage first, then throwing in web stuff, but if you take that tact, many people will instead use the language that starts with Web stuff, then adds in programming.


While I like Khan Academy in general for their Math lectures, the selection of CS lectures leaves much to be desired IMO. What they call "Computer Science" I call "Intro Programming".


Also: If you want Programming Tutuorial Videos, check out http://www.thenewboston.com


Does anyone know how you can become a video contributor to khan? I have several years of teaching experience, two of them with online learning models and have worked with the University of Texas. I've attempted to contact them and offer my free services, but haven't heard anything back. Not even a 'no thank you'.


The other comments are wrong. Khan talks about it in his talk at linkedin and his talks at google. They want to add more teachers in the long run. If you really want to do this you have to take a subject you know well an make a small set of lectures on it and send that in. If they like it, then you have a change.

Khan does not like all this meetings and talk stuff. He want people to do the same thing he did. Just start and talk later.


hate to disappoint you, but they wont host your videos no matter how great of a teacher you are. If you have looked at a bunch of their videos, you might have noticed that they are all done by one guy! Hence the name Khan Academy. The whole site is from the crazed brain of this one guy.

You can see him talk in person in this TED talk: http://www.ted.com/talks/salman_khan_let_s_use_video_to_rein...


They're not really set up for taking external contributions, but there's nothing stopping you from making videos and putting them on YouTube. If you pick a subject and do it better than anyone else, you will have made a valuable contribution.

I know that's not as cool as contributing to Khan Academy, and makes it harder to get an audience, but it's something you can do at any time, without asking permission from anyone.


Interesting that he uses Python to teach the examples. Python is what I learned first.

Does anyone have an opinion on whether Ruby or another language is better suited for teaching basic programming concepts?


Even though my main language is Ruby these days, I'd still prefer to teach Python, it's much more readable to non-programmers. Ruby has lots of weird short-cut syntax which just confuses newbies.


For starting out programmers, I think it really doesn't matter which language that's used, as long as the language supports strong type safety, the ability to create data structures, and, ideally, also has garbage collection. Java, Python, and Ruby all work for this. In a perfect world, the language would also support C-style pointers, but GC is more important feature for a brand new programmer.

Initially, the goal should be to learn primitive data structure concepts and usage(i.e. ints, char, strings, pointers, etc.). After that, they should learn more complex structures, like linked lists. These should be taught without referencing the built-in standard library structures. After that, simple sorting algorithms can be taught(including recursion), as well as OO concepts.

Teaching all of that in a GC language is nice, because it removes a lot of the memory management that starting out programmers always get caught up with. It lets the student concentrate more on the concepts than on tricky memory issues. That can be taught latter.


Actually research has shown that it does make a difference: [Why complicate things?: introducing programming in high school using Python](http://dl.acm.org/citation.cfm?id=1151880)

They found that students who were taught Python instead of Java scored higher on their tests. Languages like Python and Ruby make it far easier for people to jump straight into the code. If I'm learning about linked lists why do I need this main method? Ruby and Python have lots of abstractions which make it easier for someone learning to be able to focus on the problem at hand.


Indeed.

As someone taking a data structures course in post-secondary school where the facilitation language is Java, I've struggled more with the Java development environment than I have with actually understanding the data structures and the implementations. Even the Java specific implementations are simple once you can get your package and classes playing nice and compiled to bytecode.

This is not a slam on Java, just an observation from personal experience that some interpreted languages like Ruby and Python tend to make it easier to do casual programming exercises or tasks than those needing any compiling prior to execution, such as C, C++, and Java.


I agree with your short list of goals for students new to programming. Language should not matter for learning the basics of programming and Computer Science concepts. That being said, certain languages do make exploratory programming much easier than others:

The biggest issue I've faced with my courses where Java is used to teach the material is having to deal with Java IDEs and boilerplate code required to test tiny bits of code and the resulting behaviour. Interpreted languages or those with REPLs tend to not have this problem from what I've observed.

Note: I know about BeanShell, but I've had poor results with it. Maybe my environment is at fault, but it seems to miss functionality as basic as command history, which makes editing commands very tedious.


>I agree with your short list of goals for students new to programming. Language should not matter for learning the basics of programming and Computer Science concepts. That being said, certain languages do make exploratory programming much easier than others:

Pretty much. What really needs to be taught is that programming languages are tools. There are pros and cons to every language, so the best language for the concepts being taught should be used. A student that's come out of a good CS curriculum won't be a great programmer immediately after graduating. However, they'll have all the tools that they need to learn how to become a great programmer.


For the nth time, it's not about the language. What ever gets you started is fine. Then you learn some more.


I think Scheme is a much better option than Python for complete beginners, in the context of a class.

However, if I was just hacking around on my own, I'd probably go with JavaScript just because of how easy it is to make something cool and show it off.


Khan Academy is interesting but imo it's not complete. Technology enables us to make learning an interactive experience -- either interacting with another person or with a REPL interface (like Codeacademy). Just posting videos online in one place is kind of like the obvious step that took a surprisingly long time to get to. It's definitely a step forward, but I can't imagine people are learning enough about, for example, Biology to be able to do something significant with what they've learned.

Computer science is a little different, because people have been learning CS online since well before Khan Academy.


I think if you read the comments here from Khan Academy employees, you'll realise that Sal & Co. are quite aware it's not complete yet. Rome wasn't built in a day.


Personally, I don't like videos. So if I had $100M in my pocket I'd create transcripts of all lectures in KA and put them together in the greatest library online, sort of a modern bibliotheca alexandrina.


1. Go to a video.

2. Click subtitles.

3. Click the subtitle widget.

4. Click "subtitle homepage".

5. Hover over "download subtitles".

6. Click txt to download a plain-text transcript.

I'm pretty sure most of the Khan Academy videos have subtitles (at least English ones).

Disclaimer: I work for universalsubtitles.org, the site that handles all the Khan Academy subtitles.


Pretty cool! He has to do discrete math / mathematical logic & foundations to fill out the 1st/2nd year of mathematics and most computer science math requirements next.


Does the mountain of other math videos and exercises on the site not already provide that? I'm pretty sure they cover enough. They cover through Calculus and maybe more. Which do you feel is missing?


Usually a basic discrete math course covers: naive set theory, formal logic, functions (khan covers under calc), relations, permutations and combinations (covered by khan),and graph theory. Additionally you'll usually do a lot of proofs with these since an understanding of how to do a proof is essential to being able to study algorithms. Calculus and the like are actually the dual of 'Discrete math', which could be referred to as 'Continuous math'


While I'm sure it's possible that the plethora of other math videos and exercises on the site do provide the background that CS students would need, it'd be nice if perhaps they were cross-categorized so that people could know which topics go best with each other.


Their math selection goes through calculus, differential equations, first-semester statistics, and linear algebra. I don’t see anything beyond that.


No, it's missing that section, as I said.


I wish he went more to the math/conceptual side. I can sense he giving a great O(n) explanation...


It might be best to leave the calculus in the calculus lessons.


Isn't Bill Gates creating schools where they primarily use videos in the Khan Academy library?


In Los Altos School District in the Bay Area, Khan Academy is being used as a homework platform


That site is incredible and keeps getting better. Thanks for the post.


Khan Academy has so much potential to be disruptive yet it feels squandered. Why's it taking so long? What's the money being used for?


I would argue that it is not being squandered and that slowly but surely it is disrupting.

http://www.khanacademy.org/video/npr-story-on-ka-los-altos-p...


What would you suggest to change that? I love Khan Academy as a learning tool for myself but I wouldn't have the first idea on what to do next with it.


Adaptive learning is the way forward. They've been planning it for ages and it's taking way too long to roll out fully.

I'm gunning to compete with my own platform, but he's in as a non-profit which means a for-profit doesn't stand a chance, especially with the timescales the sector operates on.

The only way to create something to compete and light that fire under their ass would be a "generous donation". I think I could do it though, within a year tops, but unfortunately, I need to eat...


FWIW, I am sitting at a desk in the Khan Academy offices and am suffering from severe burning due to all the fires people have lit...ok this joke is weird.

Not sure what you're using to judge "too long to roll out fully," but we're running pilots in tons of classrooms right now where students are using Khan Academy to move at their own pace. We have 1.75MM interactive problems done per school day. We're using our own data more and more (http://bjk5.com/post/10171483254/a-bingo-split-testing-now-o...) to make the process more adaptive and engaging to individual students, and we've added hundreds of interactive math exercises (along w/ tons of new features: http://bjk5.com/post/8826207372/khan-academy-internship-summ...) in way less than a year.

We're nowhere close to where we need to be, and the possibilities for adaptive learning with all of our data make us all salivate for more time. Regardless, I can definitively tell you that every day around here is energized like crazy. We don't lack the fire.


First, patience.

Second, "he's in as a non-profit which means a for-profit doesn't stand a chance" is completely nonsensical. If that were true there would be no such thing as a for-profit. For one thing, at any sort of scale, the difference between a "non-profit" and "profit" can be as little as 10%, which is approximately the average profit made by Fortune 500 companies, within a percent or two.

Besides, I think that in the future of distributed, decoupled learning, there's room for many successful curricula. It will eventually be normal to get your history from X and math/physics from Y and English from Z, or even mix and match math modules. If you think you can compete, go for it.


What sort of adaptive learning do you mean? I'd guess you mean something like ALEKS:

http://www.aleks.com/about_aleks

...but I'm not sure. The Khan Academy exercise framework is also open-source, so presumably you can contribute that way.


That's too basic to be competitive.

Try this link: http://www.carnegielearning.com/higher-ed-solutions/cognitiv...


It's going to be a while before widely adaptive learning software comes around. Learning Assessment is already a difficult problem, and when it's done well, takes a lot of insight and wisdom on the part of the teacher.

As yet, there isn't a way to replicate that in software. One day it will be, but until then, khan academy and those like it can't even come close to having a good teacher.

That said, I can easily see how it could take the place of a bad teacher.

EDIT: I do see now that the CM software you linked to does have a human component. That's an interesting aspect and I'm going to have to take a careful look at this.


I think a lot of resourcese are used to translate the videos.


Let's see how long it will take you to record 2,773 quality videos.


where are lectures about classes/OO programming? just gave the link a quick glance and it seems good (i understand khan academy is for "gentle" introductions), but doesn't look like it goes into OO programming at all (which is kind of the point of python), no?


Do you think that object oriented programming is really necessary for absolute beginners? There's always this problem of coming up with examples with OOP when being introduced to beginners, and you can end up with horrific "Cat inherits from Animal" examples. GUI programming might be the best place to introduce OO since it's a decent fit, however a lot of newbie GUI programming would just be using a library, not building object hierarchies yourself.

Even the MIT "intro to programming and computer science" class (which uses Python) doesn't touch OOP until lecture 14, after dynamic programming, divide and conquer, bit of runtime complexity, recursion and more...


This is good. Everybody should be learning to program. Khan Academy and Codecademy are benefiting everyone. I wrote about that here: http://goo.gl/cTcbp




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: