Live data from Hacker News

Ask HN: How to Teach Coding?

news.ycombinator.com

41–50 of 126 posts

Re: Ask HN: How to Teach Coding?

#41

If I could teach my younger self: 1. Stop theorizing. 2. Write lots of software. 3. Learn from your mistakes. https://blog.codinghorror.com/quantity-always-trumps-quality... Success comes when there is nothing left to learn from failure. Fail faster to learn this sooner.

I would only agree with the caveat that someone experienced should read your code, comment on it and improve on it.

I spent years slowly learning how to be a better developer, on my own. If someone had been there early on to tell me: "this is bad because X", I would have progressed twice as fast.

Programming at its core is very easy, building maintainable software is much harder. Knowing what to avoid only comes with experience, but much of that experience can be quickly transferred to you from someone who already has it.

Re: Ask HN: How to Teach Coding?

#42

1. Tell them what to do but do not tell them how to do it. (Just give a few pointers otherwise they'll be lost.) 2. Give them a playground to fail - Offload any non-business critical tasks and let them make mistakes. No one I know ever learnt programming without making any mistakes. Immediately tell them about best practices and how to avoid such mistakes in future. 3. Show them the impact of their work - There's not…

"No one I know ever learnt programming without making any mistakes." True! In fact, I don't know anyone who programs without making any mistake.

Re: Ask HN: How to Teach Coding?

#43
Remembering the very first course I received at 9 y.o. (logo with turtle) the pleasure came from seeing the actual output of the program on the screen: a drawing. Remembering my first C course at 20, whose program was a one liner designed on purpose for us to understand nothing: don't be afraid to tell "I cannot explain you that now" (e.g. why #include). Today if I had to choose a language/platform to teach coding, that would be the Arduino. Simple system, visible output, simple language although perfectly well formed C++.

Re: Ask HN: How to Teach Coding?

#44

Don't teach coding. I haven't come across a discipline yet where: 1/ there's such an astronomical disparity between students 2/ where it's more of a requirement to be an autodidact. All the good devs i know just pick up books and start reading. If you look professional devs out there, if they all taught themselves how to code, then one must wonder whether you can even produce a good coder by teaching them directly. I…

It's possible that the state of education, documentation, and general programming know-how was so bad and fragmented before and so almost everyone had to rely on some self-learning.

it is still fragmented. you can't point to a definitive source for "how to be [x] developer". you can just give them a roadmap at best.

Re: Ask HN: How to Teach Coding?

#45
First, I noticed that I had much more impact teaching things I had done recently (even if I know the theory). So when you create your exercises, try to solve them in order to 1. check the difficulty and 2. know where your students will strugle, what are the main pitfalls you will have to explain them or give them more hints.

Second, a session should be composed of a few exercises with immediate feedbacks / rewards (something quick to code but with enough notion to understand the subject of the day). Then build the momentum toward more complex exercises. The last exercises should be a bit more advanced than the current expected level of your students.

When I was a student, I had this structure were we had a between 6-10 exercises to learn C in 30 days (even if we did not understand all of it under the hood) from nothing to pointers, circular list, object-oriented (with structure) C. I found out that even if most of the students struggle, some of them will try to solve all of the exercises. After many days, they had made tremendous progress and were capable to achieve all of them most of the days.

These students boosted the rest of the class for the next few years as we were encouraged to share knowledge and teach each other.

Re: Ask HN: How to Teach Coding?

#46
Here is the lesson I gave a friend at a bus station waiting for a bus. First explain how a computer works in very basic terms because most people don't know. Don't assume they know how a cpu, how memory, or their screen works, even basically. They know none of that. Assume they think a computer is a magic black box.

Then using the same terms you used to explain how a computer works, sort an array.

Re: Ask HN: How to Teach Coding?

#47

1. Tell them what to do but do not tell them how to do it. (Just give a few pointers otherwise they'll be lost.) 2. Give them a playground to fail - Offload any non-business critical tasks and let them make mistakes. No one I know ever learnt programming without making any mistakes. Immediately tell them about best practices and how to avoid such mistakes in future. 3. Show them the impact of their work - There's not…

That's an amazing video Thanks for sharing. How do you suggest to show them the impact of their work - any suggestions?

Re: Ask HN: How to Teach Coding?

#48
I teach coding. Here are some of my insights:

— Remove the instrumental barriers first. I start with teaching the basics of UNIX shell, navigating the file system, processes, editing files etc. Students will move much faster if they do not stumble on basics.

— Continue with the notion of system libraries, dependencies and teach how to use system package managers to install stuff.

— Explain what APIs are and teach how to call them manually for some useful results. E.g. use curl and Twilio API to make phone calls.

— Write simple scripts: call multiple API endpoints, use variables to store intermediate results, use simple loops. I hate bash, though, so any other language will do.

— The lowest-level API is machine code / CPU instructions. Write simple assembler code to calculate something, translate it to ASCII string (explain how symbols are encoded in ASCII and Unicode/UTF-8), and package it to the boot sector / boot it via QEMU.

— Move to C, learn about data types, arrays, pointers, etc. Use some fancy GUI library for additional immediate gratification.

Re: Ask HN: How to Teach Coding?

#49

1. Tell them what to do but do not tell them how to do it. (Just give a few pointers otherwise they'll be lost.) 2. Give them a playground to fail - Offload any non-business critical tasks and let them make mistakes. No one I know ever learnt programming without making any mistakes. Immediately tell them about best practices and how to avoid such mistakes in future. 3. Show them the impact of their work - There's not…

I actually think step (1) isn't a good way to start unless the pupil has some prior knowledge.

Many (most?) people don't have know how to take a big problem and turn it into something they can make progress on.

You give them the lego bricks and say 'make me a windmill' and they don't have the first clue where to start. They may not even understand that programming is lego.

So, you either have to teach that first. Or, if you want to teach it later, start with a sequence of problems that have one obvious step each.

Some good approaches to attacking a problem too big to be obvious:

1. Break it into smaller and smaller pieces, then implement those pieces.

2. Bite off a small piece that you think you can do, then grow that.

3. Write down everything about it then think very hard about what are the essential characteristics of a solution.

Re: Ask HN: How to Teach Coding?

#50

Don't teach coding. I haven't come across a discipline yet where: 1/ there's such an astronomical disparity between students 2/ where it's more of a requirement to be an autodidact. All the good devs i know just pick up books and start reading. If you look professional devs out there, if they all taught themselves how to code, then one must wonder whether you can even produce a good coder by teaching them directly. I…

[deleted]
Post reply on HN