I've been teaching programming to non-CS students at Stanford for the past month...they're all clearly smarter than me. But what they lack, as does virtually every non-programmer I've worked with, is the ability to (initially) understand a for-loop.
It's not that they don't get that there is such a thing as a "loop", or that a task can be broken up into iterations...they just don't know what it means to design something that can iterate across a collection and, for each member of that collection, perform a task on it. It's not merely not understanding the syntax, or the overall result...it's not comprehending that you can design and control such a thing.
I've worked with non-programming professionals in which I've taken a repetitive task, such as extracting a bit of text from each page of thousands of pages of documents, and boiled it down to a program that saves them days of work. The effect of such a program is greatly appreciated...but time and time again, these non-programmers are delighted/astounded when I perform the same task in another scenario...what bothers me is all the times when I'm not there to recognize how such a problem can be abstracted, and they dive in head first into a meaningless, repetitive chore.
The abstraction of a task, so that it can be performed in a loop...it's so fundamental that once you've done it, it's hard not to think in those terms. And I wish it were the case that very intelligent people could just get it, in the same way that those who've never played an instrument can at least appreciate Mozart. But I just haven't seen it...we programmers take for granted the ability to think in this profound way, and even though it's fairly basic, as far as ComSci education goes, it really is a gamechanger in all areas of life and work. This is why I think programming deserves consideration as a kind of literacy.
Edit: To focus on something from the OP:
> We don't want a generation of people forced to care about Unicode and UI toolkits. We want a generation of writers, biologists, and accountants that can leverage computers.
Well, sure, if you boil coding down to "Unicode" and front-end web development, then yes, it's not "literacy". In the same way that if I boiled down traditional literacy to iambic pentameter and the debate between prescriptive and descriptive linguistics, I could make a compelling case for not learning to read and write.
Edit 2: I'm willing to consider programming as not a new literacy, but "just" a branch of math...but math practiced in a pragmatic, visceral way, not in the tepid, abstract way that it is forced upon us in primary school. I do think that programming is math, but with programming, you are actively building and testing something using the principles of math. If there's a way to teach that kind of math without programming, I'm game for it.
I'm the only dev (or person with any IT-related responsibilities) at a workplace full of very smart people, and I've noticed this repeatedly. They see a task as being monumental ("We have to do the same task for 3000 people/articles/etc.!") and are surprised when I point out that a computer would take just a second or two to do all of the work. These are for tasks that are obviously repetitive.
This is more the kind of "literacy" that I want: the knowledge to know what is possible, even if the skills of actually accomplishing the task aren't taught. It astounds me how much time people waste because they don't know how to recognize when something is a good candidate for automation.
Of course, part of it could be that some people are afraid of automating themselves out of a job...
> Of course, part of it could be that some people are afraid of automating themselves out of a job...
Actually, the real tragedy is these people don't even know how much of their work is "loopable"...i.e. at risk of being replaced by automation.
The way I think about teaching programming is: the goal is not to become more like a machine, but to recognize what is human, i.e. to understand what is not easily computable. And such comprehension, from my pessimistic view point, is nearly impossible to have without a level of programming literacy...and even many programmers may not stop and think about it (just as many of us who know how to read and write underappreciate the role of literacy and communication).
Edit: I think the idea of automation can be scary -- and for good reason -- but mostly because the people who have the ability to institute automation (or rather, their bosses) may not be able to properly judge the consequences. However, if society as a whole better understood what automation actually is...I'd feel more confident that we could take the long view on it, and use robots and computers to lift us all up, rather than leave the non-lucky parts of society in the dust.
I encounter programmers after they learn loops, but I have noticed that many programmers have trouble with recursion and something there's no word for, but it's the ability to imagine oneself on both sides of an API. Real cognitive hurdles there for many people.
Re loops, I wonder whether we're better off just going directly to collection operations - maps, folds, etc. We're doing a lot of work in the industry to lift ourselves up from mutability. It makes me wonder why then we feel that we have to start there in education.
>I encounter programmers after they learn loops, but I have noticed that many programmers have trouble with recursion and something there's no word for, but it's the ability to imagine oneself on both sides of an API.
Do you mean dealing with multiple levels of abstraction? Like thinking of employees as intelligent tools that complete tasks for you, and then thinking of them as bundles of motivations and beliefs that you must aim towards the task that you need done, using the power of incentives and values.
Perl as a language has "unless" as a keyword and a lot of people, who are not inexperienced with programming, have trouble using it at first. Some even rebel against its use and claim they hate it
So it is interesting that even similar seeming things can still require some time to internalise and comprehend
I notice the same thing with Ruby's 'unless'. I think it has to do with the mapping of English to programming. Sort of like the fact that 'or' can be inclusive or exclusive.
It's not that they don't get that there is such a thing as a "loop", or that a task can be broken up into iterations...they just don't know what it means to design something that can iterate across a collection and, for each member of that collection, perform a task on it. It's not merely not understanding the syntax, or the overall result...it's not comprehending that you can design and control such a thing.
I've worked with non-programming professionals in which I've taken a repetitive task, such as extracting a bit of text from each page of thousands of pages of documents, and boiled it down to a program that saves them days of work. The effect of such a program is greatly appreciated...but time and time again, these non-programmers are delighted/astounded when I perform the same task in another scenario...what bothers me is all the times when I'm not there to recognize how such a problem can be abstracted, and they dive in head first into a meaningless, repetitive chore.
The abstraction of a task, so that it can be performed in a loop...it's so fundamental that once you've done it, it's hard not to think in those terms. And I wish it were the case that very intelligent people could just get it, in the same way that those who've never played an instrument can at least appreciate Mozart. But I just haven't seen it...we programmers take for granted the ability to think in this profound way, and even though it's fairly basic, as far as ComSci education goes, it really is a gamechanger in all areas of life and work. This is why I think programming deserves consideration as a kind of literacy.
Edit: To focus on something from the OP:
> We don't want a generation of people forced to care about Unicode and UI toolkits. We want a generation of writers, biologists, and accountants that can leverage computers.
Well, sure, if you boil coding down to "Unicode" and front-end web development, then yes, it's not "literacy". In the same way that if I boiled down traditional literacy to iambic pentameter and the debate between prescriptive and descriptive linguistics, I could make a compelling case for not learning to read and write.
Edit 2: I'm willing to consider programming as not a new literacy, but "just" a branch of math...but math practiced in a pragmatic, visceral way, not in the tepid, abstract way that it is forced upon us in primary school. I do think that programming is math, but with programming, you are actively building and testing something using the principles of math. If there's a way to teach that kind of math without programming, I'm game for it.