Tag Info

Hot answers tagged

137

You are battling the students' balancing act of their need to care about your subject and their need to get passing grades. Many students feel that: (Get it Wrong || Experiment) == (Failing Grade && Waste Time) As soon as a student feels that their time or grade is at risk, even for an interesting subject, they stop learning and jump straight to ...


131

I interact with high schoolers a lot, so I answer this question quite often. Keep in mind that 15 year olds are much easier to explain programming to than 50 year olds -- so you need not dumb things down or use far-fetched analogies. I usually start off with examples of what programs are: Apps like iTunes, Photoshop, Chrome, and games including console ...


124

I usually prescribe the same sequence for anyone who wants to learn programming. It's very theoretical, but it lays a good foundation. It should take three or four months of fulltime study, but programming isn't something you learn overnight. If you can't get through this sequence, you're not going to be able to program, so you might as well give up now. ...


120

You could present them a series of exercises, each one building on the previous while adding some extra element or twist to the problem, or investigating the issue from a different perspective, which reveals a weakness of the previous solution, requiring a new, different approach. This forces them to think about, analyse, modify and experiment with each ...


105

Directory / File structures are the best example of a use for recursion, because everyone understands them before you start, but anything involving tree-like structures will do. void GetAllFilePaths(Directory dir, List<string> paths) { foreach(File file in dir.Files) { paths.Add(file.Path); } foreach(Directory subdir in ...


88

Sorry, but I think your teachers are right. If you were developing software for a customer, and the customer or your boss requires you to use specific design patterns, I would definitely say that that was a big mistake. But there is a difference between class assignments and software development for a customer: both serve completely different purposes: If ...


74

Someone much wiser than I once said: The nun Wu Jincang asked the Sixth Patriach Huineng, "I have studied the Mahaparinirvana sutra for many years, yet there are many areas i do not quite understand. Please enlighten me." The patriach responded, "I am illiterate. Please read out the characters to me and perhaps I will be able to ...


74

I explained it to my five year old with the following: Me: "You know how, in stories, people say magic words, and change things in the world?" Her: "Yeaaa?" Me: "That's what computer programming is." Her(quietly): "Wow." 15-30 minutes isn't enough to explain anything real, and explaining the underlying complexity is a sure way to make them run screaming. ...


72

To explain recursion, I use a combination of different explanation, usually to both try to: explain the concept, explain why it matters, explain how to get it. For starters, Wolfram|Alpha defines it in more simple terms than Wikipedia: An expression such that each term is generated by repeating a particular mathematical operation. Maths If your ...


57

A 15 years old person can understand any concept. I myself started programming at 14. (at school, many many years ago) 30 minutes is enough for a demo. Show her the magic of programming with something as widespread as a browser. Find a PC connected to the internet. (more fun if it's not yours, and even more if it's hers) Go to ...


52

I think that C++ may overwhelm your brother. Try with something simpler. I'd suggest this book http://inventwithpython.com/ From the preface I have more thanks for your interest and more apologies for this book's deficiencies than I can enumerate. My motivation for writing this book comes from a gap I saw in today's literature for kids ...


51

When it comes to 'very few rules', i would argue, Lisp or Smalltalk would win. The bare Syntax can be written on one beer tab. But in my experience, the simplicity of lisp and smalltalk does not mean they are simple to understand and easy to teach. While not the 'pure' way, in my experience the to-do-list-style of imperative languages is the easiest to ...


49

Look for things that involve tree structures. A tree is relatively easy to grasp, and the beauty of a recursive solution becomes apparent far sooner than with linear data structures such as lists. Things to think about: filesystems - those are basically trees; a nice programming task would be to fetch all .jpg images under a certain directory and all its ...


48

Well, recursion is actually pretty simple to grasp for kids. Don't try it with mathematics or whatever the other people here are suggesting. They are too young to understand it. It's too abstract and boring for them. Instead: Show them a picture of a painter who is painting a picture of painter who is painting a picture ... Something like this: There are ...


46

Python... definitively. C++ is nice and a sure value, knowing it will pretty much enable him later to quickly grasp any other language in the family (Java, C# etc). BUT it is also arcane and complex. Some aspects of its syntax are rather difficult and unpleasant. Python has definitive advantages here for the learner : The REPL : To be able to whip up a ...


45

I found that diagrams were very helpful. Example: This sort of diagram helped me see that pointers were their own variable, but contained a value that was the location of another object, i.e. array or string. Also, when done in pencil, I could use it to trace my program on paper, or on a chalkboard/whiteboard.


43

I think you should start with the data types that the language has built in like arrays and pointers, and when your students comprehend those, move on to classes and OO, then the STL. The reason is that you can teach people to understand arrays without understanding much else besides variables and the underlying computer architecture, but you can't teach ...


43

Several things that come to my mind: Give them assignments where they actually have to explain the code someone else (you) wrote. Understanding of the previous code or more specifically lack of it is both the largest cause and danger of cargo cult programming. Ask them to use comments, line by line if necessary, to explain your program in plain English (or ...


40

I'd say LISP, or Scheme or a language from that family would be the most orthogonal. With let, lambda, define, if, cons, list, and ( ) you can teach pretty much anything that you'd want to in an intro course. There's also no need for preprocessing directives or int main() and stuff like that which students just include but don't see a reason for. In my ...


40

There are a few things that practically every beginner struggles with. Students need to know how to read code before they can learn how to write code. The sequential nature of imperative languages. People have trouble understanding that functions are executed in sequence, one item at a time, like a recipe. One way to overcome this is to show some code ...


39

The calling of a function from within that same function.


38

http://stackoverflow.com/questions/105838/real-world-examples-of-recursion modelling a contagious infection generating geometry directory management sorting http://stackoverflow.com/questions/2085834/how-did-you-practically-use-recursion raytracing chess parsing source code (language grammar) ...


38

Look at it in another way. This cargo-cult phenomenon is the novice stage of the Dreyfus Model of skill acquisition. This is how we learn. When I first learned to program, all I was doing was typing in pages of code from the back of Compute! magazine. Repetition is key. Babies learn to talk by copying the sounds they hear their parents make. Everything we ...


37

This is my own experience. Take it for whatever it's worth. Looking back to when I started programming, I really wish I would have learned about memory first. No, it's not exciting. It'll make you glaze over. But it's a ridiculously easy concept to teach. Just show a 1-D table and make them go through a few mental exercises: Lesson 1: This is 10 bytes ...


36

Describe what it is, just leave out the technical terms except for definitions: You have five jobs to do. You need to start working on all of them right now. Each job is a thread. You are the processor. Spend a little bit of time working on each job and then move to the next one, making sure you give attention to all of them. If you have more people, a ...


34

Short Answer: Engage them (put the puzzle in their mind), empower them (trust their answers). It is the question that drives us! - Matrix. Generally, in my observations, that juniors have their own world - their own limited view of how they think and in some part their own enthusiasm/favorites/opinions about things. There is nothing wrong about ...


31

When I first "learned" about pointers, I was sort of thrust in to it. My university had made the decision a long time before I enrolled to center the curriculum around Java, so when my Data Structures professor gave one lecture on C and asked us to implement an XOR-List with pointers I felt like I was getting in to something way over my head. I understood ...


31

Ok, by popular demand ... Let the free market figure it out. You know, 95% of psychology majors end up doing something else. Not everyone with a CS degree/minor ends up programming, but they make better managers, analysts, project managers than those without. Do not carry the weight of the world on your shoulders. CS degree is just a piece of paper. Those ...



Only top voted, non community-wiki answers of a minimum length are eligible