Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Teaching OOP (C++) outside-in vs inside-out approach [closed]

Tags:

c++

oop

I am running a programming club at a high-school, and I have introduced my students to OOP using simplistic classes in C++. I believe at least theoretically they get the idea. I would like to be able to offer them a specific project they can work on together. The question I have is which approach to take. When I took programming classes in college, I saw two different approaches, but in my opinion they both had serious shortcomings. I ended up sleeping through most of them and learning the stuff on my own from books and examples. Now that I am in the teacher's shoes, I would like to get your opinion on which approach is preferable or if there is a third option.

Approach 1 that was used, was to write a program on the board (or on a computer with a projection screen). The class definitions were always written first. Usually students would look really bewildered at this point, because the purpose of variables and methods would seem entirely obscure to them. The only time that they learned about what each variable and method was for and how they interacted was when the instructor would finally write the implementation (I called this the outside-in method)

Approach 2 was to explain what we are trying to achieve, and creating classes and members as needed. This has the opposite problem. He would be writing a method that would use these imaginary classes that would have to be implemented later. But the students has no idea how these other classes would work.

like image 615
MadOgre Avatar asked Apr 04 '13 23:04

MadOgre


1 Answers

As it happens, I worked my way through University by working as a teacher. I am now a software engineer.

In my experience, it is paramount that the students be emotionally invested in a programming project. I'll get to your question in a minute, this is a necessary preamble.

To get there, I made the topic of the program something that really interested them, regardless of how silly it seemed, as long as it was something that connected with them in their world.

So, it could be (depending on the age of your students) about ranking singing stars by their talent level, including Justin Bieber. You can imagine the uproar at that one.

Like, Load their lyrics and count the number of times they say the word "baby". Something creative, something fun.

This will make "dry" questions come alive. Like, what should the "singer" class look like. Why it should have properties like "octave range" will be immediately intuitive.

Should the singer class have a method called 'barfOnStage'? (The Biebs barfed on stage a while ago). Sure, why not!? They will easily see the difference between methods and properties.

I mean, I'm just talking off the top of my head, I'm sure you can apply your own inventiveness and creativity to whatever's appropriate for your kids.

I would love to hear what you went with, and how the kids' project turned out.

like image 142
Sliced Bread Avatar answered Oct 24 '22 04:10

Sliced Bread