Live data from Hacker News

Ask HN: How would you teach teens to code in 2019?

news.ycombinator.com

41–50 of 88 posts

Re: Ask HN: How would you teach teens to code in 2019?

#41
Step 1) Buy a lot of paper. Too many ideas, concepts, and problems in programming are really really big and we have no idea how to effectively tackle them. Being able to take notes, write down your thoughts, create diagrams and pictures, etc is invaluable in being able to learn. Being able to go back and checkout your thoughts in the past helps a lot.

Step 2) You'll want to check out these videos and pass them along as you feel they are appropriate: John Cleese on creativity: https://www.youtube.com/watch?v=Pb5oIIPO62g

Philip Wadler on the beginnings of computer science: https://www.youtube.com/watch?v=2PJ_DbKGFUA

Rich Hickey's Simple Made Easy: https://www.infoq.com/presentations/Simple-Made-Easy/

Types and why you should care: https://www.youtube.com/watch?v=0arFPIQatCU

80-20 rule and software: https://www.youtube.com/watch?v=zXRxsRgLRZ4

Jonathan Blow complains about software: https://www.youtube.com/watch?v=k56wra39lwA

I've got a list of videos and other links that is much longer than this. Start paying attention and building your own list. Pass on the links as they become relevant to things your kids encounter.

Step 3) I spent a decade learning effectively every programming language (at some point new languages just become a set of language features that you haven't seen batched together before, but don't otherwise add anything new). You can take it from me, all the programming languages suck. The good news is, though, that you can find a language that clicks well with the way you think about things and approach problem solving. The language that works for you might not work for your kids. Here's a list to try iterating through: Some Dynamic Scripting (Lua, Python, Javascript, etc); Some Lisp (Common Lisp, Racket, Clojure); C; Some Stack (Forth, Factor); Some Array (R, J, APL); Some Down To Earth Functional (Ocaml, ReasonML, F#); Some Academic Functional (Idris, Haskell, F*); C#; Go; Rust

Step 4) Listen to everyone, but remember that software development is on pretty tenuous ground right now. We've been building bridges for thousands of years, but the math for CS has only been around for about 100 years and we've only been doing programming and software development for decades at most. Everyone who is successful will have some good ideas, but there will be an endless list of edge cases where their ideas are worthless at best. Help your kids take the ideas that work for them and not get hung up on ideas that cause them to get lost and frustrated.

Re: Ask HN: How would you teach teens to code in 2019?

#42

I think it depends on what kinds of problems they're interested in solving. It's not my favorite either, but you'll probably get better traction in Python. Everything from Arduino to algo trading runs in Python. JS if they really like in-browser, but that's it.

Python is the closest in experience to the BBC Basic I grew up with, I think.

The only challenge/disappointment vs. BBC Basic is that you need additional modules (and complexity) to output any sort of graphics; if this is of particular interest, I would highly recommend checking out processing [1].

[1] https://processing.org

Re: Ask HN: How would you teach teens to code in 2019?

#43
post #20

When I was quite young, I started 'programming' by copying code out of magazines. I would run home from school, open up a magazine, write code until dinner, run downstairs after and write code until I had to go to bed. If I repeated that often enough, I would eventually (if I was lucky) be able to compile my code, fix the 14,000 missing pieces of punctuation and then have a (very primitive) game to play and share wit…

I fear that this kind of passion is now harder to achieve, because kids are shown that computers can do amazing stuff from very young age but anything that you can produce yourself will be woefully behind. Back in the day a game copied from a magazine was worse than what one could buy, but not _that_ much worse.

This is why, I think, we see people "coding" in Minecraft and Roblox. They have all of the environment set up for them and can do cool stuff which they can immediately appreciate.

Re: Ask HN: How would you teach teens to code in 2019?

#44
I'd go with turtle initially as suggested by another. Until they can wrap their heads around concepts like loops and the basic cause and effect of code = an output. Wrong code wrong output etc.

Then python. Though keeping that interesting for kids is going to be a challenge I think. Maybe if they can control some sort of LCD array or a motor or robot of sorts?

Re: Ask HN: How would you teach teens to code in 2019?

#45
For me the 'magic' of BASICs line function helped me a lot to start coding because I could 'see' the results and was blown away by the graphics.

Therefore I would go for Processing, which is a kind of Java. Or even the online version https://p5js.org/ which integrates the HTML DOM.

And ofcourse follow The Coding Train with Daniel Shiffman. Fun to watch and he has video's for starters and experienced coders.

Re: Ask HN: How would you teach teens to code in 2019?

#46
Start with purpose. My son only really went for it with Java, because he needed it for Minecraft plugins.

Attempts before with Scratch weren't too successful, but once the Why was there, setting up Eclipse and all kinds of silly things Java makes you do weren't a lasting obstacle.

Re: Ask HN: How would you teach teens to code in 2019?

#47
I assume by "Code Proper" you mean the ability and knowledge to use computer science to program. If so, focusing on programming only would be like focusing on the HOW, the procedure, whereas focusing only on CS would be akin to focusing on the WHAT and WHY, the rules and purpose. These two complement each other.

In this case, your kids should learn the language that teaches them CS at meaningful and deep level, so that they can see what is the soul of programming. You would need Scheme language, the text being one by Friedman (sorry, not a fan of Wizard book for the reason that it is very MIT-centric and elitist in that sense).

Once they know enough CS and Scheme to find their way in the map of programming (in the scheme of things, pun intended), then I suggest at least two programming languages that differ from each other in how they solve problems and what kinds of problems. One of these is without doubt Python, because it is connected to all sorts of fine things like web dev, AI, general purpose programming etc, and is programmer-friendly enough to not cause mild and chronic masochistic psychosis like certain languages (not naming names, because this is highly subjective).

After your kids are experts in Python, they should learn Javascript because of its utility, but also how different it is from Python. These two languages for operational, utilitarian purposes that also nicely supplement what they did with Scheme.

Once they have a good grasp of Py and Js, they should build proficiency in Haskell so that they can appreciate programming from a completely different angle; Haskell is going to be more useful later, so it has more than just didactic value.

After Haskell, some Julia for computational programming would be nice, since Julia does things efficiently and differently.

At last, they should also master C, for historical and low access purposes (and to not to fail "can you C" question).

With these languages under the belt, and the basics of CS1, they should move on to CS2, and try real world programming. John Zelle's book teaching Python and C++ for a second course in programming is very nice.

Post that, it would make sense to become mathematically involved in programming. For instance learning enough good mathematics to understand concrete mathematics for CS by Knuth et al. The best book to do that is the Rozov, Potapov, Dorofeeov text called "elementary mathematics" which was written in 80's when people when authors had very high IQs.

After they finish the Knuth Concrete Mathematics, they could develop real-world software to further hone their skills and decide what to learn next.

The most important thing however, is to let your kids gravitate towards it if they feel like it. I used to hate Piano, but not because I disliked piano per se, but because I had a bad teacher and it appeared harder than it actually was. So make sure your kids like it, but if they dislike it, it could also be due to factor x (some other reason other than sheer dislike).

Finally, good luck and hope my humble opinion has not offended anyone here.

Re: Ask HN: How would you teach teens to code in 2019?

#48
post #37

I started with BASIC programs written on my TI-86 to automate math problems; they may find that a useful way to get started, and learning a little BASIC shouldn't be much more brain-damaging than learning Javascript. I kind of have a problem with training people to "code" rather than teaching computer science; feels sorta like comparing a "wine and painting night" to a course in oil painting, in that you might shortc…

I remember geometry in 9th grade. I ended up programming my TI for all the formulas so it would prompt for the variables then you hit enter and viola, perfect answer every time.

We had a test where I ended up finishing in about 10 minutes. The second person to finish took 30 minutes +. In hindsight I should have went slower because it was obvious no one could have finished as fast as I had.

After the class was dismissed the teacher obviously asked me to stay after class and asked me if I had downloaded all the formulas I had used.

I explained that I did not download/transfer from someone and that I had programmed the calculator to do it for me.

Teacher called me out (probably not believing it) and asked me to program the volume of a cylinder.

Took about 10 minutes to write it up quick, showed it worked and rather than reprimand me the teacher did something amazing.

She said something along the lines of, "If you understand the formula enough to write a program to do it for you, that shows you understand it at a higher level. Rather than punish you, I will still give you a 100% and you are allowed to use your calculator for the remainder of the class as long as you do not share your program(s) with anyone else."

I never had many friends (loner nerd type) so that was easy and it was the easiest 100% I had ever gotten.

Re: Ask HN: How would you teach teens to code in 2019?

#49
I assume by "Code Proper" you mean the ability and knowledge to use computer science to program. If so, focusing on programming only would be like focusing on the HOW, the procedure, whereas focusing only on CS would be akin to focusing on the WHAT and WHY, the rules and purpose. These two complement each other.

In this case, your kids should learn the language that teaches them CS at meaningful and deep level, so that they can see what is the soul of programming. You would need Scheme language, the text being one by Friedman (sorry, not a fan of Wizard book for the reason that it is very MIT-centric and elitist in that sense).

Once they know enough CS and Scheme to find their way in the map of programming (in the scheme of things, pun intended), then I suggest at least two programming languages that differ from each other in how they solve problems and what kinds of problems. One of these is without doubt Python, because it is connected to all sorts of fine things like web dev, AI, general purpose programming etc, and is programmer-friendly enough to not cause mild and chronic masochistic psychosis like certain languages (not naming names, because this is highly subjective).

After your kids are experts in Python, they should learn Javascript because of its utility, but also how different it is from Python. These two languages for operational, utilitarian purposes that also nicely supplement what they did with Scheme.

Once they have a good grasp of Py and Js, they should build proficiency in Haskell so that they can appreciate programming from a completely different angle; Haskell is going to be more useful later, so it has more than just didactic value.

After Haskell, some Julia for computational programming would be nice, since Julia does things efficiently and differently.

At last, they should also master C, for historical and low access purposes (and to not to fail "can you C" question).

With these languages under the belt, and the basics of CS1, they should move on to CS2, and try real world programming. John Zelle's book teaching Python and C++ for a second course in programming is very nice.

Re: Ask HN: How would you teach teens to code in 2019?

#50
I have taught programming in schools in the UK. It's not necessarily that easy. If your kids are beyond Scratch and Minecraft, I would teach them Python - I think it's the best teaching language and it's also real world useful. I've mostly used Code Club resources but what I'd really like to do if I could would be to teach programming robots. Although really getting into coding will only happen if coding or a project grabs their interest, I think it is super useful for every child to have programming experience. It introduces them to a different way of thinking and teaches them that they can do at least some simple coding for themselves.
Post reply on HN