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.

Back in the uni days, I had the opportunity to study C for one semester but I didn't take it any further because I can not see many job opportunities for C hence I learnt Java. These days I see more things are made with C, mainly programming language and database server. Is it still relevant to learn C? Will learning C land me a job these days?

share|improve this question

closed as primarily opinion-based by gnat, MichaelT, thorsten müller, Robert Harvey, Kilian Foth Jan 13 at 15:53

Many good questions generate some degree of opinion based on expert experience, but answers to this question will tend to be almost entirely based on opinions, rather than facts, references, or specific expertise.If this question can be reworded to fit the rules in the help center, please edit the question.

14  
I've taken the opposite route. I learn the programming languages i am interested in. Related jobs always have managed to find me. –  LennyProgrammers Jan 21 '11 at 9:28
2  
Of course it is! It's the best way to have all kinds of flaws in your application. From buffer overflows to kernel corruption. The language even encourages the practice(!!) If you plan to do more damage, there's C++. It's even more relevant. –  Christian Jan 21 '11 at 13:09
1  
This question gets asked every week. Is the search broken? –  Henry Jan 22 '11 at 7:08
show 6 more comments

17 Answers 17

up vote 52 down vote accepted

C is still very relevant - embedded system, high-end games, graphic engines, kernels, blah blah blah.

That's not just the point though: while I can foresee some good substitute for Java in the future (this is being generous, mind you: right now I can name at least one language that does the job better in any given field; moreover, I guess that its use being still so widespread today is a consequence of a whole generation of programmers learning on it), I find it hard to imagine C could ever be abandoned.

Also, if you're looking for some elite (non-code-monkey) job in the future, your potential employer will be favorably impressed by your knowledge of C even if the language used for your position is another. Being able to code in C means:

  • knowing how a computer actually works;
  • being either a gifted programmer or a very determinate person for not giving up when it came to the use of pointers for something != learning what pointers theoretically are;
  • having developed an eye for optimization.

Anyone could hack together a java program via an extensive usage of poorly understood libs - given a basic understanding of OOP and some knowledge of the syntax. It isn't so easy in C.

share|improve this answer
7  
You can "know" C and still write bad code. Many of the typical optimization are not really C related, C simply provides a good mechanism to implement them. For example, if you have an array of structs, why is array indexing performance increased if you force the size of the structure to be a power of 2? Why is v = pA->pB->pC; slower than doing something like this: pD = pA->pB; v = pD->pC; when you are accessing members of pB frequently. I would argue that knowing C does not imply that you understand anything that you listed in your bullets. –  Pemdas Jan 21 '11 at 15:52
3  
+1 for mentioning embedded systems. I work for a home appliance manufacturing company and we use C exclusively in our end products. While the rest of the company, and most other companies, were downsizing during 2009-2010, my department was actively recruiting additional developers with C and embedded design experience. –  oosterwal Jan 21 '11 at 19:04
6  
And you forgot to mention that C being the lingua franca of programming means that many languages (C++, Python, Haskell to name few) have facilities to link against C libraries directly, which allow to offload heavy tasks to an optimized code. –  Matthieu M. Jan 21 '11 at 19:15
show 1 more comment

C programmers understand how computers work. Java programmers understand how Java works. (NOte that this is not a value statement, its just true).

This is why Operating systems, compilers, Java etc are written in C. And why Insurance apps are written in Java.

If you want to be a taxi driver, learn to drive an automatic sedan, good people skills and how to deal with traffic.

If you want to be a car engineer learn how cars work.

Both are valid careers, but they are different skill sets

share|improve this answer
1  
I'm a Java programmer. However, I learned C first, and don't consider myself limited to Java because of that. I feel that C has made me a better Java programmer. Not so sure about the other way around. Java makes it easier for me to concentrate on the problem at hand, mainly because I don't need to worry about pointers, libraries, linking, porting, etc. And for business today, a language that lets you do that is worth its weight in gold. Taxi driving might be a moonlight. –  Michael K Jan 21 '11 at 16:01
2  
Mostly C programmers struggle to understand how computers work in my experience –  David Heffernan Jan 22 '11 at 0:13
1  
C programmers may understand how the C abstract machine works, but not even that can be taken for granted (because then there wouldn't be that much code out there that triggers undefined behavior). It's still far from how computers work, though. Granted, Java abstracts even further, but in any case, any abstraction over the bare metal takes you further from how exactly computers work. –  Joey Jan 22 '11 at 15:08
show 1 more comment

Based on statistics that shows the Programming Language Popularity reports

The C programming language is relevant. Now and always

Check it here : http://langpop.com/

Note copied from that link: These results are not scientific. They are interesting nonetheless, and are an attempt to glean as much data as possible notwithstanding the fact that gathering precise data is impossible. We hope you find them interesting as well. Constructive suggestions on improving them are welcome. Contact information is provided at the bottom of the page.

Update1: More info about programming usage available on TIOBE Programming Community Index for January 2011 http://www.tiobe.com/index.php/content/paperinfo/tpci/index.html

Update2: C is relevant also, because most of modern language share C syntax ;) . So if C is widely used and most language share C syntax ? ;)

share|improve this answer
show 6 more comments

Yes C is still relevant. You can't compare it with Java like you did.

They are not usually used to build the same type of applications.

So you must ask yourself what type of applications you want to develop to determine if C is relevant to you.

share|improve this answer
add comment

C is to developers what Latin and Ancient Greek are to linguists.

Even if you dont program in it, its very important to at least be familiar with it. Virtually every piece of software written has a connection to C. With very few exceptions, all modern software runs on an OS written in C, and likely needs to interface with libraries and other applications written in C. Many of the interpreters for higher level langauges (such as PHP) are written in C. And decades worth of sample code out there on the net and in books is written in C. Even if you dont code at the OS level or write servers, you certainly will encounter C code at some point that you need to understand.

So yes, it is relevant now to developers, and will be relevant for all our lifetimes, if not all our children's lifetime's too.

share|improve this answer
add comment

C suit for developing OSs, System level programming, Embedded Systems(including various types of micro-controllers PIC, ARM, and micro-processors), RTOS, Compilers, website programming using CGI (as a "gateway" for information between the Web application, the server, and the browser), libraries to other languages (such as GNU Multi-Precision Library, the GNU Scientific Library, Mathematica and MATLAB are completely or partially written in C) and most of the memory managed applications.

Target platforms for C programs range from 8-bit micro-controllers to supercomputers.


This is my answer to a similar question here!

share|improve this answer
add comment

There's tremendous value to learning C and even assembly language even if you never write a line of production code in these languages in your life. When writing code in a high-level language you will inevitably run into situations where it pays to have a mental model of how computers work at a relatively low level. Similarly, it helps (though not as much) to have at least a rough mental model of how CPUs actually work below the level of assembly language (caching, pipelining, etc.).

Hypothetical examples of usefulness:

  • Your java program is running out of memory even though you're not actively using much. If garbage collection is magic to you, good luck. If you understand that references are really pointers, that a garbage collector works by tracing, and what the stack, heap and static data segment are, you will realize very quickly that you're probably holding on to references to unneeded data.

  • Understanding why adding final to a Java class can sometimes make your code faster (because functions can be made non-virtual), and equally importantly, why this is negligible about 99% of the time (because vtable lookups cost next to nothing unless the function would otherwise be inlined and is called very frequently).

  • You can sometimes get significant insight into why seemingly arbitrary language rules exist. For example, in C++, default arguments to virtual functions are decided based on the compile-time type, not the runtime type. This seems ridiculous until you realize that the alternative would be nearly impossible to implement at the assembly language level.

On the other hand, I would say that once you've learned enough C to have such a mental model, you've learned enough of it. There's no need to learn the standard library, ecosystem, etc. very well.

share|improve this answer
add comment

C is still incredibly relevant, especially in embedded systems, highly performant systems and things like algorithm engines for video/graphic manipulation. However, unless you're looking to enter those sorts of fields, then it's probably true that you won't run across it much.

share|improve this answer
1  
I think C is important if you need to interact directly with hardware often. –  Programming Enthusiast Jan 21 '11 at 9:32
add comment

C is a basic language of programmers and mostly a programmer's hypothetical knowledge refers to C knowledge.

share|improve this answer
3  
I have no idea what this means. –  Pemdas Jan 21 '11 at 15:04
show 2 more comments

In addition to the software that should be written in something like C, there's a tremendous amount of existing C software in interesting fields. This means that there's a lot of new stuff being written in C, because it goes well with the existing software.

If you're working in any technical or mobile field, there's a good chance you're going to deal with C code. If you're working with non-mainstream processors, you will almost certainly have to deal with C.

In addition, C will give you something of a feel for how the computer really works, since all C operations are easily translatable into machine code, and there's no heavy runtime support.

It's generally a good language to know. Whether you want to take the time and effort to learn it depends on what you want to do.

share|improve this answer
add comment

I find odd that you don't mention C++. But if you compare Java to C or C++, I'd say that you are missing the most important language that allows you to do memory management, unlike most languages.

Then: yes. C is one among the few languages that allows you to do memory management, and you should learn it. And since you have a knowledge in java, you could also learn C++, which is more "standard" to me than java.

share|improve this answer
show 3 more comments

C is relevant just as lisp, smalltalk and ML are.

Almost all languages in use today have borrowed from those root languages. Its really difficult to think of a commonly used language that doesn't borrow from one of those four.

share|improve this answer
add comment

There's over 30 years' worth of legacy code to support, so it's relevant in that respect.

As far as new development goes, it really depends on the field. For server-side, single-threaded, non-graphical applications it's still one of the better tools available, but be aware of the following limitations:

  • C provides no built-in support for graphics, sound, networking, file management (beyond creating, renaming, or deleting individual files), etc., which must all be managed using third-party tools (although it looks like the next version of the language standard will include a built-in threading library, woo-hoo);

  • C provides no garbage collection or other automatic methods for managing dynamically-allocated memory;

  • C provides no built-in container types (lists, queues, stacks, etc.), so you have to roll your own, which is complicated by the fact that...;

  • C provides no built-in generic or metaprogramming capability like C++.

I wouldn't develop a graphical desktop client in C, for example; it's just not worth the time and effort when you have other languages that are far better suited to the task.

C was designed to be small, easy to develop compilers for, and to allow experienced programmers to do things that aren't necessarily safe but result in fast code. It wasn't designed to be a teaching language, and some behaviors seem non-intuitive at first (i=j++ is well-defined, but i=i++ is not).

Contrary to popular opinion, C doesn't necessarily get you that much closer to the hardware than any other 3GL (indeed, the language standard is written in such a way to be as independent of any underlying hardware considerations as possible); apart from naked pointers (which don't necessarily correspond to physical memory addresses) and bitwise operators, there's not much to distinguish C from, say, Fortran or Pascal. I think some people get this idea because of how C treats arrays and pointers, but that's a conceptual memory model, not necessarily physical reality.

share|improve this answer
add comment

There are plenty of good answers here demonstrating that C is a marketable skill. I agree, I'm just not sure that marketability is the only or best argument for a language's relevance in the big picture sense.

Every language I've learned has helped me better understand language design. Every different language I've worked in (even on trivial "just to mess with a new language" projects) has deepened my understanding of different approaches to programming. This is valuable. I'd find it relevant to learn C regardless of its marketability, not only because it is a very good example of certain language features (e.g. it is a strongly typed language), but because of its historical importance and the influence it has had on many of the languages that succeeded it.

share|improve this answer
add comment

Yes.

System and lower level development. And when speed is bliss.

share|improve this answer
show 1 more comment

According to the TIOBE Software Index, C is second only to Java in usage. So the answer to your question is yes, yes learning C is still relevant. Even if you're not programming in C, it will help understand a number of the concepts in Java, including how pointers and arrays work.

share|improve this answer
add comment

C is relevant. Yes. Even though, as far as I know, there aren't as many new projects in C as there are in say Java, C#, the popular dynamic languages of today (python, ruby, php, javascript, and so forth), or even in C++.

However, there are jobs which may require you to have to deal with C. Other answers listed many of them. I'd like to add free software. Many (it's actually impressive how many) free/open source software make extensive use of C. There are people out there who work in maintaining those programs and some of them get paid for it. Customization of free and open source software is a job some people have to do, although a not common one, that could require you to know C.

Some days ago, I actually talked to a guy who had to do that kind of thing.

As a personal note, I'd not choose it as my primary, or even secondary, "professional language of choice".

share|improve this answer
add comment

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