C++ instructors who don't know C++

I had a discussion section for my object oriented programming in C++ course. The lectures are given by a professor in large lecture halls, and he seams very good. The discussion section, where you are in smaller groups, is taught by the TA's. I went to my discussion section today, and this is what I learned.

This is a class
1
2
3
4
someclass{
int a;
int b;
}


You can make a constructor

1
2
3
4
5
6
someclass{
int a;
int b;
someclass() {
}
}


This is a constructor initializer list. Here you can initialize stuff.

1
2
3
4
5
6
7
someclass{
int a;
int b;
someclass(int a, int b)
a(a): b(b)
{}
}


It is exactly the same thing as writing it like this

1
2
3
4
5
6
7
8
9
someclass{
int a;
int b;
someclass(int a, int b)
{
a = a;
b = b;
}
}


student - "That syntax doesn't look correct"

TA looks at it for a while and replies no this the correct syntax.

Now, here you can add a destructor like this

1
2
3
4
5
6
7
8
9
10
someclass{
int a;
int b;
someclass(int a, int b)

~someclass() {}

a(a): b(b)
{}
}


...

I normally try not to make negative posts, but I had to vent this frustration. Most of the students in the classroom didn't seam to know any better and are actually taking notes and thinking they are learning something.

What is crazy, is that a tenured lecturer was sitting in reviewing his teaching style. It's almost unimaginable this could happen. The TA clearly doesn't even know the basics of C++.

Last edited on
I'm glad that my Java AP score placed me out of CS1 (C++) and into CS2 (Java)

My Java professor and I are on the same level, though obviously he knows more about working in the industry than I do. We have good conversations.
Last edited on
Many things in programming should only be learnt but not taught.

Teaching language syntax (even for complex and sometimes bewildering language like C++) to class is a bad idea, I fear, since this is the information which should be simply read thoroughly from the books and tried manually while playing with compilers.

So you may safely think that such instructor will not do much evil. People who really want to learn - they will learn without his instructions.


The TA clearly doesn't even know the basics of C++.

On the other hand I want to say that C++ became so complicated (sometimes unnecessarily) in syntax over time, that some of the things really are not worth to be known :)

Many business-level applications could be well written in languages with automatic memory management so that destructors themselves are quite specific thing...
Last edited on
If you cannot write ~MyClass() = default; then you're doing it wrong ;) (or implementing the standard library by hand).
rodiongork wrote:
this is the information which should be simply read thoroughly from the books

Unfortunately, many book authors don't know the basics of C++ either. But even if good books are available, an instructor that actually knows the subject would be able to explain the parts that appear complicated in the book... but those people have better paying jobs.
I suppose I was fortunate to have never taken a programming course in a lecture hall. My fundamental programming courses were taught in classrooms where the seating arrangement was paired-off seats and a computer (so, two students to a machine). Coding lectures and examples were performed real-time with a live compiler for everyone in class.

When I was a TA, this allowed me to sit down with the students when doing exercises after lecture and walk them through solving syntax errors, beginning from the compiler errors. Solving problems iteratively in a setting similar to how they worked on their projects at home really helped to pass on the problem-solving process in programming.

As far as knowing syntax, I did not spend much of grad school writing computer code. Being a TA was a way for me to pay for grad school while I spent most of my time working on my thesis and doing more academic coursework. The lecturer may have spoken to the TA after class to correct errors in the TA's methods, but this interaction would likely never take place in front of students.
That the TA doesn't know c++ is imaginable. That the TA would come to class so ill prepared, that the few things he taught were egregiously in error is almost criminal. This does damage to the student rather than help them. They are paying thousands of dollars and much of their time to be there.

If I got a job teaching a language I don't know, I would either carefully research what I was planning to teach for the day, and make sure the code was correct, and my claims accurate, and or I would use references as I go along. The latter is actually not a bad practice when teaching. Finding the information you need, to do what you need to do, is one of the key skills in programming. What is a constructor initializer list, does anyone know? Well, let's see exactly what it is, look it up... This both gets the student the information, and teaches them how to find information. Unfortunately, the TA was attempting to get away with pretending he knew the material, and just spent an hour drastically misleading everyone by teaching wrong information and syntax. In this field, you're supposed to be open about what you don't know. Heck, it's one of the main guidelines for using this forum even. Just say, "I'm not sure", but we can quickly clear this up, google ... "

So what's the point of having the TA if they not educating properly? It would be better that one of the top students teach the discussion than a grad student that doesn't know the material.

And the Reviewer didn't correct the TA in front of the students, nor tell the students afterwards that the information was incorrect. This is understandable because it might be rather embarrassing for the TA. But it's the TA's fault. The students are the ones who are paying to be there, and who are supposed to be taught. I don't think such priorities of protecting the TA's feelings over the education of the students should be made, unless the TA or someone else is going to send a memo out soon later explaining everything.

The other thing which was hard to listen to, was that a student asked how to resolve circular includes when two header files each include each other. The TA didn't understand, and said that you would put a bunch of header file includes in one header file, and include that everywhere. Bangs head against the table. The correct answer is that you use a forward declaration instead of include in at least one of the header files, and then include in the .cpp file ... and you can only do that in these circumstances ...

Then he talked about inline functions, and how in lining is faster so you should do it if you want it to be fast.
Last edited on
Yeah, I certainly can't speak for your situation. That sounds pretty bad. When I was an undergraduate, we learned C++. By the time I was a TA they switched the freshman cirriculum to use Python. I'd never used Python, so I was learning with the students (at least in terms of syntax). It helps a TON to have a compiler ready to go when working through programming exercises, especially if you don't have a handle on the syntax.

I wonder about the utility of pen-and-paper coding when you get to the level of creating classes, but it is common in programming interviews and I had a freshman course in FORTRAN where we did lots of code on paper. However, that class had no TA's and a REALLY knowledgable instructor.
Topic archived. No new replies allowed.