C comes up regularly, and usually the general consensus is that all programmers should know C. I think it would be interesting to see if programmers take this to heart and learn C.
It seems like this could be either the second or third option, depending on how well you still know it. Perhaps the second if you still know it well and the third if you've gotten really rusty in it.
I can add the option if this doesn't make sense in your case.
The problem is that it you are attempting to measure two different things with the same question: depth of knowledge and frequency of usage. It's possible that someone knows C quite well, but no longer (or never) uses it.
It's similar to offering 3 options for Marital Status: Single, Married or Divorced. It's impossible to interpret the results in any meaningful way (Divorced and single? Divorced and remarried? Is it important that I've ever been divorced? Or do you just want to know if I'm currently married or not?). It's better to separate these questions.
I was more trying to provide a 1-5 type scale with some guidelines on how to vote. The sentences in the options should be ORed together more so than ANDed.
What if I added a phrase to option two: "Or I learned C extensively at one point, remember most of it, but don't use it regularly anymore" and to option three: "Or I learned C extensively at one point, but have forgotten most of it and don't use it anymore?"
Sorry, I should have added that it seems obvious the emphasis is on depth of knowledge and the frequency of usage parts are merely there as helpful tips. I personally hate modifying a survey once it's been deployed and suggest you leave it as is.
It seems to me that it DOES pretty trivially give you polymorphism; just change the function pointers in a struct and it behaves differently, while retaining the same type! Inheritance can be implemented, too, by copying function pointers and other struct contents around.
If you play with languages that use prototype-based OO like Lua and JavaScript, you can see pretty clearly how to implement such things. Implementing your own OO system in Lua is an experience I'd recommend for anyone who uses OO; it's easy, and you'll almost certainly learn something you can apply elsewhere.
That's probably a really big one in terms of reliability.
Also, the weird C++ behavior of calling copy constructors in the most unexpected places can have a very detrimental effect on performance.
Personally, I think the nature of C++ class definition leads people down the primrose path of trying to provide all potentially useful methods, of which only a tiny fraction get used. Tons of dead code appears in most C++ projects.
Faster compilation, more flexibility, less dependencies in code base (you don't have to define struct fields in headers), no problems with incompatible ABI, interface that can be directly called from almost any other programing language...
If you're a C purist (or just a purist in general) then of course you're right, but I personally think that C-with-classes is clearer, easier for a layman to understand (many people who call themselves C programmers still get nervous when function pointers come out to play), and is usually worth the trade-offs. You can write a lot of very decent code this way and have a little bit of "the best of both worlds", and avoid getting into a lot of the admittedly very dark corners and nasty surprises that C++ has to offer...
A lot of my time in C was spent on memory management - when I switched to Perl it all went away. (I had some libraries I'd written to take care of it by then, of course, but in Perl I just didn't have to worry about cleaning up at all!) Oh - and strings! (But that's also a memory management question.) And regexp.
CPAN grew on me later - roughly as CPAN was growing. It was garbage collection that was my deciding factor.
As a first reaction I thought, well, more than 50% of HNers fluent with C, the average age should be pretty high probably. But then I realized that actually the average HN age is probably around 25 (from other pools I saw here), so I guess, there are still a lot of fresh programmers learning C. I really hope so. I love higher level programming languages and spent a lot of time with Tcl, Scheme, FORTH, Joy, Ruby, and other languages, but I really hope that the next generations of programmers will still be able to stay near the metal when needed.
Well, it seems the old stigma against multi-language systems is fading. Even 5 years ago, it was more or less "the rule" that you chose one language for a project and you had to live with whatever trade-offs that choice left you with. Now, people are more willing to accept that you can write much of your system in a language designed for programmer convenience and only write the bottlenecks in a more performance-oriented language.
This is true, but if you use C for the right use cases it is possible that actually higher level programming languages will not be a less time expensive pick, as if the use case is right you'll end spending a lot of time into optimizing performances, OS low level access, memory usage, ...
Web applications which rich client-side interfaces might be the reason for the change in thinking. In a web application, you anyway have JavaScript to deal with; and until a few years ago, the server-side code was written in some other language.
I'm 30, and from Googling you seem to be 3 years older than me, but I don't think the use case for learning C has changed all that much over the course of my time as a programmer.
Already around '95 or so Perl was widely used, GUIs could be done in things like Tcl/Tk, basic apps were starting to move onto the web, desktop stuff was mostly in C++.
You learned C when you wanted to work on things like kernels or databases or high-performance daemons and whatnot. That's still mostly the case. Java has eaten into that a little bit, but that's not even a new phenomenon.
The things that people used C for 15 years ago are still the same things that it's used for today, and similarly, you didn't have to write stuff in C 15 years ago if you just wanted to bang out some little utility or "CGI script". I expect things to stay that way until there's some language which could reasonably replace C in its niche. Thusfar one has not emerged.
Very good point, I'm 34, and actually probably the average HNers is on average ten years younger than me, but well, it is pretty shocking that what you said is so true. No big shift in the latest 10/15 years, there were already good alternatives for all the higher level stuff. Thanks for opening my eyes about that!
I don't know if you remember, but in 1995, Serious Software was still Not Written in "Scripting Languages". Things like SATAN and HotJava were avant-garde exceptions, and Emacs Lisp was a holdover from another era (and we often used vi instead because it was noticeably faster).
Today, I regularly use an email client written mostly in JS, message boards written entirely in Python, a chat client written in Python, a high-performance file transfer program written in Python, a music player written in C#, system monitoring tools (iotop, htop, dstat) written in Python, a version-control system written in Python, and so on. In 1995, I used an email client written in C, a newsreader written in C talking to a netnews server written in C (although early netnews servers had been partly written in sh, they were rewritten in C for performance), an IRC client written in C, file-transfer programs written in C, music players implemented in hardware, "top" written in C, version-control systems written in C (although, again, the first version of CVS was a shell script), and so on.
I don't think it's true that "basic apps were starting to move onto the web" in 1995. Web sites that were really programs with HTML user interfaces didn't really start to take off until around 1997, by my recollection. I joined eBay's AuctionWeb in 1996, but it was quite unusual (and it was promptly rewritten in, I assume, C++, as eBayISAPI.dll).
GUIs could be done in Tk, or for that matter PowerBuilder or Visual Basic, but that was thought to be "for amateurs". It became technically possible to do this kind of stuff in high-level languages then, but it took a few years for people to notice that.
Tcl was driving oil extractions plants in 1995... just an example, also there were bit perl programs in production, so for sure now the acceptance is higher but was not impossible to have sensible code written in scripting languages back then.
It wasn't impossible in 1985, either, when GNU Emacs came out; but the now-common AlternateSoftAndHardLayers approach won Emacs a reputation for being a slow memory hog.
My point, though, is that much of C's 1995 or 1996 niche is now occupied by "scripting languages", and in 1995 or 1996, that niche was occupied by C.
Nit-picking time: there's probably a difference between the average age of a HNer and the average age of an HNer that knows C. Conditional probabilities and all that.
That being said, I'm an "average age" HNer that has worked with (and loved working with) C. I'm looking for excuses to work with it more, although it doesn't really intersect with my type of work (statistics).
Maybe I should contribute to Redis or other OSS...any suggestions?
I think that CLIPS (a tool for building expert systems) needs an update, including a shift to a more Redis-like interface and philosophy. The core of CLIPS is still pretty nice, but the project seems to have grown well beyond its natural borders.
Most people are not learning that anymore. I see most universities moving those courses to choice instead of mandatory courses. When I talk to 'young programmers' it always scares me that most don't even know how a computer works at a low level. Which is reflected by the weird things they try to do with Java etc.
I'm 25 and consider myself very well-versed in C (though I still have to consult the C99 spec from time to time). When I was learning to program modern computers around the turn of the century, it was the only "serious" language for writing desktop apps (I had recently "graduated" from VB4). I then refined my skills over the course of my electrical & computer engineering degree and a short stint in the EE industry, where it's very much alive as THE language for microcontrollers (and last I heard, a variant called SystemC was (sadly) replacing Verilog and VHDL for use in ASIC/FPGA design).
FPGA designer here. I don't think it's accurate to claim that SystemC is replacing VHDL and Verilog for ASIC/FPGA design. I view SystemC as a niche tool to allow software engineers to dabble in hardware design. I use C for embedded software, but would never dream of designing hardware in anything else except pure HDL. It's a bit like trying to write a letter in a foreign language using Google Translate-- the results are non-optimal and often comical.
While trying to learn HDL I felt like Verliog was more naturaly than VHDL. I didn't bother trying to learn SystemC or anything, organizing a project on Quartus or ISE is hard enough as it is with Verilog.
I need to go back to dabbling with my little Spartan3E board though.
SystemC was about (co)simulation - for building models of hardware. ALthough there were some tools for converting SystemC into HDLs, I don't think they ever really took off.
I learned C in college classes, but never really learned it until after a "WTF PHP" moment, so I could dig into the interpreter source to figure out what was going on. Later experience with Python's interpreter and debugging pyrex reinforced my knowledge.
I mention this just to say why I think "modern" very-high-level language hackers still end up learning C; the base layer is all written in it, and eventually you've either got to fix something or write something fast.
I find it more than a little disturbing that the first time you really used C was to figure out the PHP interpreter. It's among the worst C code I've ever seen (aside from code I've seen on dailywtf). After I had to debug something in the PHP interpreter, I refused to have anything to do with PHP ever again.
Anyway I hope for your sake looking at the Python interpreter did more than reinforce your knowledge. It's no stroke of genius, but it's much better written than PHP.
My advisor (I'm a senior in college now) does pretty much everything in C. I've written a compiler, large parts of a couple distributed systems, and various Linux kernel hacks. C certainly isn't my favorite language, but I like it a lot. Well-written C is pretty beautiful in its own way.
I'm 29. I started programming C when I was 12 or 13 and I really think that C is probably the best language to learn to program with. In fact I made that recommendation to a friend who recently took his first programming class using Processing and he thought I was crazy. I think it's important to understand memory management, pointers, pointer arithmetic and such.
I'm 23, self-taught (though not asking for pats on the back), and fairly proficient in QBASIC (hahaha), Haskell, Python, JS, Prolog, and I am learning Scheme and Erlang, but there's something mythical about programming in C, and I try to read C (linux kernel, etc) regularly.
I use C/C++ and assembly everyday as a game programmer. It is the incumbent development language for consoles (at least xbox and ps3 - I'm never done any dev on the Wii). I suppose its stay is due to the ease of access to the metal.
It's propably worth noting that lots of games use higher level scripting languages to do speed-insensetive tasks.
C is the language I use when I just want to sit down and enjoy "resonating with the computer". Python, Java etc feel like I am "working", or "cheating" as the case may be in Python. With C you are conscious of the memory of the computer and the lovely datastructures you are forming on top of it and the whole elaborate dance. I hear that Lisp programmers get a similar feeling but I am not close to seeing that yet.
During college days i have used lots of C for different projects but its been few years i haven't touched C, I think i have forgotten pointer and stuffs need to review
I know C but none of those categories apply to me. Poll design is useful skill to learn!
I am not a pollster but by combining different facts into single options you are restricting the information you can gain from your poll or polls.
I taught C to engineering students at a university, I know it thoroughly, I haven't written a line of it in 12 years - the only option I can logically choose is the final option.
As per other comment thread, my intention wasn't to combine facts, more so to provide guidelines. If one of the statements doesn't apply but the overall "feel" of the option is right, I think you can go with that, since after all, the stated purpose of the poll is to see how well HN users know C. For your purposes, I might pick the first option, as it says C is either your main or best-known language. Best-known could be a reasonable statement in your case.
Agreed. Polls like this one don't work well for orthogonal ranges, and here there are at least two: how well you know C (from knowing nothing to being a master) and how often you use it (never [anymore, if you happen to know it well] to it being your primary language.
A third range might be how much you like C, regardless of how good you are at it or how often you use it.
Unfortunately not that much since academia and a few other bits and pieces, 30 here, still do a lot with C++ and ObjC though rather than higher level languages
That's why C is used in embedded systems. A trick that I like is to write some critical code in C, compile with the -s switch, then optimize the assembler code and in-line it.
I've learned some C, but I wouldn't be able to write a program in it without a lot of documentation. I can read it, but I don't use it or use it once or twice a year.
Not sure if that's a good thing. I wouldn't say the same for a comment on another site (different things drive different people), but I assume you have some aspirations to make it and be your own boss.
Yes, logically, "Not sure it's a good thing," means "It is either a good thing or it is not a good thing." You know, X or not X, and so your ass-covering comment is logically defensible, but come on, you wrote it for a reason. Just say, "Good point," and move on.
"Not sure" in this context was meant demonstrate I'm open to both variants of the situation, good and bad. Since OP had upvotes already indicating that people find it good/funny/whatever, the point was to bring other side of this to light. There's a saying that fits your comment so well - don't tell me what to do and I won't tell you where to go.
Are we turning into an anti-dissent crowd? Look at the downvotes - the same number, and why? Because somebody had a different opinion? Because it's so easy to downvote here and not let out your identity or have to explain why you did it?
Tolerance of, nay, encouragement of dissent (not insubstantiated rants) is the hallmark of a healthy community.
Btw, if you choose to downvote this, please explain why and what I am missing. Thank you.
It's interesting for me to watch the downvotes, but I'm not really concerned about it. I won't delete these comments as I stand by them, all this upvote/downvote business to me looks like yet another MMORPG I have no interest in.
He's manager doesn't get to program all day though :P As long as it's a company in which compensation isn't determined arbitrarily by position in hierarchy it's a great thing.
As someone who has been a "contractor who ignores all the political bullshit", my personal observation is that it is the contractors who are actually good at navigating the political bullshit (win friends and influence people and all that jazz) tend to be the ones who get top dollar and have continuous employment. Whereas the contractors who are merely extraordinarily good at programming tend to have a lot of downtime in between short engagements.
Some people think that if you have social skills you can't be a 'real' hacker, but often sales skills and good presentation are a force multiplier for a contractor with good technical skills.
Sure, no doubt. You'll never hear me speak against having sales skills or any other kind of skill. I'm for having as many skills as possible. There are no "mutually exclusive" skills, so people who think gaining sales skill causes hacker skill to magically disappear are wrong. And there are those -- also wrong -- who think having programming skill automatically means you can't be good at communication.
Reminds me of some C-code I was told to port to Linux (if I remember correctly) some years back (probably in 2003). The code was from 1981 (it said so in the comment header).
Except for the fact the code was almost as old as I am (born in 1976) it turned out that the security check that the code was supposed to perform didn't actually execute.
Yepp, that's right, the code had been running for 30+ years doing nothing.
A friend of mine ended up doing the actual work so I don't know how the story ended but it's a good reminder to never assume _anything_ when you look for bugs.
This reminds me of an interesting event that occurred in my C++ class. During one of the assignments I looked at a peers code. I became convinced that the code was wrong. His code looked a little like this:
Another student saw the teacher pass him and copied his implementation. His code didn't work. It gave the stack overflow error that I was expecting.
It turned out that the reason the guy had his code work in the first place was because it was never included in the program. He had put the code in his C++ file, but forgot to include it in his header. When the program compiled, it never knew his code existed.
I was teaching one of my good friend C way back in undergrad(1999). After explaining him about loops among other stuff...i asked him to print something in loop. And this is what he wrote
For(i=1 to 10)
{then print i;
}
Today my friend is working as a techie ....senior mgr at his new company!
Ok kadbid, I am intrigued. what's the story? Why didn't you make the transition to other languages? Why didn't you make the transition into management? I'm not questioning your decisions, just curious.
For many or most programmers, the "transition into management" is a major career change from something they love and are good at to something they don't enjoy and aren't very good at. However, we're all assumed to be following that track because we're supposed to hunger after money and prestige in the eyes of society at large. This morning I interviewed a woman for a technical position (same job as me) who got her master's degree when I was in third grade. What's wrong with that?
Who says I only know C? I've been learning and using new languages for over 30 years; I won't bore you with a list. (Smalltalk is one of my favorites, but I'll never ship a product in it. But I know a lot about dynamic language implementation).
C just happens to be the right choice for most of my projects today (I half seriously proposed FORTH for one before my cow-orkers threatened me with a dunking).
Let's make a distinction between Management as an HR function (writing reviews, dealing with org issues, fighting for equipment and office supplies) and Senior Geek Nirvana (design work, heavy lifting in code and debugging / shipping a product). I tried Management for a while, and it stunk.
Right now I'm in a great position as a senior technical guy (I hesitate to say "Architect" because most of the people I know with that title are self-appointed blowhards) who gets to decide how to do stuff. I lean on managers ("we need some chairs, and an oscilloscope") and project management (for setting up meetings, tracking bugs, etc.), and I get to write a ton of docs and code. It's terrific fun.
I'm living proof that you can be writing in C and not be a sour, dried-up dinosaur in the back corner of a lab somewhere.
I think it's actually funny that the question, whether we know C. A few years the question would have been if people know assembler. That's how times change.
C is the only language that I use at work (along some basic scripting). Due to work that is mainly firmware, device drivers etc. Honestly at times, I do feel that embedded engineers are odd persons out here at HN.
My lecturer in my basic introduction to C class once said to me that he had been a professional C programmer for the past 10 years, and still considered himself a C novice.
I think how "knowing C" is defined is key in this question, yes I can write my fair share of C, but I still don't think I could class myself as a C programmer.
I've known some C for long enough, but only recently dived really deep into it, it was Apple and Objective-C that brought back my interest in the language. Writing some forensics and data restore tools as a project to learn the language, progress is slow, but I'm loving it.
One thing I've noticed is how focused you have to be when working with C vs for example python/php - everything is very error prone mostly due to manual memory management. You also need good visualization and some basic math skills.
I'm from the "Modern C++" school. I learned C++ without first learning C. I don't consider myself a C programmer. Of course, I can read and write C code, but I would consider it a burden to code without smart pointers, templates and exceptions. How should I answer this poll?
I come from a similar background and chose the third from the top. I can read it, but writing would require more education, also known as, documentation.
I said I would consider it a burden to write in pure C, not that I would not be able to do it. I would not need any documentation, but I would scratch my head figuring out how to organize a large program. I would need to write a lot of comments to replace things that do not exist in the language: const-correctness, memory management conventions, type-safe containers, etc.
Const correctness has existed in C since 1999. Again, knowing C++, and even being able to constrain yourself to some C-like subset of it, is not the same as knowing C.
"How to organize a large program" is a large part of what learning to program in a language means.
BTW, const correctness is in C99, and memory management is usually done by writing constructors and destructors like C++ (except that they're real functions, often named stuff like <prefix>_init and _destroy or <prefix>_new and _free) and calling them manually. It's not as elegant as RAII, but if you write short functions with clear logic, you can usually ensure you cover all code paths. Remember that you don't have exceptions to screw up control flow in C.
For type-safe containers, I just use void* containers with a comment indicating the intended type, but perhaps more experienced C programmers have a better system. Remember that Java didn't have type-safe containers until Java5, and honestly ClassCastException was a fairly rare error.
Precisely! It always is a red flag when new graduates have "proficient in C/C++ " in their resumes. I've found that these people tend to write code in a combination dialect of C and C++ that I call C+.
There was old adage that people who say they code in "C/C++" don't really know either one. This was about a decade ago, I can't recall where I saw it, and don't know if it still a widely held view.
Au contraire, a modern C++ developer probably knows nothing about C. Good C is like good assembly language: dense and performance-obsessed. No objects, no exceptions, no STL, bare bones and riddled with pointer manipulation and macros.
Well, function pointers exist in C, though they are certainly a clumsy replacement for having methods (or first-class functions / closures / currying) built into the language.
Naive C++ programmers tend to use pointers as if they were references. They do not seem to understand pointer arithmetic, pointers to functions, etc. They also do not seem to have a deep understanding of memory models, and tend not to understand memory alignment. They do not use bit-wise operators much, though it's more of a cultural thing than skills issue.
I have never met a competent C++ programmer that does not have at least some exposure to C as well. But I'd dare to guess, that such character would not understand the C preprocessor in any but the most trivial level.
[edit]
I originally used the phrase "C with classes" crowd, in a rather derogatory way, to describe the people who never get to learn any of the languages well, and end up writing some sort of sanitized, structured-programming, algol derivative in (a subset of) C++ syntax.
While reading the rest of the comments, I remembered that "C, with classes" can also apply to C hackers that just use C++ to structure their C-styled code, and may take advantage of a few features of the language. I have edited the comment to clarify what I meant.
> I have made the experience that a good C++ developer also automatically knows everything about C.
Not even close in my experience. In college, we used C++ in our intro course. The addition of pass by reference, classes (with constructors and destructors), and the standard library (e.g. std:string) hides a lot of the common paradigms of C, and that's not even mentioning boost.
In my experience, people coming from C++ tend to write really bad C. Many of them have a poor understanding of the concept of pointers.
Once you get familiar with some good C design patterns, it's pretty easy to write clear, modular C. Knowing C++ is not a very effective measure of ability to use C.
207 comments
[ 3.3 ms ] story [ 231 ms ] threadI can add the option if this doesn't make sense in your case.
It's similar to offering 3 options for Marital Status: Single, Married or Divorced. It's impossible to interpret the results in any meaningful way (Divorced and single? Divorced and remarried? Is it important that I've ever been divorced? Or do you just want to know if I'm currently married or not?). It's better to separate these questions.
What if I added a phrase to option two: "Or I learned C extensively at one point, remember most of it, but don't use it regularly anymore" and to option three: "Or I learned C extensively at one point, but have forgotten most of it and don't use it anymore?"
If you play with languages that use prototype-based OO like Lua and JavaScript, you can see pretty clearly how to implement such things. Implementing your own OO system in Lua is an experience I'd recommend for anyone who uses OO; it's easy, and you'll almost certainly learn something you can apply elsewhere.
That's probably a really big one in terms of reliability.
Also, the weird C++ behavior of calling copy constructors in the most unexpected places can have a very detrimental effect on performance.
Personally, I think the nature of C++ class definition leads people down the primrose path of trying to provide all potentially useful methods, of which only a tiny fraction get used. Tons of dead code appears in most C++ projects.
Also, you may be giving up a lot of niceties in your IDE that way.
Plus, if there's some feature of C++ I do like, I can bring it in.
Ug, now it sounds like PHP.
<3 Python
(Edited the first line a bit)
Rogerian LISP?
CPAN grew on me later - roughly as CPAN was growing. It was garbage collection that was my deciding factor.
Already around '95 or so Perl was widely used, GUIs could be done in things like Tcl/Tk, basic apps were starting to move onto the web, desktop stuff was mostly in C++.
You learned C when you wanted to work on things like kernels or databases or high-performance daemons and whatnot. That's still mostly the case. Java has eaten into that a little bit, but that's not even a new phenomenon.
The things that people used C for 15 years ago are still the same things that it's used for today, and similarly, you didn't have to write stuff in C 15 years ago if you just wanted to bang out some little utility or "CGI script". I expect things to stay that way until there's some language which could reasonably replace C in its niche. Thusfar one has not emerged.
Today, I regularly use an email client written mostly in JS, message boards written entirely in Python, a chat client written in Python, a high-performance file transfer program written in Python, a music player written in C#, system monitoring tools (iotop, htop, dstat) written in Python, a version-control system written in Python, and so on. In 1995, I used an email client written in C, a newsreader written in C talking to a netnews server written in C (although early netnews servers had been partly written in sh, they were rewritten in C for performance), an IRC client written in C, file-transfer programs written in C, music players implemented in hardware, "top" written in C, version-control systems written in C (although, again, the first version of CVS was a shell script), and so on.
I don't think it's true that "basic apps were starting to move onto the web" in 1995. Web sites that were really programs with HTML user interfaces didn't really start to take off until around 1997, by my recollection. I joined eBay's AuctionWeb in 1996, but it was quite unusual (and it was promptly rewritten in, I assume, C++, as eBayISAPI.dll).
GUIs could be done in Tk, or for that matter PowerBuilder or Visual Basic, but that was thought to be "for amateurs". It became technically possible to do this kind of stuff in high-level languages then, but it took a few years for people to notice that.
My point, though, is that much of C's 1995 or 1996 niche is now occupied by "scripting languages", and in 1995 or 1996, that niche was occupied by C.
That being said, I'm an "average age" HNer that has worked with (and loved working with) C. I'm looking for excuses to work with it more, although it doesn't really intersect with my type of work (statistics).
Maybe I should contribute to Redis or other OSS...any suggestions?
http://clipsrules.sourceforge.net/
The core of R is written in C, I think. Might be worth a look?
https://svn.r-project.org/R/trunk/src/main/
I need to go back to dabbling with my little Spartan3E board though.
I mention this just to say why I think "modern" very-high-level language hackers still end up learning C; the base layer is all written in it, and eventually you've either got to fix something or write something fast.
(I'm 28)
Anyway I hope for your sake looking at the Python interpreter did more than reinforce your knowledge. It's no stroke of genius, but it's much better written than PHP.
I already hated the interpreter before I dug into it, and my expectations were reinforced. I was a college intern, I didn't choose PHP!
When writing C, I have to spend time thinking about the syntax and memory management.
Although I have spent much less time using Python, when writing Python I am only thinking about the problem domain and algorithms.
I am not a pollster but by combining different facts into single options you are restricting the information you can gain from your poll or polls.
I taught C to engineering students at a university, I know it thoroughly, I haven't written a line of it in 12 years - the only option I can logically choose is the final option.
A third range might be how much you like C, regardless of how good you are at it or how often you use it.
but i know objective-c pretty well.
Tolerance of, nay, encouragement of dissent (not insubstantiated rants) is the hallmark of a healthy community.
Btw, if you choose to downvote this, please explain why and what I am missing. Thank you.
Some people think that if you have social skills you can't be a 'real' hacker, but often sales skills and good presentation are a force multiplier for a contractor with good technical skills.
Except for the fact the code was almost as old as I am (born in 1976) it turned out that the security check that the code was supposed to perform didn't actually execute.
Yepp, that's right, the code had been running for 30+ years doing nothing.
A friend of mine ended up doing the actual work so I don't know how the story ended but it's a good reminder to never assume _anything_ when you look for bugs.
Another student saw the teacher pass him and copied his implementation. His code didn't work. It gave the stack overflow error that I was expecting.
It turned out that the reason the guy had his code work in the first place was because it was never included in the program. He had put the code in his C++ file, but forgot to include it in his header. When the program compiled, it never knew his code existed.
For(i=1 to 10) {then print i; } Today my friend is working as a techie ....senior mgr at his new company!
C just happens to be the right choice for most of my projects today (I half seriously proposed FORTH for one before my cow-orkers threatened me with a dunking).
Let's make a distinction between Management as an HR function (writing reviews, dealing with org issues, fighting for equipment and office supplies) and Senior Geek Nirvana (design work, heavy lifting in code and debugging / shipping a product). I tried Management for a while, and it stunk.
Right now I'm in a great position as a senior technical guy (I hesitate to say "Architect" because most of the people I know with that title are self-appointed blowhards) who gets to decide how to do stuff. I lean on managers ("we need some chairs, and an oscilloscope") and project management (for setting up meetings, tracking bugs, etc.), and I get to write a ton of docs and code. It's terrific fun.
I'm living proof that you can be writing in C and not be a sour, dried-up dinosaur in the back corner of a lab somewhere.
I think how "knowing C" is defined is key in this question, yes I can write my fair share of C, but I still don't think I could class myself as a C programmer.
One thing I've noticed is how focused you have to be when working with C vs for example python/php - everything is very error prone mostly due to manual memory management. You also need good visualization and some basic math skills.
That said, answer #3 or #4 makes sense.
BTW, const correctness is in C99, and memory management is usually done by writing constructors and destructors like C++ (except that they're real functions, often named stuff like <prefix>_init and _destroy or <prefix>_new and _free) and calling them manually. It's not as elegant as RAII, but if you write short functions with clear logic, you can usually ensure you cover all code paths. Remember that you don't have exceptions to screw up control flow in C.
For type-safe containers, I just use void* containers with a comment indicating the intended type, but perhaps more experienced C programmers have a better system. Remember that Java didn't have type-safe containers until Java5, and honestly ClassCastException was a fairly rare error.
I have made the experience that a good C++ developer also automatically knows everything about C.
I have never met a competent C++ programmer that does not have at least some exposure to C as well. But I'd dare to guess, that such character would not understand the C preprocessor in any but the most trivial level.
[edit] I originally used the phrase "C with classes" crowd, in a rather derogatory way, to describe the people who never get to learn any of the languages well, and end up writing some sort of sanitized, structured-programming, algol derivative in (a subset of) C++ syntax.
While reading the rest of the comments, I remembered that "C, with classes" can also apply to C hackers that just use C++ to structure their C-styled code, and may take advantage of a few features of the language. I have edited the comment to clarify what I meant.
Not even close in my experience. In college, we used C++ in our intro course. The addition of pass by reference, classes (with constructors and destructors), and the standard library (e.g. std:string) hides a lot of the common paradigms of C, and that's not even mentioning boost.
In my experience, people coming from C++ tend to write really bad C. Many of them have a poor understanding of the concept of pointers.
Once you get familiar with some good C design patterns, it's pretty easy to write clear, modular C. Knowing C++ is not a very effective measure of ability to use C.