-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path00-programming-languages-languages.txt
62 lines (34 loc) · 4.12 KB
/
00-programming-languages-languages.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
Are programming languages real languages?
X - toon: Sallie
X - pic: Spanish class
X - pic: phone-game knocks out Spanish
X - toon: Sallie's mom unhappy about this
X - text: braces and semicolons
X - (intro) + NL-logo
X - Jessica intro tag
X - toon: dinner -> cabeza de chivo
X - toon: programmer -> in MRI
X - paper+text: Janet Siegmund and team
X - phone + paper+text + highlighter: two programming problems
X - pic: brain
X - text: math equation on brain
X - text: lang /IPA/ on brain
X - (endcard)
Past me is really jealous right now. Do you know that 10th graders like Sallie are ditching Spanish class and getting credit for learning to program games for her phone? No slogging through years of conjugating ser and estar like they put me through?!?
But Sallie's mom, she's less excited. Why? She says programming languages - with all the curly braces and weird semicolons - are nothing like a foreign language. Is she right? Is mathy code like this really a LANGUAGE language?
[intro]
Welcome to CompChomp, the only show on the internets where we crack jokes in binary. So this 0 walks into a bar... heheh...
Don't get me wrong, I actually really enjoyed high school Spanish. Just don't ask me to order a meal when I'm out. I'll get all flustered and you'll probably end up with the cabeza de chivo.
But now I'm a real programmer, and I get to look back and wonder: when I was learning Spanish, was I doing something fundamentally different? In my code, I use words, I use syntax to put my words together, I even use related languages and dialects. It all sounds so languagey. But does it look languagey?
Facts alert! So how could we tell if learning to program is like learning a natural language? Well, you could round up a bunch of programmers and shove 'em in an MRI. Maybe in an fMRI. That's the fancy one, I think. I'm not a doctor.
And that is exactly what Janet Siegmund and team did. Kudos. (Wait, I'm a programmer. And I hate enclosed spaces. Don't shove me in there!)
Let's say you're a coder holed up in an MRI machine and they show you this. What does it mean?
Read it with me!
I'm a program! Stick the label var1 on the number 23, and another label var2 on 42. Now pull out a label temp that you don't stick on anything. Now stick temp where var1 is, then take the label var1 off and put it on var2, but then take var2 and put it where temp is. After this runaround, which number did our label var1 end up on?
This is fun! Let's do one more:
I'm a program, too! This is Otto, who wears the nametag "word". Give me a switch to flip when I get the right answer, and give that switch the nametag "result". Start one counter counting from 0, start another one counting from the end of the word, count first counter up from 0 until you get to the middle of the word, count second counter down from the end of the word until you get to the middle of the word.
Each count, compare the countup letter and the countdown letter. If they are the same, keep going. If they are different, flip our result switch to false, stop counting and checking letters, and tell me whether result was flipped to true or to false.
Figure out what this did? We just checked if "otto" is a palindrome.
So... what type of brain patterns do you think lit up when coders read code like this? Just the ones that deal with math? Errht! The ones that deal with memory and language. Basically, being a fluent coder looks a lot like being a native speaker.
One-two punch! Go out and demand foreign language credits for your programming smarts! Well, if your goal is to teach someone to think in a new language, you can't go wrong with programming. (Except for BASIC. Stop teaching your kids basic. Details to come later. Traumatic details.) But if your goal is to have a whole cultural experience, to read Don Quijote and accidentally order cabeza de chivo, you can't really do that in C.
Ok, I hope you'll spend a few more videos with this programmer talking language. I’m Jessica from CompChomp! Subscribe for more about how code is part of your life everyday, and hang around on NativLang where we’re doing a short series of videos together about the awesome overlap between code and language. Chomp!