Stop Teaching Code, Solicit Predictions Instead
blog.upperlinecode.com
blog.upperlinecode.com
This is a great way to program a computer. It is a lousy way to teach a human. Humans are more like machine learning algorithms; give them examples, then later explain the general definitions and syntax.
If machine learning ever becomes a mainstream method of programming, I wonder if it would cause programming instruction to improve? Probably not. The "define first, useful applications last" style of teaching is probably actually based on math and philosophy logic, so there's centuries of inertia there.
The textbooks though are frequently as you describe. They execute like a computer program. Hartshorne's Algebraic Geometry is the classic example for me: it takes so much work just to go through each page. Even chapter 1 you have to skip forward to see that you can get the Nullstellensatz before you can come back to see why you're restricting your object in a certain way. This is no way to learn.
Learning to code helped my math ability greatly, now I see sigma and think "for each, add to total".
I think it's worth nothing that there are different learning styles, and some people actually enjoy bottom up approaches more.
I used a similar method to teach pretty complex manual artillery firing to 17-20 y/o's with spotty high school education coverage. If a professor can explain (or get them to explain) in simple English a relatively math-free, logic-based solution to a problem, and then add the necessary terminology, it's majorly successful.
The paper linked adjacent to this comment looks interesting as well. What I gathered from the experience was that if you can capture student activity while they are tracing (e.g. eye tracking, recording incremental changes to a doodling interface and doing some pattern recognition on it, etc) you can fairly accurately and repeatably figure out their structural thinking ability.
I remember when I was a kid, I took an after school programming course and the teacher had a very cool approach to start us with:
All attendees were "computer nerd kids" with some programming knowledge, usually in BASIC (it was the late 80s), and the course was taught in Pascal. So instead of building from very basic principles, the first lesson was something like: "This is the editor, this is how you compile. Now, let's write an algorithm to find the largest integer in an array, and that way you'll pick up all the basic building blocks".
This was mind blowing to me, I was ready for an hour of "hello world" and demonstration of basic language constructs, like it was taught at school. But instead, in the first lesson he had covered compiler invocation, variables, static types (a totally new concept coming from LOGO or BASIC), functions, conditionals, loops, arrays and console output - and probably the very idea of algorithms. It was really great.
https://byorgey.wordpress.com/2018/05/06/conversations-with-...
“Hey, I have a good idea for a game,” I said. “It’s called the function machine game. I will think of a function machine. You tell me things to put into the function machine, and I will tell you what comes out. Then you have to guess what the function machine does.”
Does anyone know if there are any books/lectures that are something like "advanced readings in programming" where you are given real-world code samples that are high-quality? That paired with some questions to direct learning (along with some helpful context around the problem domain) would be really interesting.
http://shop.oreilly.com/product/9780596510046.do
“The Architecture of Open-Source Applications”
You also might be interested in “Coders at Work”.
- Teaching “the whole game”–starting off by showing how to use a complete, working, very usable, state of the art deep learning network to solve real world problems, by using simple, expressive tools. And then gradually digging deeper and deeper into understanding how those tools are made, and how the tools that make those tools are made, and so on…
- Always teaching through examples: ensuring that there is a context and a purpose that you can understand intuitively, rather than starting with algebraic symbol manipulation
If you're interested, there's more info here: https://www.fast.ai/2016/10/08/teaching-philosophy/
Thanks for fast.ai. I think to some degree this maybe personality driven. Whenever I'm taught like that, I constantly feel anxious about "holes" in my knowledge. I believe it gets hard to plug those holes when you learn from a top down approach. The bottom up approach is harder for a reason, the knowledge gained is more thorough.
I'm not sure you can just make that statement. Interest and motivation will be the deciding factors in the depth of your knowledge in the long run.
Imagine having to read the full manual of a video game before you can play it vs just fooling around and looking something up when you need it.
https://blogs.kcl.ac.uk/cser/2017/09/01/primm-a-structured-a...
For example, here's a 100% true story. I once showed a student code like this (in Ruby)
my_name = "Jesse"
my_age = 32
puts("My name is #{my_name} and I am #{my_age} years old.")
They asked a great question: "Are the names my_age and my_name special? Do we have to use those names?"I explained that, no, so long as you use the same name everywhere, it will always refer to the same value. The names of the variable aren't special. I changed the code:
my_giraffe = "Jesse"
my_waffles = 32
puts("My name is #{my_giraffe} and I am #{my_waffles} years old.")
I use names like "giraffe" and "waffle" so students still recognize them as nouns but are less likely to bring some prior, inappropriate context into their reasoning."Oh, I see!" they said. "You can use any variable names so long as they start with my_."
The fact that they articulated their rule clearly to both themselves and me right at that moment puts them in the like 95th percentile of beginning students. Induction is natural but dangerous for beginners, who are so desperate to make sense of what they see that they'll adopt the first model that accounts for what they see without any consideration of the alternatives.
If they were thinking in terms of _predictions_, though, they'd naturally test their model by removing my_ and seeing what happened.
puts("My name is Jesse and I am 32 years old.")Amusingly, your comment is a fun example of short abductive reasoning just like the student in the other guy's story.
I touched upon this before in another comment: https://news.ycombinator.com/item?id=19010428
I’m serious — stop it with the gatekeeper introductions to content.
Aaaand the rest of the article is pay walled by medium...
AFAIK Medium doesn't paywall content (at least like this?). That modal you get has a button to close it in the top right corner. I understand the aversion to paying for things but please make sure your attack is valid before throwing it out there.
They do paywall member-only content with a real-life paymentRequired bit[1], which writers are encouraged to use. You can (for now) create content that doesn’t require a membership to read.
There are some great practical examples here of that 'better' that apply beyond just programming to general language learning as well.
It's important to give context and ground your proposed problems in reality. Relatable content is the single most important part, so skip the "foo/bar" stuff and go for real-life examples. That's it! No need to write clickbait!
If you believe people with no coding experience will magically figure it out, you'll have a bad time and your students will hate you.
The author isn't suggesting students will "magically figure it out". He's helping them develop the muscles they need to articulate, build, and refine their own mental models.
You can get students making CS-relevant predictions without them having ever seen a single line of code in their lives within the first hour. Students will enter the world of programming with an orientation that enables them to learn 10x faster, which is even more critical in the coding bootcamp context.
That learning style thing has horrible consequences for about 40% of students in the American one size fits all public education model.