5 ms·
Potentially Ignorant CompSci Professor Making Student's Life Miserable
I'm presently tutoring a student who is taking a C programming class. This student isn't a comp sci student (engineering discipline separate of computers), but really enjoys programming and seems to wish to do it as a hobby.
However, my student is struggling and the nature of the professor's restrictions on how their projects are constructed as well as the strictly outlined structure of the code makes it impossible for them to:
1. Learn to write their code in a structured and safe fashion
2. Write code that doesn't develop subtle behaviors and problems due to a lack of understanding of pointers.
Amongst the sundry other restrictions choking off their ability to complete the coursework in a timely fashion is the inability to ever use global variables. They are outright banned. While I am fully aware of how those can turn ugly, utilizing extern + static properly largely invalidates these problems.
The exact structure of the functions and their arguments, prototypes, and definitions are outlined for the students and deviating from this poorly thought out structure leads to a reduction in grade much like if you were to use global variables.
I'm doing my best to help the student, but I cannot do their homework for them, and I'm having to remedially explain basic C programming concepts like how scanf works as well as how pointers && reference/dereference operators behave.
I sent an email to the professor mentioned above (with my name censored, as much as I trust you guys), and I'm including it below. Please do not castigate me over the email, I know it's likely inflammatory, but I spent from 8 pm to 6 am last night trying to give a crash course in C to a distressed and confused student who couldn't put together the homework assignment in a fashion that didn't develop bugs, or otherwise not function outright.
I'd like your guys thoughts, and if anyone wants more information I can provide it as I'll be eyeballing the comments.
BEGIN EMAIL
Hello, my name is C A and I'm tutoring one of your students who is taking a C Programming (200 something) class under you. The project that was due today (Wednesday), named Project 3, brought to my attention some concerns I had.
On the slightly more trivial side:
While I've seen professors require that the code be no more 80 columns wide (fairly reasonable request since a lot of people still use vi/vim or pico/nano for code editing), Your request that the indentation be made out of spaces rather than proper tab characters was baffling. Not only does this break indentation control in a wide variety of IDEs and editors, it makes the indentation non-trivially mutable and otherwise static.
If it's your desire that the code have a certain appearance, I'm certain that whatever environment you observe code in is capable of setting the tab character size to any arbitrary size you prefer. As the case may be, 4 spaces if you like.
And then on the more serious side:
You de facto disallow all use of global variables. I will for the sake of clarity assume that this means no use of extern to access external variables as well. This particular requirement (on penalty of a reduction in grade) left me quite speechless. Have you ever read K&R C? The very people behind the creation of C and Unix made use of global variables at will whenever it was appropriate, while using static for scope control.
My mention of static here is critical. If it's your concern that global variables can make a multi-file project develop unpredictable behavior, then I would point out static variables.
Your ban of global variables forces the students to (ab)use passing locals by reference and turn the program unnecessarily into a pointer filled mess. What compounds this problem is that some of your students are not computer science students and only have the faintest grasp of how pointers, reference/dereference operators and the like behave.
This turns a potentially useful project into a monster that takes a considerable amount of time. I spent from 8 pm until 6 am last night helping the student I've been tutoring
1. Dispel some strange habits that were by and large a cargo cult since they have no rational justification and were only being followed out of ignorance. (Like putting void in the arguments of functions.)
Believe it or not, the compiler has the faculties for understanding that the absence of arguments does truly mean an absence. It's unnecessary and non-standard to put void into the arguments of a function where no other arguments exist.
2. I spent a considerable amount of time developing analogies to assist in explaining how pointers, the reference operator, and the dereference operator affect variable behavior and data access. Said student didn't even grasp how scanf worked, they were just copying code that they saw you put up.
You're creating cargo cult programmers, regardless of intended vocation, this is not a means of educating or training people in the craft of programming. They're following patterns and copying code they barely understand the function of. What worsens this matter is that C is the first programming language said student has ever encountered.
Whilst I first became serious about programming while learning C, it's hardly an optimal choice given the alternatives available. (Utilizing the pseudo-code wonder Python would be a rather flexible and engaging choice.)
The concerns I would have about using C as a first programming language for teaching someone are brought to full fruition in the current situation with the abundant confusion regarding pointer variables and in the ignorance of how the library functions work.
This part exacerbates the problems above, you define very strictly the layout and structure of the code by outlining the functions and arguments they are to have. This is obscene. This brings the cargo cult to an immeasurable extremity. There is no rational justification that I can muster this that doesn't somehow imply that the students would be incapable of constructing a good program without following this particular structure you've laid out.
You also, for reasons that are unjustifiable, you don't allow breaks or continues, which turns flow control into a painful and far more complex matter than is necessary. My only guess here is that you took Edsger Dijkstra far FAR too literally. I recommend reading Knuth's essay on GOTO as well as noting the use of breaks and continues in production-grade code in the Linux Kernel.
In the case of project 3, we see that you've forced them to create a function called getInput() which calls out to three other functions. There is no reason for this function to exist and all it does is further complicate passing the local variables by reference for the students. Was it really worth eliminating two lines of code in order to make your students' lives that much more painful? Really?
The abuse of passing by reference turns code that could've been elegant, simple, stable, and predictable into a cumbersome and brittle bastard that has run-time crashes due to bad pointer manipulation.
This is a 150-350 LOC project. And it has run-time errors. I've written similarly complex x86 assembly with fewer problems than what your student suffers from under your restrictions.
There remain only a few possibilities to my mind, save any information I'm not aware of and absent you taking up the opportunity to let me know why you're subjecting your students to this.
1. You're completely unaware of static/extern, you were taught long ago that global vars are evil, and like the cargo cult you've inculcating in your students, you accepted it blindly. The evil of what you were taught is perpetuating itself.
2. You sincerely hate college students and want everyone to hate the programming, let alone the C programming language.
3. You're some kind of universal evil incarnated in the form of a professor that is antithetical to rational decisions.
4. You've got a hell of a story to tell me.
I look forward to hearing from you so that I may understand where exactly it is you're coming from.
--- C A
P.S. What saddens me most is that the student I am tutoring loves programming and would love to do it as a hobby, but is struggling for various reasons external to their own mental faculties.
END EMAIL
Cheers guys. Also, all hail Erlang. :P
- joshwprinceton 18y agoWhile I agree with a lot of what you are saying, I would suggest (beginning by) asking the professor why he/she is disallowing global vars. In the follow-up email, perhaps explain to the professor the difficulties that you and your tutoree encountered because of their inexperience and suggest that students be allowed to use global vars (and their aesthetic code layout of choice). Either in this email or the 3rd email, if there's still no success, you can probably outline your position without turning them off. In spite of the difficulty, it sounds like you are offering a good resource for your student by fostering and supporting their passion for programming.
- alnayyir 18y agoI've had people tutor/apprentice under me from time to time. I usually find them sincerely grasping for help in IRC, and I rescue them from the denizens of #C if they cannot get help. What'll usually pique my interest is that they did try to google/research something before they asked the question. I've got only one student under me right now. Frankly, part of what makes me do it is unemployment. It keeps my mind off of bills and the need to find a software gig. The above email is already sent to the professor. I'm fully aware that there was a more diplomatic way of approaching the matter, but experience tells me that nothing I could've said would've changed anything. Instead I'm opting for a direct and forceful approach in the hopes I shock them out of ignorance of what they're doing to their students. I don't expect them to change the project requirements, but I hope this makes the professor realize how much their students are struggling and perhaps start explaining the language before slapping code on the projector. Thanks for the advice and note of agreement.
- joshwprinceton 18y agoI hope so too, goodluck!
- jibiki 18y agoI have had classes where I stumbled through with cargo cult code. (Basically, I had a choice between thoroughly learning ML in a week or just winging it.) The experience was thoroughly unpleasant. While your email was extremely rude, your point is very important, and I hope you are able to convince the professor. He may believe that by giving students a strict outline for how they are supposed to write code, he is making it easy for them. More likely, he wants their code to be easier to grade. In the latter case, of course, he should just write a program to automatically evaluate their code, which would save everybody lots of time. (I think most of my CS teachers did this, although they also scanned code for comments and such.)