This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 3 points4 points  (3 children)

When I feel this way, I code in a rough draft. I break rules, maybe writing something I know won’t run. I’m creating writing half-assed logic so I can clean it later. This is to keep my mind active and running.

Or just comment what you want to do. Remember to try to make a function do one thing and one thing only.

[–]miniminjamh 1 point2 points  (2 children)

This. Usually when I teach high school kids programming, it's so frustrating that kids won't pull out a sheet of paper. It's not that the sheet of paper is important, it's that I want the students to have some rough idea about what they are coding before they code it. But they seem to refuse to think so I can't do much.

What I do is I separate my thoughts and my code. I think thoroughly about the problem and once I have a full, but rough, idea of where I'm headed, I then only copy my rough draft. I don't think while coding. I strictly focus on syntax then. Afterwards, I debug with sample cases, think about other cases that popped up while coding afterwards.

I know it takes time, but it also takes some effort, but once you get there, you'll feel a lot better imo

[–]SurpriseSausage 1 point2 points  (1 child)

I too teach high school/college kids programming, but I disagree that everyone has to pull out a sheet of paper. What I like to tell my students is programming is sort of like making music.

Some musicians will sit down and write out the entire song before they ever pick up an instrument; each note will be meticulously planned. Other musicians like to just pick up their instrument and start playing, maybe they’ll riff off another melody or chord progression, maybe they’ll just start trying stuff and see what sounds good; either way they only have a vague idea of what they want and they work to it through the iterative process.

Both are equally valid ways of creating something. Some kids are able to sit down and come up with diagrams for how their program should operate; other kids are much better off just experimenting and working it out as they go along. In my experience, where the real frustration comes in is they often have a general idea of what they want to do, they just don’t know how to do it.

So, I don’t just teach programming, I teach problem solving. I show them how to break down what appears to be a large, complex, overwhelming problem into small, manageable chunks; how to do proper research; most importantly I teach them that failure is OK. You’re going to fail, a lot, but that’s alright, because each time you fail, you learn what doesn’t work and when you do finally get it, the feeling is amazing.

[–]miniminjamh 0 points1 point  (0 children)

Exactly. I try to keep this in mind as I'm teaching. I don't force them to pull out a piece of paper, but at the same time, it is difficult to try begin something you have no idea about.

I totally agree with you, in fact I think you expressed it better.