I am working for a company, and a target for this year is to increase the level of CS knowledge among the staff.
The company does mostly engineering stuff so the people come from an engineering background, they might have some knowledge of programming, such as what is a variable, control flow, etc. but classes are virgin territory. That is kind of the average level there.
Me and a few others with knowledge (formal CS background, working in the AI team of the company) were assigned to increase the level of knowledge in the office. Basically each mentor was assigned a handful of mentees and the mentor decided what to teach and what exercises to give etc. to improve the algorithmic thinking and C++ competency.
I paired up with a colleague and we pooled our mentees. For some people it worked great. People went from variable names like a
, b
, ok
, x
and thousands of lines of copy-pasted code in main()
to actually nice variable names, class hierarchies with abstract classes/interfaces, clean code to the point where (almost) no comments were needed, etc.
I tend to think that we are doing something right, especially since my colleague and I also teach at our university (which is among the top3 in the country), create training materials, held multiple training sessions on different subjects, regularly mentor interns with great success and also did volunteer work tutoring middle school children in introductory programming, with parents at the end asking us to continue the tutoring for money. So we are not exactly new to teaching, and our experiences seem to indicate that we are not bad at it either.
However I have a student that doesn't seem to grasp some concepts at all even after multiple (>5) explanations using different methods and analogies. Will also forget basic techniques in the span of hours.
For example he needs a copy of a vector<int>
(C++). He will do the old song and dance:
vector<int> copy;
for (int i = 0; i < my_vec.size(); i++)
copy.push_back(my_vec[i]);
We told him several times and explained why it was better, faster, prettier to just do:
vector<int> copy = my_vec;
He always forgot to do this for his homework until we made his homework to clean up his code and implement a single utility function.
He cleaned up the code, then in that utility function went right back to the for
method. And when we pointed this out it took a couple of minutes and helping questions for him to realize what he did wrong.
Another example is that as a first project the mentees have to implement a basic Hill Climbing algorithm. This project has been given in June. We have people who will begin implementing Genetic Algorithms this week and it won't even be hard for them. People who have started from variable names like a
, b
, ok
, x
and thousands of lines of copy-pasted code in main()
.
Without precise instructions he's barely able to create functions like with 1-2 rounds of review "you get a vector of vectors as an argument. compute f
on each of the vectors and return the index of the first vector where the value of f
is above some threshold x
".
The hill climbing algorithm was explained exactly 7 times to him in different ways, with both me and my colleague actually spending time to come up with new analogies. Every time this mentee will enthusiastically say that this time he understood better than all the other times and then do something like just compute the best neighbor of the starting point and return that neighbor, and then name the function firstImprovement
.
The problem is that this person does not appear disinterested. When we explain things he nods and looks like he is concentrating and that makes us try again and again because it looks like he's trying too, but the issues above have been a thing for months. On a problem as simple as Hill Climbing.
Has anyone ever had such experiences? Any advice? Or any other site where this question would be appropriate?
vector<int> copy = my_vec;
vs.for (int i = 0; i < my_vec.size(); i++) copy.push_back(my_vec[i]);
makes it look like your colleague has a good understanding of how memory works under things, but only a vague knowledge of howvector
works, and so the colleague is uncomfortable withvector<int> copy = my_vec;
because they're not sure whether this makes a copy, or not. Imagine if you had aint[]
instead of avector<int>
: then your colleague would be right. They don't trust thevector
, so they're doing it in a way that they can trust. $\endgroup$