Hacker News new | ask | show | jobs
by austincheney 2619 days ago
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 thinking about writing instructions. Actually practicing their writing skills. The important part of that is that they struggle through the thinking process of finding a solution as a series of pieces and that they communicate that solution clearly.

What I want them to avoid is them thinking about programming as lego pieces they put together, because that becomes their expectation and reality. The problem with this is that when a person limits their expectation to putting things together and they move from education to employment they tend to be really good at configuring things and really bad at writing original code.

1 comments

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, you can write error handling code.
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...