Thursday, May 24, 2012

Code Academy: What's Missing?

Recently, Code Academy launched with the intention to teach computer programming to "the masses".

I'd like to discuss a short-coming in their material (I won't discuss the method used currently).

Someone in their forums has asked[deadlink] "What topics need new courses the most?"

[NB: apparently code academy has taken down their forums...I guess they couldn't stand the complaints about their EULA.]

I gave a short answer, but it gave me something to think about: what should a programmer know?

Compounding the problem, the material a working coder should know differs from the material constituting an programmer's education.

I'm just going to rattle off items belonging to both categories...

Programmer's Education

The education includes stuff that may or may not be useful when working.

0. Difference between Expressions and Statements. This important distinction is never taught, so students never figure why foo = function() { ... } differs from function bar() { .... }.

1. Algorithms. This topic is not discussed thus far in any course on Code Academy. Being more specific, I mean CLRS-level stuff, not rudimentary "make a loop, do stuff, blah".

Specifically, algorithms that should be covered:

  1. Sorting Algorithms
    • Bubblesort, as an example of a bad idea;
    • Insertion sort
    • Mergesort
    • Quicksort
    • Heap sort
  2. Searching Algorithms
    • Linear search
    • Binary search
    • A* search algorithm (and other graph search algorithms)
    • etc.

2. Data Structures. Although discussed a little, the Academy does not discuss linked lists, stacks, queues, binary trees, etc.

Advanced data structures might include, but not limited to, Fibonacci heaps, B-trees, van Emde Boas Trees, etc.

3. Dynamic Programming. Both the "Bottom-Up" and "Top-Down" approaches should be discussed; memoization ought to be covered, etc.

4. Greedy Algorithms. This, I feel, is important for pedagogical purposes...greedy algorithms can fail in practice, but it is important to expand your mind.

5. Algorithm Analysis. I learned this in numerical analysis, where we say "Stop: Why does this algorithm work? How can we make it better?"

This cannot be taught on Code Academy, since it would require a nonlinear framework...i.e., actually taking the user's response and generating questions/problems/exercises based off of it.

Think of it as the Socratic method applied to programming. Code Academy cannot handle the Socratic method (perhaps it would not be too far to suggest they are...sophists?).

But seriously: nurturing curiosity in a way specific to the pupil, that's the mark of a good teacher. Code Academy currently cannot facilitate this.

6. Various Rites of Passage. It seems computer science majors have certain "rites of passage": writing an operating system from scratch (or implementing their own file system, process manager, etc., for *nix); writing their own compiler or interpreter; understanding the networking stack; etc.

These should be included in any coder's education...but they require low level languages to do it (assembly or C). Code Academy cannot handle this, at the present moment...

Working Coder's Knowledge

Perhaps one should consult What every CS majors should know...

1. AJAX. Certainly, the most glaring feature missing is AJAX, which I think any browser can handle (the XMLHttpRequest...does it depend on a library?).

2. Runtime, Parse Time, etc. Code Academy does not mention these distinguished times. Nor is there any discussion of "server-side" vs. "client-side", what the difference is, etc.

3. Debugging Techniques. Really, this is most useful, when you run code and cannot figure out what the problem is. What to do?

Well, insert console.log(...) calls indicating what is happening. "I am doing this", "function blah() has been called", etc.

4. How to Optimize Code. I have just written a JavaScript program. Wonderful. It's slow as death. What do I do to make it faster?

Final Thoughts

Certainly many things are missing, but these are my thoughts on the matter of Code Academy and a programmer's pedagogy.

No comments: