3 ms·
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 ev
by danso 12y ago
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.
- pwr22 12y agoPerl 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
- michaelfeathers 12y agoI 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.
- 0942v8653 12y agoAm I missing something about this `unless` keyword? From what it looks like, it's just syntactic sugar for `if not`, and it makes much more sense… (unless (string= a b) (fail)) ;; much more readable than (when (string/= a b) (fail))
- michaelfeathers 12y agoI 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.
- Qwertious 12y ago>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.