5 ms·
Excuse my apparent ignorance, but people are still programming in C? Why? On which fields? Is there something C can do better than Java or C#?
by Aedan 15y ago
Excuse my apparent ignorance, but people are still programming in C?
Why? On which fields? Is there something C can do better than Java or C#?
- tosseraccount 15y agoYou're favorite virtual machine and OS are probably written in C (or some dialect thereof).
- ajb 15y agoJava and C# have 'managed' runtimes; it the language manages memory for you. This memory management bit cannot itself be written in the 'managed' language. Also, an operating system can't either[1]. Also, systems with hard real time requirements, such as audio/video, the signal processing code in your phone, wifi router, etc, are incompatible with almost all managed runtimes. [1] Okay, I know there are academic ones that are. As far as I know, no productions systems are.
- pjmlp 15y agoFunny, because there are research compilers that do exactly that.
- jgw 15y agoLinux, UNIX variants, all their drivers, tons of embedded software & firmware in tiny devices like wireless chipsets, all the way up to the "real" IOS that runs Cisco switches. It's a good option for low-level work.
- w0utert 15y agoEmbedded, low power, real-time, drivers, high performance computing, low-level kernel, legacy, and so on... The alternatives you give are not really the best examples either. C# is only a viable development platform for serious/professional work if you're targeting Windows, and if there is one language that doesn't do anything better than the many alternatives that compare favorably to it, it would be Java.
- ncarlson 15y agoMost cross-platform libraries are written in C. Consider the multitude of C libraries that are available in Python or Ruby.
- sophacles 15y agoOff the top of my head, big important projects written in C, which are still actively developed: * Linux * GNU * Apache * Ruby * Python * nginx * mysql * posgresql * Redis * VMWare * OpenSSL * Almost everything "embedded" Because C allows extreme control and performance. Anecdotally, a lot of people write in higher level languages, then rewrite critical bits in C for that speed boost. In many cases they just start at C if they know it requires certain levels of performance, for instance code on massive super computers or super low latency communications packages.
- st3fan 15y ago'GNU' is not a project. At least not like the others in your list.
- Turing_Machine 15y agoSophacles probably meant http://www.gnu.org/software/software.html#allgnupkgs http://www.gnu.org/software/software.html#allgnupkgs Looks projecty to me. :-)
- sophacles 15y agoNor is one about embedded systems. The core GNU tools are written in C and actively maintained, and are commonly referred to as the "GNU project". I'm not sure why you are pointing this out.
- octopus 15y agoAs a side note a lot of codes ported to C for running on HPC clusters will end up re-implemented in Fortran (I'm talking about Fortran 95/2003/2008 ... ).
- Aedan 15y agoI'm aware of almost all of that, but my point wasn't about things already written in C, I'm talking about why keep writing in C. Extreme control and performance are unique traits of C? Being a relic of the past, it lacks greats thing modern languages take for default (like, I don't now, memory management, for example). That's where my point was heading. Can't new languages in the multicore age address this issue in a more elegant, modern and less "protocolary" way?
- stephencanon 15y ago> Is there something C can do better than Java or C#? I write systems code in C and Assembly for a living. I couldn't possibly do my job using Java or C#. In fact, as an experienced C programmer, I honestly can't imagine choosing to use C# or Java to do anything -- I'd rather be writing either in C or in something "higher level".
- kev009 15y agoBoth of these actually strike some good balances for the vast majority of "business programming" -- be it desktop apps, web apps, or mobile. C# is actually getting pretty high level (DSL stuff like LINQ). Java, not as fast but Scala goes way beyond that. Python, Ruby, Perl, PHP.. these are overused (except for solo work, prototypes, toys, glue) and in my experience fall down in teams.. but dynamic typing now seems completely asinine to me after slinging Scala for the past handful of months.
- cageface 15y agoI think dynamic typing is a transitional technology. Designing a strong but sufficiently flexible type system is very difficult, so while we've waiting for the FP community to do the hard design work, we're more productive in Python or Ruby than in Java.
- super_mario 15y agoCompilers and interpreters for almost all other languages are written mostly in C or C++. Most of OS kernels, APIs, shells, command line utilities, my favorite editor etc are all written in C. Not a day goes by that I don't download C code, make and install it on my system. So, I think C will remain one of the most popular languages around.
- signa11 15y agolot's of code running on almost all networking gear is 'C'. examples would be ios (csco), junos (jnpr) etc. etc. starent-networks (acquired by csco) which is a pretty significant player in mobile-wireless is also 99% 'C' based.
- derleth 15y ago> 'C' Why the quotes?
- BrandonM 15y agoMost languages' canonical implementations are written in C, including Java, Python, and Ruby.