Vim search Dash

I use [MacVim](http://code.google.com/p/macvim/) as my editor and [Dash](http://kapeli.com/dash) as my documentation browser. They’re great. Also, Dash has the best nag-screen mechanism I’ve ever seen.

If you use them, too, I wrote a bit of Vim script to make looking things up about 0.5 seconds faster each time. Imagine, _all that productivity!_ Just position your cursor on the word you want to look up, leader-d, and the script will try to search the right docset in Dash based on the filetype you’re editing. E.g. for JavaScript files, I have it configured to launch js:term in Dash, which searches both the jQuery and JavaScript docs for that term. (Source: a great tip from [Kapeli](https://twitter.com/kapeli/statuses/239927573096837123) himself. Herself? Itself?)

I’d love to hear suggestions on how to generalise this, without manually adding docsets each time. I tried passing in the filetype to Dash as the search term, but got tripped up by some asset files in Rails that Vim thought were ERB…

“Please don’t learn to code”

Jeff Atwood went and set fire to the Internet a couple of days ago:

The “everyone should learn to code” movement isn’t just wrong because it falsely equates coding with essential life skills like reading, writing, and math. I wish. It is wrong in so many other ways.

This point feels a little stretched to me. I’m not sure where Atwood is getting these “coding is as important as reading/writing/math” vibes from, but why isn’t there a place for coding in schools beyond the core curriculum? Put another way: why exclude Computer Science / programming from that seemingly arbitrary list of auxiliary subjects that we make our schoolchildren learn over their 12 years of pre-university education?

The general populace (and its political leadership) could probably benefit most of all from a basic understanding of how computers, and the Internet, work. Being able to get around on the Internet is becoming a basic life skill, and we should be worried about fixing that first and most of all, before we start jumping all the way into code.

This part makes perfect sense. However, what he proposes here doesn’t have to be at the exclusion of teaching more people programming, yes?

Here’s a response, by Zed Shaw of [Learn Code The Hard Way](http://learncodethehardway.org/):

I wonder if he’s going to tell his kids they shouldn’t learn to code when they want to become just like Daddy? Probably not. He’ll gleefully run over and show them how to code and tell them it’s so much fun and that they should all do it and it’s the best thing ever! But, of course, _your_ kids shouldn’t learn to code, and you shouldn’t, and your friends shouldn’t, just Jeff and his kids should.

I do think Shaw’s taking a bit far when he cites resentment as Atwood’s motivation for telling people not to learn how to code, but then, running a (very good, supposedly) programming education website could do that to your perspective. Both articles make good points, but I’d recommend Shaw’s to anyone feeling a bit deflated after reading Atwood’s.

An argument for teaching Computer Science over basic Math

An interesting argument: that calculating devices are now ubiquitous, and math should focus on computational problem-solving instead of drilling and memorisation. An example the author cites:

Computer languages allow students to transform ideas into action. Here is a simple rule that a math teacher might describe to her students:
If the number is greater than 9, carry the 10’s place; otherwise add the number to the bottom row.

The solution for this can be expressed as an if/else statement:

if number > 9:
carry += number / 10
else:
bottom += number

There are, as expected, plenty of opposing views in the comments, but it’s good food for thought. Also noteworthy: the comments aren’t completely stupid. Not-completely-stupid comments! On the Internet! WHAT IS THIS WORLD WE’RE LIVING IN

Nobody Wants to Learn How to Program

From the blog behind the “Invent Your Own Computer Games with Python” book:

“[For] the casually interested or schoolchildren with several activities competing for their attention, programming concepts like variables and loops and data types aren’t interesting in themselves. They don’t want to learn how to program just for the sake of programming. They don’t want to learn about algorithm complexity or implicit casting. They want to make Super Mario or Twitter or Angry Birds.”

We’ve actually found that our students are usually quite happy to spend lots of time making silly console-output programs, like printing a pyramid of asterisks. However, the intro programming courses we’ve conducted have been for a fairly self-selected bunch.

The book is available [online](http://inventwithpython.com/chapters/) for free, and it certainly looks like a great instructional resource.

“Computer Science is not Digital Literacy”

Jodie Fraser:

Digital literacy means the the skills and confidence to take an active role in engaging in networks, and in shaping and creating opportunities – social, political, cultural, civic, and economic, and we shouldn’t be collapsing these broader rights into the relatively narrow concerns of computing science as a curriculum area.

Article via [Fraser Speirs](http://fraserspeirs.com) (that’s a lot of Frasers). Mildly surprising, to me at least, is his strong support for the argument raised in the link article, given that he’s a programmer and Computer Science teacher. This [piece of his](http://speirs.org/blog/2011/12/29/three-mantras-from-the-first-two-years.html) on “technology for subjects not traditionally well-served by technology” may serve to explain why, but I’m still trying to digest all of this.

BBC: ICT to be replaced by CS in schools

From September, England’s schools will offer computer science classes instead of ICT (a.k.a. IT ‘skills’ such as PowerPoint and Excel):

The current programme of information and communications technology (ICT) study in England’s schools will be scrapped from September, the education secretary will announce later.

The subject will be replaced by compulsory lessons in more rigorous computer science and programming.

Not sure how they’ll start this up so quickly, given this glaring problem:

“There are, of course, significant challenges to overcome, specifically with the immediate shortage of computer science teachers.”

See also [this Guardian article](http://www.guardian.co.uk/education/2012/jan/09/computer-studies-in-schools): “Out of 28,000 teachers who qualified in 2010, just three individuals had a computer-related degree.” Similarly the case here, although the return of A-level Computing should imply that [NIE](http://www.nie.edu.sg) will be doing something about training CS teachers.

I’m still on the fence about whether CS absolutely needs to be taught at a pre-tertiary level. There was some interesting discussion on this recently between a couple of Mac developers — see [this blog post by Guy English](http://kickingbear.com/blog/archives/272) on “Scripting is the New Literacy”, a response to [this piece by Daniel Jalkut](http://www.red-sweater.com/blog/2298/learn-to-code) encouraging everyone to “Learn to Code”.

(News via [Matt Johnston](https://twitter.com/cimota).)

If PHP Were British

Before:

switch ($variable) {
    case $option1:
        //Code here
        break;
    case $option2:
        //Code here
        break;
    default:
        //Code here
        break;
}

After:

what_about (£variable) {
    perhaps £possibility:
        //Code here
        splendid;
    perhaps £other_possibility:
        //Code here
        splendid;
    on_the_off_chance:
        //Code here
        splendid;
}

Chipper!

Codecademy

Codecademy teaches JavaScript programming through the browser: follow instructions, type in code, move on to the next step. This is similar to the (slightly more amusing) [Rails for Zombies](http://railsforzombies.com/).

Browser-based code classes look promising for classroom teachers: there’s no need to install compilers or even text editors, making this environment much easier to set up in a lab. Students can also continue their work easily at home, with (some level of) instant feedback from the built-in help system.

The associated [Hacker News post](http://news.ycombinator.com/item?id=2901156) has some interesting suggestions, and the comments from non-programmers about the course’s difficulty can be quite enlightening to anyone trying to teach a programming course.