Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

Many moons ago I cut C code for a living, primarily while maintaining a POP3 server that supported a wide range of OSs (Linux, *BSD, HPUX, VMS ...).

I'm planning to polish the rust off my C skills and learn a bit about language implementation by coding a simple FORTH in C.

But I'm wondering how (or whether?) have things changed in the C world since 2000. When I think C, I think ...

  1. comp.lang.c
  2. ANSI C wherever possible (but C89 as C99 isn't that widely supported)
  3. gcc -Wall -ansi -pedantic in lieu of static analysis tools
  4. Emacs
  5. Ctags
  6. Autoconf + make (and see point 2 for VMS, HP-UX etc. goodness)

Can anyone who's been writing in C for the past eleven years let me know what (if anything ;-) ) has changed over the years?

(In other news, holy crap, I've been doing this for more than a decade).

share

locked by World Engineer Jul 29 '13 at 12:43

This question exists because it has historical significance, but it is not considered a good, on-topic question for this site, so please do not use it as evidence that you can ask similar questions here. This question and its answers are frozen and cannot be changed. More info: help center.

closed as too broad by MichaelT, BЈовић, gnat, GlenH7, World Engineer Jul 29 '13 at 12:42

There are either too many possible answers, or good answers would be too long for this format. Please add details to narrow the answer set or to isolate an issue that can be answered in a few paragraphs.If this question can be reworded to fit the rules in the help center, please edit the question.

    
I've also asked on comp.lang.c: groups.google.com/group/comp.lang.c/browse_thread/thread/… –  Duncan Bayne May 26 '11 at 3:59
3  
Well, there is vi instead of emacs, but I won't go there. I would be surprised if anyone still posts to comp.lang.c, and even the obfuscated C contest is stagnant (www0.us.ioccc.org/main.html). Sad times -- the next new contest is for obfuscated strings of letters that spell out some text-message phrase, lol. –  Jay Elston May 26 '11 at 4:32

6 Answers 6

up vote 10 down vote accepted

It's really hard for me to think back in time like "Wow, what was C programming like 10 years ago?", but I can talk about some things that I know I'm doing differently.

  • While you can usually still summon someone like Peter Seebach on comp.lang.c for help on a particularly goofy bug that you suspect might be language related, most if not all C programming questions get exceptional answers on Stack Overflow.

  • Static analysis is still kind of painful. Splint (at least as far as I know) doesn't deal with C99 so well, coverage graphs are still a bit of a pain to visualize. GCC warnings have "improved" quite a bit (in quotes because that depends on who you ask).

  • Valgrind is the saint of all memory error checkers and usually points you to problems in your code that no static analysis tool would / could find. It's not 100% perfect, but I don't think it could be. I very seldom have to touch GDB these days, which (nothing personal) is just fine with me. The Valgrind massif tool is a really nice heap profiler as well.

  • There's always new extensions in GCC, some of them subtle, so -pedantic is a good idea if portability is a big concern. For the novice / rusty programmer, it's sometimes easy to confuse extensions with 'hidden' language features.

  • CCAN has emerged (think CPAN, but for C) and is starting to take off. There's a lot of useful gems there, including an adaptation of TAP which is an awesome testing tool. Strings in C still suck, but the number and quality of libraries to help deal with them has surely gone up in the last ten years.

  • SCons and CMake are increasing in popularity for build configuration. Autoconf / Automake / Libtool are still widely used, but many people feel a bit too limited by M4. Still, if that's the system you like to use, the Autoconf macro archive is still alive and well.

  • There are obviously more editors available today. I've yet to find an "IDE" that didn't get in my way when working with C, but that's probably because I'm an old, crotchety, Sanka drinking evangelist for simplicity.

Overall, though, I wouldn't say life (as far as C goes) is even close to profoundly different than it was 10 years ago. But, in many ways, it's actually a bit easier. It's hard to attribute that to tools over experience though.

share

2) and 3) have changed. C99 is mainstream, C90 is turning more and more obsolete. gcc -Wall -std=c99 -pedantic.

Apart from that, the two most noteworthy changes not already addressed in other answers are:

  • C11. ISO 9899:2011.
  • MISRA-C:2004.
share

I think C99 support is better than you suspect. Visual Studio doesn't support it, but every other compiler I can think of supports it (with, perhaps a few omissions here and there). If you don't need compatibility with VS, then I'd say go with C99, as it's much more pleasant to write than C89 IMHO.

share
  1. StackOverflow ;)
  2. I use C mainly for writing firmware for Microchip's microcontrollers, and since their compiler is GCC based I use C99 (but I don't go nuts with the extra features, mainly it's to restrict scope of loop variables and dynamic arrays on the stack). When I write Python extensions, I stick to C89 in case someone needs to compile it with MSVC. I don't know what everyone else uses.
  3. Splint (works on C89, not C99), and Clang's static analyser — although, since both of them choke on the macro-heavy firmware code, I don't have a massive amount of experience with them. Actually, much of LLVM's stuff is pretty interesting to a C geek.
  4. Okay, this is just holy war bait :P
  5. Never used Ctags, but I'm partial to Doxygen.
  6. God I hate Autoconf. I hate it so much. I have never, ever managed to craft an Autoconf ball-of-mud from scratch. If a project already had one, I'd just end up bastardising whatever's already there. If I'm writing something new, I rant and rave and look for alternatives, although I'm damned if I've found one I'd stick with. Last time I went through this cycle, I settled on SCons, which I might use again.
share
1  
I would also suggest Cppcheck for static analysis. –  Greg Hewgill May 26 '11 at 9:54
10  
regarding point number 6: "I saw a book the other day called 'Die Gnu Autotools', I was thinking 'Heck Yeah!' until I realized the title was in German". –  Cercerilla May 26 '11 at 17:48

glib might be the "new standard library". It offers much of what many feel is left out of the standard -- platform-independent threading and networking, container data structures, etc. Of course, it's not applicable everywhere, but if you can use it, it saves a lot of time.

share
    
I think you're confused with the GNU C Library (GLibC) –  Lekensteyn May 26 '11 at 7:29
7  
No, i am not confused. –  zvrba May 26 '11 at 7:38
1  
This is a perfectly valid answer, I'm not sure why it was voted down. glib was born out of many being frustrated with Ulrich Drepper and how 'guarded' glibc is. –  Tim Post May 26 '11 at 11:21
1  
Glib is completely decoupled from GNOME now, though. I'm not arguing about the association, just that in practical terms you can completely ignore GNOME and even GTK+. There are (plenty of?) command line and non-interactive programs written in it. –  detly May 26 '11 at 13:39
3  
I like to call glib "The STL of C" –  Cercerilla May 26 '11 at 14:28

C programming language made it to the top 2 or 3 programming languages on Dr Dobb's journal in its most recent study/survey.

As for implementing a language, C is used to implement a new language that is being built at Google, called Go (golang.org).

I haven't followed C's usenet group in recent years. I visit its Freenode IRC channel often. It is active and frequented by many.

New programs are being written in C, but they don't get the publicity like they would have got if this year were to be, say, 1999.

These are something that come to the top of the mind. There could be many more, but I hope you remained in touch with your programmer hat, though you might not have frequented the C model of the hat :)

share

Not the answer you're looking for? Browse other questions tagged or ask your own question.