Duane Johnson
2017-04-20 03:06:58 UTC
I once tried teaching several friends to code who'd never written a line
before.
I thought the best way would be to introduce each keyword in the language,
one at a time, and explain what they do and how good programmers use them.
One of the keywords was "for", as in the "for loop". I was baffled that my
friends were kind of impatient and frustrated with learning about "for"
loops.
Instead, I found that each of them would copy/paste code. If they needed to
print the numbers 1 through 10 on the screen, it was easier for them to
grab the tool they knew how to use: copy, paste. They would paste ten lines
of "print" statements and change the text inside the quotes:
print "1"
print "2"
print "3"
etc.
When one of my friends wanted to write out all of the ASCII characters,
however, he balked at the amount of code it was going to take. He'd have to
copy-paste nearly 200 lines and individually edit them.
That's when I introduced the "for" loop again, and suddenly I was hailed as
a hero! Looping was suddenly awesome. Pain was relieved. A few sweet lines
of code were written. We rejoiced.
But on separate occasions, my other friends still didn't understand how
awesome for loops were. I could have been frustrated by that, but I soon
realized that everyone is basically the same: we reach for the tools we
know, until they're painful, and then we look for solutions.
I wish the Elm learning experience could be like this for incoming
javascript developers.
before.
I thought the best way would be to introduce each keyword in the language,
one at a time, and explain what they do and how good programmers use them.
One of the keywords was "for", as in the "for loop". I was baffled that my
friends were kind of impatient and frustrated with learning about "for"
loops.
Instead, I found that each of them would copy/paste code. If they needed to
print the numbers 1 through 10 on the screen, it was easier for them to
grab the tool they knew how to use: copy, paste. They would paste ten lines
of "print" statements and change the text inside the quotes:
print "1"
print "2"
print "3"
etc.
When one of my friends wanted to write out all of the ASCII characters,
however, he balked at the amount of code it was going to take. He'd have to
copy-paste nearly 200 lines and individually edit them.
That's when I introduced the "for" loop again, and suddenly I was hailed as
a hero! Looping was suddenly awesome. Pain was relieved. A few sweet lines
of code were written. We rejoiced.
But on separate occasions, my other friends still didn't understand how
awesome for loops were. I could have been frustrated by that, but I soon
realized that everyone is basically the same: we reach for the tools we
know, until they're painful, and then we look for solutions.
I wish the Elm learning experience could be like this for incoming
javascript developers.
--
You received this message because you are subscribed to the Google Groups "Elm Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elm-discuss+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
You received this message because you are subscribed to the Google Groups "Elm Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elm-discuss+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.