views:

574

answers:

12

I am asking here from the perspective of a C programmer using mostly Unix. Is it still worth it to do system programming in C?

+6  A: 

Well, there are some research projects and experiments in using higher-level programming languages for systems development as well as even new languages for that task. But as far as the current reality is concerned, I don't think C is dead.

However, for many tasks (and I'm seeing many application programming in the UNIX world being done in C, too–which I consider dead-wrong) C is probably more a legacy than a feature nowadays. It's tradition and most people adhering to that tradition don't look around very much even though there may be suitable HLLs for the task.

Joey
Can you explain *why* application in programming in C is "dead wrong"?
mcl
I didn't say that. I just consider it that way. Imho one should stick to low-level languages only for low-level tasks as productivity is way too low and error rate is way too high for anything sufficiently complex. That alone should be a sign that one is using the wrong tool for a job.
Joey
+5  A: 

No, it's not dead. Yes, it's worth it. There is still progress to be made:

  • Better (faster, more stable) drivers
  • Smarter file systems
  • Better schedulers
  • ...

First of all, hardware changes and its new capabilities need to be exploited. But aside from that, it is also not the case the we theoretically proven that e.g. the optimal process scheduler has been created. The same holds for nearly all other software too. So there is still plenty of work to be done.

Stephan202
Yeah, but all these can be achieved with C++ as well ...
hyperboreean
@hyperboreean, you wouldn't say that if you know the difference between C and C++
Matt Joiner
You _can_ achieve these things in C++ _if_ you know the performance costs of all features of C++ _and_ restrict yourself to a strict subset of those features. Which is basically going to be C with templates (`std::sort` is faster than `qsort()` in most implementations because it doesn't have to call a comparison function repeatedly) and references (they're really low overhead, and it's a pattern you'll be doing a lot anyway with pointers). So if you want efficiency, you will end up writing in C (or assembly) regardless of what language you actually use.
Chris Lutz
+3  A: 

Embedded systems is a huge market for systems programming in C. Huge.

Nali4Freedom
A: 

If performance is important, then yes. Unfortunately, there is not yet an adequate substitute.

comingstorm
A: 

yes it is. Seriously though, large exisiting codebase, compiler availability for exotic platforms, etc. etc. etc. c is still very much "in use" and will be for the forseeable future.

jilles de wit
+1  A: 

C is definitely not dead.

Looking at Tiobe Programming community index, C is the 2 more popular language, right behind java.

Aurélien Bottazzini
Obligatory comment about the inaccuracy of the TIOBE index and questionable metrics they employ.
Chris Lutz
+8  A: 

The development in higher-level languages of systems has only just begun on modern desktop PC's. Don't forget about microchips, embedded processors, hand helds, etc... Some of those haven't even moved on to C++ yet.

Any language that forces garbage collection on it's user is, in my opinion, doomed to never be a systems language. And that's okay, they weren't made for that. I think a language like D would be an optimal system programming languages, being an elegant mix of of the low-level stuff in C, and only the good high-level stuff in C++. It has optional garbage collection, which can do all sorts of wondrous things. Sadly, it's dead, because of C/C++. See the point?

GMan
+1 for bringing up D, but I don't agree with, "Sadly, it's dead, because of C/C++". D hasn't had its day yet. It's deliberately kept ticking over as a niche for the moment while D2 is fully developed - but I am confident that it will become more important in the next year or two (and yes, I did say that last year too :-) )
Phil Nash
There will always be some things that are better or easier to do in a low-level, closer to the hardware, type of programming language. C is the best example of that category right now.
mpez0
+1  A: 

There are some really wild system programming things going on right now - just ask Google, who've in recent times developed at least three new operating systems, coded largely in C and C++.

EDIT: ES-OS was originally developed by Nintendo, but Google's in charge of it now.

Dathan
+1  A: 

I'm working on a project now which is a rewrite of an existing .Net application in pure C++ (although with a C++/CLI layer for .Net UI clients).

Outside of the embedded world, which has already been mentioned, there is a lot of use for it in HPC/ Grid computing - especially in the banks (which is where I'm using it right now).

Phil Nash
+1  A: 

Application programming aims to produce software which provides services to the user, whereas Systems programming aims to produce software which provides services to the computer hardware.

Now, look how many devices you have at home. Many of them have already Operating System inside; all of them require some interface with hardware.

Even many modern LED displays have some OS inside, and a lot of functionality (like channels management in case of TV-set, Picture in Picture (PiP), Digital Signal Processing to filter noise in sound/video, etc.) is done in system level using C programs! It is De-Facto standard to use C in system programming.

The World goes Embedded. System programming worth!

psihodelia
**YOW**! I'm highlighting **RANDOM PHRASES** in **BOLD TEXT** for apparent **EMPHASIS**!
Schwern
A: 

C is not going to be dead for another 25 years. Nothing is futureproof, but C is............

zed
A: 

The big challenge these days is how to take the most power from multi core CPUs and from GPUs. System programming in C is a great choice for achieving this.

mouviciel