Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

This question already has an answer here:

I am mentoring a 12-year old in programming. He has started to do some VB (.net) (2008) and is making simple WinForms programs, but does not get some of the basic concepts (loops, functions, datatypes) Coming form a C/C++ background, I don't know where to start I don't think he's is up to c/c++ or java quite yet

share|improve this question

marked as duplicate by gnat, Martijn Pieters, thorsten müller, MichaelT, Kilian Foth Apr 14 '13 at 18:25

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

1  
Have you considered "Scratch" instead? The barrier is much lower and more intuitive. –  user1249 Jun 15 '11 at 9:36
    
@Thorbjørn Yes, i did consider using gui-based programming, but i think he may get a little bored. Thanks anyway –  Tim Jun 15 '11 at 10:20
3  
How about "Avoid VB like the plague"? As Dijkstra once said "It is practically impossible to teach good programming style to students that have had prior exposure to BASIC. As potential programmers, they are mentally mutilated beyond hope of regeneration." Some of us have managed to throw off this particular affliction, but it was a long, hard slog. *8') –  Mark Booth Jun 15 '11 at 10:26
1  
Have you tried JavaScript. Browsers have a whole bunch of development tools available that are build right into them and JavaScript is probably the easiest and quickest language to see real changes code makes to the screen. Websites like jsfiddle allow for effortless prototyping. –  Raynos Jun 15 '11 at 11:44
2  
@Mark Booth, I don't think VB has much in common with the kind of BASIC Dijkstra was referring to. –  Joh Jun 15 '11 at 13:47

10 Answers 10

up vote 5 down vote accepted

I would advise to build upon what he knows. This means keep VB as the programming language.

I very strongly advise against going to C++. Getting to understand how the machine works is valuable, and you can use C or assembly for that. The added benefits of C++ (classes, stricter static typing and generic programming) are available in other languages which aren't as frustrating to use.

To teach data structures, you can start with simple records (i.e. simple classes without methods and all-public data) that reflect the fields in a form.

Once you have data, you can introduce simple searching using loops.

I started programming early too, and I remember that one of the "A-ha" moments came when I understood incrementing, i.e. the concept behind using the same variable to read and store a value. You probably want to introduce that at some point, but expect some difficulties if he hasn't figured it out yet.

After he is able to find the smallest element in a list, you can introduce O(n^2) sorting algorithms. This will give some intuition about loop invariants, and it's easier to implement using functions (a function for finding the smallest element, another one on top to do the sorting).

All this makes it possible to build some database application to store and analyse football players, rpg characters... I'm sure it's possible to couple it to the child's interests.

One last note: If you are familiar with functional programming, introduce that already now, even though he is using VB. Functional programming is easy, but can be hard to learn after your brain gets wired for procedural programming.

share|improve this answer
1  
+1 for learning functional programming first. Learning imperative afterwards is a lot easier. –  Raynos Jun 15 '11 at 11:45

For showing how basic constructs like if/else and loops work, you can't beat Scratch. And once he's got those concepts down, he can use the very similar BYOB to do some scarily complicated CS-style stuff.

share|improve this answer

Your best bet is to learn these concepts in VB yourself and build simple demonstrations. Things like this (untested):

FOR i as integer = 1 to 10
  Console.WriteLine("Hello")
NEXT

A few other tips:

  • Deal with one concept at a time and don't go too fast
  • Teach concepts that help solve problems that the learner has discovered for himself
share|improve this answer

The language is - for the most part - irrelevant for a beginner programmer. People can argue all they want about using C or Java over VB or whatever, but the differences aren't that significant at his level.

My first programming class was AP Computer Science in high school, and I learned all about loops and print statements and sorting and encapsulation and stuff like that in Java. The issue with the AP curriculum, and most "intro to programming/CS" books are that they don't teach you WHY. They teach object oriented but don't even mention functional or procedural programming, so you form the misleading idea that the only programming paradigm is OOP and that's how it's always been.

Your focus needs to be on two things:

  1. Developing good programming habits.
  2. Developing good programming fundamentals.

Don't just tell him "this is a for loop, this is a while loop, check out iteration!" Explain why they are important. Make him think about it in terms of real life.

Give him small problems i.e. "print all the numbers from 1 to 100." Help him along the way, and once he's accomplished it, work with him to revise the code and make it cleaner.

Once he knows more, try giving him programming puzzles. Project Euler is great for that (http://projecteuler.net/). Things that get him to stretch his mind and learn the power of computer science.

From there, encourage him to explore and learn about other languages, and learn about debugging! Debugging will help him see how the variables change, and it is a logical transition to data structures (the idea is you see they change, then you want to learn where they're stored/why they change, then you move into stack/heap and memory management).

And don't ever push programming on him. I and most of this community get giddy when we learn about a new strategy in programming or some new language or an interesting problem. Other people just want to edit html tags on a website and want nothing more with programming. At an early age, if you push him too hard and he gets turned off from programming, he might never come back again.

share|improve this answer

I use to teach a class for grade school students who have a learning disability and one day in computer lab decided to introduce Apple BASIC. I learned it in college through the education department, so I figured I'd see how much my students could learn. My following class was able to use Hypercard and prefered the GUI and only once dabbled in editing the macro code.

Variables weren't a problem, but they didn't see the need, "Why do I have to use X = 4 when I can just use 4?" Once they saw that you could prompt the user for a response and then do things with the response, it made more sense. Of course we covered the dreaded GOTO. Repeatedly filling the screen with your name is cool at first, but that gets boring. Having a counter (I thought they were more familiar with this term than loop.) like FOR/NEXT is much more useful. For data types we got as far as 'you need a number to do math. Even if a number is in a string, you can't do math. Who ever adds up telephone numbers?

Help the kid build something. The computer science can come later.

share|improve this answer

(Disclaimer: I don't know VB)

You should be able to learn the basic concepts of a new programming language rather quickly (I can do that in an afternoon, assuming there isn't a major paradigm or mental-model shift, which there shouldn't be from C/C++/Java to VB.Net).

Explain how things relate to the real world, as in, let's think we have road directions:

Travel forward until you come to the Café at Street x
[if there, then] Turn right
[while not at destination] Continue travelling forward

As noted earlier, the GUI is not needed here and will just be distracting, so use a CLI program to show how things work.

share|improve this answer

Digging in my past I found some simple everyday problems that can be used to tutor a young programmer. 1. having the score each player made in a game sort them 2. Find the average in a series of numbers 3. Find the mean value of a series of temperatures 3. Type the names of students given the lists of the English and physics classes (some might be in both) 4. Develop a small phone book with names and telephone numbers Simple everyday things that show the use of computers beyond forms and involve some simple algorithms and data management

share|improve this answer
    
Nice. I might try some of them when i finally move away from VB -- to C# or Java –  Tim Jun 15 '11 at 11:01

I think you should let him start with basic programming Turtle Logo which contain very basic operator and easy, friendly UI to understand. It's also provide a good way to practice with many basic things in programming like: Loop, Logic operator, Graphic ....

Take a look with some documents and online tool:

share|improve this answer
1  
Even as an 11 year old in the 80's I was disgusted by the though of programming in LOGO. *8') –  Mark Booth Jun 15 '11 at 13:57
    
Yeah, that is best way to get in programming world :-) –  Uoc Nguyen Jun 15 '11 at 17:43

Get them while there are young, like the tobacco companies.

He should be learning EMACS and LISP. Everything else is downhill from there.

share|improve this answer

Like Kramii said, build simple demonstrations, first seperated (eg. only a loop or only an if), later combine them (eg. a loop with an if in a function)

use a ConsoleApplication to demonstrate this, so he won't be distracted by the cool visual features. Later you can introduce the acquired knowledge in a WinForms-app. First learn how to walk before you start running.

Use the debugger to step through the program so he can wacth at runtime what happens.

share|improve this answer
    
thanks for the downvote, but please specify what is you don't like about my answer. –  Natrium Apr 28 at 8:51

Not the answer you're looking for? Browse other questions tagged or ask your own question.