Blog Closed

This blog has moved to Github. This page will not be updated and is not open for comments. Please go to the new site for updated content.

Thursday, February 7, 2008

Programming Lab

I'm teaching an embedded systems lab this semester, to senior and junior EE students. The lab covers C programming on embedded i386 hardware, and Verilog design on small FPGA boards. Programming is what I do. It's what I like to do, and it's something that I feel I've grown pretty good at over time. In the department I'm pretty well known as the "programming guy", and most people would think that I would relish the chance to teach what I love to my students. In reality, this course is shaping up to be the most depressing I've ever taught.

It's depressing to me to see how little my students know about computer programming, what their attitudes are towards it, and how poorly they perform on even simple tasks. Here's some background about our program. The EE department is broken down into two specialties: the "regular" EEs who have a smattering of programming background (1 low-level introduction to C "for non-majors", 1 class on microprocessors with some x86 assembly, and 1 class in digital logic with some verilog) and students taking the "computer option" who have it slightly better (The same classes as the "regular" group, and two additional classes in Java). Some students have also taken a course in MATLAB programming, although it's optional.

It's my experience that the "computer option" students do better when it comes to problem-solving, because they have experience in data structures and algorithms, and they've also taken classes that were devoted to programming. I also know that the CS department, which hosts the java courses, does a good job of instilling proper code formatting and some basic best practices. However, as has been said in other forums before, java programmers lack any kind of knowledge about basic constructs like pointers, strings ("what's null-terminated mean?"), binary operators & | and ^ ("Doesn't ^ mean exponent?"), basic console I/O, etc. I can always tell a java programmer in my class when they have well-formatted code, but a very convoluted algorithm that goes out of it's way to avoid low-level constructs. One student wrote:

printf("%c", &myChar);

He didn't know what the problem was. I asked him why he used the ampersand in front of "myChar", to which he replied "I don't know, don't you do that kind of stuff in C?". Yes, occasionally we do "that kind of stuff", but we don't do it everywhere.

The alternative are the "regular" EEs, who have only a basic introduction to C and x86 assembly, and write code that looks terrible, is filled with "goto" statements, and never use subroutines or loops. It's like they are programming in assembly, in C. These students have a slightly better conceptual understanding of pointers, but still can't use them properly in their code. "How do I pass an array to a function?", I was asked. "By reference", I replied automatically. "What does that mean?".

In a class of 14 students, I would guess that only two or three have any understanding of the fact that C code is converted into machine code, or that C code can be translated--by hand if needed--into equivalent assembly-language code. One student asked if he could just write the assignment in Java; I told him that he could if he could find the VM on our little embedded computer. He didn't know what a VM was.

It's depressing to me because many of these students are going to put "C Programming" on their resumes, and next time I apply for a job i'm going to get an email back saying "Sorry kid, the last engineer we hired from your school was dismally incompetent, we're not even going to give you an interview". Of course, nobody would ever send an email like that out, most people never send back a reply at all.

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.