Ask HN: Do CS students enjoy C anymore?
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 ] threadI 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!
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.
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 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.
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.
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.
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 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.
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
to It doesn't let you mark up to 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.
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.
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.
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.
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
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.
C isn't really appropriate for most small projects.
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.
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
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.
[at UIUC everyone does C++ Data Structures, but CS starts with Java, CE starts with C ]
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.
Here is what I remember from college:
./program
Segmentation fault.
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 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).
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.
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.
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.