Ask HN: Do CS students enjoy C anymore?

72 points by davidu ↗ HN
We hire C developers at OpenDNS. Most often, we hire them from some other company where they have been working for the better part of a decade.

They are computer scientists and they are very smart.

But we also like to hire students graduating from college. It's rare for us to find a CS graduate who knows C, let alone one who enjoys writing in C.

Apparently most CS is taught in Java and Python these days, with one or two courses in algorithms or operating systems. There seems to be only a few classes where C is involved.

Is this because teachers don't like teaching in C? Or because students prefer the speed of development of a language like Python or Java? Where are the students who do like C? Where can I find those guys (and girls)?

100 comments

[ 4.4 ms ] story [ 134 ms ] thread
I enjoy it and I graduated less than a year ago, though I am an EE, not CS grad. Perhaps look at the CE/EE crowd a bit more in depth. Where I went to school (large Big-10 engineering program), we were required at least one C course, with more as electives.
It's been a long time since it had a large role in CS curricula outside of operating systems / embedded stuff, I think. The intro classes when I was a freshman (2000) were transitioning to Java, but from Pascal, not C. The industry-focused classes (software engineering, etc.) all used C++.

I think I would personally have disliked C if college were my first introduction to it, because I associated it with curmudgeonly systems professors and a sort of harder-core-than-thou attitude. But for some odd reason I had already learned C in high school (I think I picked it randomly), and it's a perfectly enjoyable language to use, without the cultural baggage. You can even write things other than schedulers in it!

I carry around my copy of K&R like it's my bible. Learning C really opened up programming in general for me. I love it. Here at school though, we're never required to write pure C code. We learn C++ (as it's own class! Yuck.) and use it for data structures, but other than that it's not required anywhere either. It's all Java and Python, and most people here can't be bothered to learn a new language. I've probably got more to learn about C before I'm at the level of the people you hire, but if you think you might be hiring in May, I'll be graduating soon! ;)
I am a CS student in my last semester and in my operating systems class we have been required to do all of our assignments in C, we also are targeting minix. This has really given me a love for C and made me much more comfortable with programming in any language. C skills are a must!
There are some people that enjoy being tied up and whipped too, and those who wear "hair-shirts" to show that they are noble for all their suffering.

More than enjoying C as a language, you should find people who can identify when it is, or is not, the correct tool for the job. If you hire people solely because they enjoy C, you may find that "when all you have is a hammer, everything looks like a nail".

Putting my money where my mouth is, I have written more C++ in the last month than during the previous decade, because I am doing a lot of node.js work. I am writing code in C++ that speeds up or makes possible the things I want to do in Node. Nothing more.

Some Universities require more classes in C than others. You could go to the course listings of Universities you might like to recruit from and go after graduates from those programs.

With one decent CS school that I am aware of, the University of Maryland used to require (until last semester or so) all CS graduates to take two lower level classes which are taught in C (with some asm). Now it is just one course. I don't know whether or not students enjoyed it, though I think it is unfortunate that they are dropping one of the two courses (actually combining both into one course.)

I think part of why there is this move away from C is some students (rightfully) complain that they may never need to explicitly use it, and Universities figure they can teach the concepts with other languages. I believe that lower level languages should be taught, but I understand why not everyone agrees with me.

I just had an submission hit the front page the other day where I explained how moving from PHP/Apache to C saved my bacon. I'm 26 and have not been out of school that long.

I would look for schools who start their students in C or even C++ right off the bat. I know some people who took intro to programming in Java and would never learn C now, not sure why.

I've written a bunch of PHP, Perl, SQL stuff, but always down-shift into C or C++ (mostly C though) when performance or command-line tools need to be efficient. I wrote a multi-threadded crawler in C because using perl or shell scripts wrapped with xargs is not very efficient. I love working with C mainly because I grew up writing C code and I find it very convenient. I have a favorite debugger. I love using linked lists. I think that constructing a complex in-memory data structure to make a program run efficiently is an art form. Also, I believe that using BerkeleyDB is also a much better option for a database from a programming aspect. BerkeleyDB (like C) has been around for ever, it's fast, it has low-overhead, and it does things just as good as any other key/value database (if not better because it's so mature). Using older, more proven technologies is slowly becoming my overall programming philosophy. I'm not a new graduate, but I still feel that these methodologies are much better in many circumstances than the newer tools that are all the rage when performance and reliability are an issue. Sometimes, I even re-code regexps using pcre in C to make them fast if they're a bottleneck so I can squeeze some more performance out of my code. When I'm prototyping something, I still revert back to perl or php though - they're great for quick and dirty tasks still.
The Software Engineering program at the University of Waterloo (where I did my undergrad and am currently doing my masters). One of their first-term courses (CS 137) is in C. They used to have Java, but apparently the powers that be decided C was a better language to get started with. Although for your real question - where to find a graduate who enjoys writing in C - I don't have a general answer. I know that personally I enjoy writing clean C more than most languages.
At my college every CS student is expected to pick C up on his own time. I knew how to program in C long before I entered college -- however, I really dislike non-GC environments in general.
Come to Virginia Tech. Our entire linux/unix user's group is C crazy, we have a resume CD, and most of us are pretty intelligent people.
When I was a CS undergrad at VT (1998-2000) all CS classes were taught in C++.
Go Hokies! I was there same time.

Anyway to echo a bunch of others' comments, EE and CompE's like C. It's great for embedded work. If you find one of us who prefer programming to building stuff, you will be very happy with our understanding of C. On top of which we tend to like to write efficient code (i.e. fast and/or low memory footprint) because we are used to having K's of memory rather than M's or G's.

Yeah I'm at VT as well and a member of VTLUUG. My last technical interview was primarily done in C.
Students who've taken systems programming classes (e.g. Operating Systems) would be your best bet -- in my experience, most low-level programming is shafted to those classes, except in the cases where a professor arbitrarily requires C, which doesn't necessarily happen in algorithms classes either.

But even better would be to find students who hack on open-source projects written in C (e.g. Linux-related efforts) -- that's much more representative of a graduating student's ability to be productive using C. There are a lot of students working on such projects, and it might be worth starting there.

Many universities now offer a course using the Computer Systems: A Programmer's Perspective book (http://csapp.cs.cmu.edu/index.html). This is a fantastic book, focusing on nit-picky assembly and C-level work -- all the foundational stuff for an operating systems or compilers class, even if you never go on to one. Having TA'd this class the last few years, I find most students really enjoy it.

In fact, I think most of the HN crowd would greatly enjoy the "bomb lab" (http://csapp.cs.cmu.edu/public/1e/labs.html -- you can read the writeup but not get the source). The idea is that you have a binary and have to use gdb and some nice dumping tools to "defuse" a bunch of stages of the program, each with increasing difficulty. It's a fabulous exercise, and really makes students pick up a deep appreciation for stepping through assembly and data structures that are just lying around in memory.

I used that book 5 years ago (2nd year system course). I love it (except the part where it teaches some weird language called HL or something...)

I love the bomb lab exercise! LOVE LOVE LOVE LOVE!

At my university, we split the book into two courses if I'm not mistaken. We moved away from a typical OS book (Albert S., Andy T., Stalling, type of book) to this.

There are side effects though. The MOS, OS Concept, OS Concepts + Internals book have a typical path of teaching OS while this book merged the OS and hardware knowledge.

I really believe that hacking is a good way to get students excited about systems programming and working at the systems level. I also noticed a stack smashing lab. Good stuff.
Definitely, it's more like a game for me.
IDA Pro seems to make the bomb lab considerably easier (e.g., by showing the basic block structure of the assembly); I imagine that the Hex-Rays decompiler would be even more so. Students willing to torrent that software would probably have a much easier time with the lab...
I had never heard of IDA Pro before, so I just took a cursory look. I don't think it provides significantly more information than objdump does, which we explicitly tell the students to use.
All the information is in the binary, sure, but IDA makes the process a lot less tedious.

objdump doesn't give you the pretty "graph view," showing the basic block structure of the code. (In particular, this is really nice for switches and other jump tables.) It doesn't make it trivially easy to see where certain rather important-looking strings are referenced in the code. It doesn't show strings that are being referenced right next to the assembly instruction that references them, like changing

    push   0x8049808
to

    push offset aD        ; "%d"
It doesn't let you mark up

    mov eax, [ebp-0x4]
to

    mov eax, [ebp-first_number_I_entered]
and have that renaming automatically propagated through the entire function, so that you can easily track accesses to the same variable.

In addition, the Hex-Rays decompiler (http://www.hex-rays.com/decompiler.shtml) produces C-like output. I don't have a license for it, but I imagine it would make short work of the bomb lab.

The Hex-Rays decompiler would probably make short work of the bomb lab, but I don't think IDA Pro would make much of a difference.

For disassembling a large program, sure, but the program and the functions themselves are relatively small. They already know the basic structure of the bomb because we give them a C skeleton that calls all of the functions. The string pointer fetching would probably be the most useful, but once they figure out how to do it once, they only need to do it four or so more times.

I'm also a TA for this class at my university, and I think it is excellent. In fact, I think many of our grad students would benefit from taking it - the course emphasizes understanding the whole system stack in ways that other courses (such as a classic OS course) do not.

The bomb and buffer overflow labs are probably the most interesting to the HN community, but the shell project is what I consider the most important project in the course. (We have five projects: bomb, buffer overflow, shell, memory allocator, web server.) Our shell assignment is quite a bit different from the original in that we parse the command line for them (putting the commands and pipelines into appropriate data structures), but they have to do everything else, including pipes and I/O redirection.

Email me if anyone is interested in learning more about how we do our course.

The labs for that course look awesome. Seems like a great way to tie together OS and computer architecture material.
I just did the bomb lab. I had a blast (pun intended). We're using that textbook, and I've learned tons this semester. The buffer overflow lab was also a ton of fun. This class takes the cake for the most difficult and fun homework assignments I've ever had.
At Northwestern this course is called "Introduction to Computer Systems." To this day it is the best class I've taken at Northwestern. I guess I'm glad the professor decided to take the course with him when he left CMU.
I'm guessing that the speed, convenience and ease of abstraction that a higher-level language like C++ or Java offers is a pull-factor for CS instructors. Apart from systems-level programming classes, of course.

Someone mentioned "Why C when higher-level languages will suffice?" and I thought that's pretty much spot on. In a data structures class, it seems easier not to have to debug cryptic core dumps and segmentation faults too often, especially since the focus is on algorithms. At least, that's the impression I got when speaking with TAs and professors.

Or perhaps there are less systems-level programming enthusiasts nowadays?

I took the class you TA'd, way back when the textbook was still a draft and absolutely loved it! As an EE guy, it was great to be able to get at the bits and bytes and really understand what it meant to be fetching, executing, branching to, jumping to instructions, allocating memory etc. The transition from assembly language to C was natural and I loved/hated every single core dump / segmentation fault that came with it. That class helped tremendously in getting me my first job, but I guess there are plenty of jobs that don't require working knowledge of C.

Georgia Tech still teaches a 2nd year course on C:

CS 2110 - Computer Organiz&Program An introduction to basic computer hardware, machine language, assembly language, and C programming.

4.000 Credit Hours 3.000 Lecture hours 3.000 Lab hours

Course Attributes: Tech Elect CS, Engr, &Sciences

My university uses Java as the main teaching language. A few courses down the line (OS, Security) tend to use C, but it does certainly depend on the instructor. It seems to me that instructors shy away from C when they know students will likely have little experience with it. They don't want to be bothered with teaching students what a pointer is because it will take away from the actual material of the course.

That said, I personally enjoy using C when it seems to be appropriate. I would much rather write a piece of OS code in C and drop it into a linux distro than using Java to do something that would rarely be used in the real world. I've had problems with C that I wouldn't in a language like python, but if the task is better suited for C, I'd rather work through those problems and learn because of it. My personal opinion of students not learning C because it's hard is that they don't belong in a CS program. If you won't take the time to learn the best tool for the job, you won't do the job right, and no one will have benefitted because of it.

These days C is a hard language to learn. The best way to learn a new language is to start a small project in it.

C isn't really appropriate for most small projects.

It's becoming less common just like programmers who love assembly language are becoming less common.

The entire history of CS could be summed up as a move towards higher and higher levels of abstraction. They still expose you to assembly language in good CS programs as sort of a history lesson or to give you a deeper understanding of how it works underneath, but that doesn't mean people actually want to use it.

C is of course nowhere near as far along that path as assembly language, but it's a spectrum and seems to moving in that direction.

As a Junior in CSC right now, and while I have to say the speed of development in languages like Python and Ruby really appeals to me, I do enjoy C development as well. Unfortunately I usually have to optimize for development time rather than anything else, so outside of a few classes (for example, Algorithms, were execution time was a competition), I end up picking the "highest"-level language. But I think most schools are avoiding C, outside of specific classes (whose goal is to teach C or something C related), because students get caught up in the complexity of C, and the difficulty of debugging it vs. a memory managed language, so they'd rather just avoid it and focus the class on the topic it's supposed to cover.

On the other hand, I know a few people who want to solely work in C because it allows them so much control over how things work, and they're capable of understanding how each and every call they make will basically function. You typically have to look pretty hard for these people specifically, but I find the ones I know are some of the best programmers around. If you're curious about getting in touch with some (I know at least two that I would /highly/ recommend, are looking for summer internships), ping me at mdwrigh2@ncsu.edu

Engineering courses give a basic overview of writing in C, but that's about it at my school. I haven't taken those courses since I'm not an engineering major, but I helped my friends with the material.

Most of my programming courses are taught in Java. I've brought it up to the faculty though about moving us away from being a Java school. The issue that they presented was that the teachers may not be as familiar with C/C++ as they are with Java. My reasoning behind all of it being that Java is not a good learning language since it adds too much abstraction to get a good idea for what your code is actually doing (i.e. memory).

It doesn't particularly matter though as students who are interested in programming will learn what they want on the side.

For your situation though, I'd avoid people who classify themselves as being a 'Java/Python/C programmer'. There are too many languages and too many problems to limit yourself to merely one or two languages. A good programmer will be familiar with at least a few languages and be able to pick up a new language/framework quickly. Basically it breaks down to simply finding someone who has an interest in programming.

Also, I like C.

You could hire Computer Engineering instead of Computer Science majors, they usually all know C well even if they practiced it in relation to hardware\embedded systems.

[at UIUC everyone does C++ Data Structures, but CS starts with Java, CE starts with C ]

Ditto.

CompE graduate here, my C education was almost exclusive to microcontrollers. The only other class that focused on C was the operating systems class. Both were fairly low-level in their respective areas.

Did anyone ever enjoy writing C, especially data structures?

Here is what I remember from college:

./program

Segmentation fault.

I actually had the option of using a few languages for my Data Structures/Algorithms class, and chose C. Granted, execution time was a competition and I'm a relatively competitive person by nature, so that influenced, but it really wasn't all that painful, and in fact direct control of pointers made some of the data structures easier to manage, in my opinion. Plus being on top of the rankings for efficiency is always nice :)
I had fun dealing with input management using the standard library only. Without any directions on how it worked or what to use.
This is something I've forgot in the years I've spent working since University. There is a certain joy in hacking on data structures / input management and finding the exact patterns that will handle all of the error cases you've thought of.

Anyone have any suggestions for priming myself to work on a problem without directions and finding a solution as you go along (exploratory programming)? The closest I've come lately is exploring the node.js API and working out a basic web server with auth, cookies, and some MVC structure.

I found most of my segfault bugs by a simple "gdb program". It's scary at first, but it's usually not that hard.
GDB. God's gift to programmers
(comment deleted)
the Old Testament God, to be exact.
GDB is great, but valgrind is even quicker at diagnosing segfaults.
I took a (mandatory) class on C as part of my degree ten years ago. Your description matches what I saw around the lab. They dropped C the following year.

I think the reason for this is that coding in C involves knowing a lot about the insides of a computer (eg. what memory even means, how it is addressed, why allocating a string isn't trivial at the machine level and thus requiring pointers in C, indirection, etc). In other words, there are many prerequisites coming from various other classes.

Another example of the sort of thing I mean, although it doesn't directly apply to C: it's hard to understand space and time complexity (ie. big O) without understanding the complexity of basic steps that requires knowledge of the types of things a CPU can do (eg. that memory is effectively a vector, changing a location in memory is O(1) but inserting data into a vector is far more expensive).

IMHO, there simply isn't time for classes to cover all these prerequisites thoroughly (ie. to a level needed for practical coding in C) before a C class can commence. With something like Java or Python you can ignore the complexities until you have had time to learn them. With C you can't.

Thus, it isn't sensible to teach C in college. At least not as a mandatory thing for a CS graduate. And the moment it isn't mandatory the hard classes will get dropped (I took harder classes because I found them interesting, but that lowered my average compared to what I might have achieved otherwise).

C is one of the few languages in which data structures are really fun and challenging. Even C++ has STL where everything is ready for you...
Try looking for Electronic Engineering grads. I may be a few years out of date, but it certainly used to be the case in my experience that they get more C level coding than those from the CS world.
EEs are taught C with Matlab as a distant second
"CS" is broad; targeting specialties within the program may work better. I used tons of C for operating systems and networking lab courses, but I had friends focusing on (for instance) HCI or AI who rarely touched it.

Also consider looking at physics and aero-astro majors. Lots of embedded or algorithmic work, so I hypothesize lower level languages like C are more common.

Long-time lurker, this is my first post to HN.

My school(Tennessee Technological University, graduated a year and a half ago) still requires a semester of C/C++...there were a couple other classes where you needed to know it to interpret the professor's example code, but were allowed to code in other languages if you wanted. I enjoy C, but feel more proficient in other languages as far as getting things done quickly. I guess I just don't use C enough to keep a good grasp of it.

I think students would get more benefit out of being forced to only use C(and assembly?) for the first couple years. It would help them get a better understanding of what the higher-level languages have going on under the hood.

I've been doing web development(Ruby) the past few years. I've played around with extending Ruby with C, but not much.

If you are looking to hire, I might be interested...its about time for a change-up in my life.

As a teaching language, I did enjoy C. I didn't know C when I was studying CS, and until then I used higher level languages that did all sorts of inexplicable things. C was the one layer above assembly that made sense, and helped highlight when something was really a hardware issue versus an algorithmic issue. (eg. limitations of mmap and fseek in relation to database performance)

For production, I wish I had the time or need to optimize code I write, but too often, a server upgrade and reconfiguration is sufficient. At least I depend on some one else writing something great in C (linux, nginx, etc).

Been looking at GoLang and Clang to make the experience a little less painful.