Live data from Hacker News

Ask HN: How to Teach Coding?

news.ycombinator.com

91–100 of 126 posts

Re: Ask HN: How to Teach Coding?

#91
> So, what helped you to train others or receiving knowledge?

Start with thinking about what it actually is you aim to teach. Are you trying to teach someone the ability to work on a web application in a particular language, or are you trying to teach them how computers work so they can work on anything in any language?

Once you've identified your goal you can work backwords from there to what your trainee already knows.

Re: Ask HN: How to Teach Coding?

#92
I taught a Python course to people with humanities and non-technical backgrounds. The thing that helped me was to understand what was going on in their heads when I said things like 'array' or 'datastructure'.

Those of us that have written a lot of code take these mental structures for granted; we easily manipulate them in our minds to discuss things. People that are new at this will literally have no mental model for concepts embedded in datastructures and algorithms.

Every subject has to get around this; I struggled with this when trying to move from single variable functions to vector valued functions. The most annoying thing as a student is having an instructor talk at you and not to you.

Re: Ask HN: How to Teach Coding?

#93
Don't teach them coding, teach them how to build things with code. I do this daily for a living (https://cleverbeagle.com).

The speed at which I see people pick up concepts is much faster when focused on writing code to implement an idea they have. "I want to build a real-time feed like Twitter" is a lot more concrete than "I want to learn websockets."

Re: Ask HN: How to Teach Coding?

#94

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…

[deleted]

Re: Ask HN: How to Teach Coding?

#95

It depends. What is the situation? You've mentioned internships so I am guessing it is business? What is the end goal? I am far from a programmer but what I have learned has been through exploration. Here's a web page. how can I make a userscript to get rid of that nag screen? (I know I can use a popup blocker or something but I'm trying to learn) I want to make a little browser addon. let me find one that does somet…

Well, he has the basics like data control structures, database usage, a little bit OOP. I think the missing link is how to build real world processes with it.

I'm sure we will find basics that are missing and will have to fill that with knowledge, but we have a good starting point.

By what you said above, don't underestimate yourself there. Building scripts that touch real things to make it better working for you (and others) is a great step on the journey to write good code! Thanks for your feedback :)

Re: Ask HN: How to Teach Coding?

#96

Has anybody found that, while coding is simple super to us, your less fortunate friends who are actively stuck in career paths like bartender/waiter/laborer with no path out don't find it as simple? Do you guys think coding (low level, junior frontend developer type stuff) could be taught to anybody?

It could be taught to most people, but aptitude correlates with enjoyment - if they don’t get joy from creating things, or they don’t enjoy spending time in a world they have to use their imagination to fully see, then they will probably never learn to code. I don’t know if you can get people to enjoy these things if they don’t already by the time they’re 25 or so. Everyone is naturally either more cerebral or more somatic, and environment can affect this balance, but once the brain is done developing there’s not much that can be done to change it. In my experience, somatic folks take a lot less readily to software and try to figure out a way to avoid figuring out the actual problems.

Re: Ask HN: How to Teach Coding?

#97
post #71

I try to get people to understand that coding is writing logic. That is actually two separate skills: writing and logic. Many people want programming to be something that it isn't, possibly something glorified by games or media. That said you can generally detect potentially great future programmers without talking about any code or coding experience. When teaching people to write code I try to get them to practice t…

1000% this. Just because LEGO pieces fit together doesn’t mean they take the form of a cohesive argument. It’s actually concerning to me that there is too much focus on practical coding skills in e.g. high school, to the detriment of essay-writing and critical thinking in non-technical domains. The “five paragraph essay” is actually fantastic preparation for “defensive coding” - if you can write good counterarguments…

Another good writing task for programming is to write down a recipe (properly). However, to do it off-the-cuff would mean you need to know how to cook - so maybe not the best example.

Something that could be done is describing the task of making coffee, or a sandwich, or describing your entire morning routine.

Focus on teaching the details - let the students try it first without any prompting other than telling them to try it. Then select one at random and go over it showing where certain details are missing.

For instance, they might say "I brush my teeth, then I get in the shower" - but what they really did was "brush my teeth, turn on shower, wait for a particular temp, until that temp continue brushing teeth, when temp is reached, stop brushing and get into shower".

Of course, even that isn't detailed enough (do they still have their clothes on? maybe those should be removed before getting into the shower?) - but it would show how you have to think in such extreme detail for programming, plus the whole "control logic" and "logic flow" of such a description.

Recipes are like this too, but knowing how to properly write one does require cooking knowledge, which many people don't have. But everyone (usually) has the experience of "getting ready for work" or something similar...

Re: Ask HN: How to Teach Coding?

#98

There’s a lot of knowledge we take for granted when programming. A lot of problems in coding come from having an inadequate mental model, so I always try to explain how code runs on the machine as my first lesson. I’ll give an example, to an experienced programmer you can look at code and tell what sequence the lines are going to run in and what sequence the expressions will probably be evaluated in. To a new program…

> to an experienced programmer you can look at code and tell what sequence the lines are going to run in

Unless the code/language is asynchronous - which requires a different mindset. And/or event driven - yet another mindset.

I've seen developers struggle with both; I know when I first learned event-driven programming (via Visual Basic 3 - yep, that long ago) - it was a different thing to think about, but it eventually became second nature. Windows 3.x cooperative multitasking helped to make it clear, too).

But yeah - they have to start somewhere, and sequential processing is the standard entry point, because most people understand cause-and-effect in the real world.

Technically, they also understand asynchronous and event-driven models, too - because both are real-world things as well - but they really don't think of them that way - or at least don't use those terms (if they think about them at all). Figuring out what terms they do use for those type of things might be key in teaching them such concepts...

Re: Ask HN: How to Teach Coding?

#99
post #85

Earlier quoted context omitted.

sounds like you have a lot of programmers and little system engineers / 'devops' engineers. in my opinion it's a different kind of person who can fight environmental details into working with some programs (i.e setting up some environment / server and getting everything tested / deployed) than a person who can write the thing being deployed. Generally i think both have very different information to their disposal. So…

What good is a developer who can’t deliver outside of a debugging/development environment? I mean, I get what you are saying, but who can afford people who are that specialised?

A lot of places. The role of "devops" not withstanding, develment vs operations is one of the first distinctions to specialize in.

Re: Ask HN: How to Teach Coding?

#100
post #66

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…

Interestingly, I learned to program in a completely different way. When I started in 1979, the computer terminal where I learned could only run BASIC. There were no directories, just BASIC. We had one book that could teach you most of the commands, IF--THEN GOTO, SET, PRINT, FOR, NEXT, GOSUB. There was no WHILE statement. I think I spent months playing with those before learning about arrays. The biggest breakthrough…

I learned how to program BASIC in the early 80s from magazines, when program source code was printed out and you had to type it into your computer verbatim. At some point, you switch from being a typing drone to trying to understand what you were typing.

The worst part was when there were bugs in the printed source code. If you didn't know how to fix it, you had to wait until the errata showed up in a future issue of the magazine.

Post reply on HN