58

My first programming language was PHP (gasp). After that I started working with JavaScript. I've recently done work in C#.

I've never once looked at low or mid level languages like C.

The general consensus in the programming-community-at-large is that "a programmer who hasn't learned something like C, frankly, just can't handle programming concepts like pointers, data types, passing values by reference, etc."

I do not agree. I argue that:

  1. Because high level languages are easily accessible, more "non-programmers" dive in and make a mess
  2. In order to really get anything done in a high level language, one needs to understand the same similar concepts that most proponents of "learn-low-level-first" evangelize about.

Some people need to know C; those people have jobs that require them to write low to mid-level code. I'm sure C is awesome, and I'm sure there are a few bad programmers who know C.

Why the bias? As a good, honest, hungry programmer, if I had to learn C (for some unforeseen reason), I would learn C. Considering the multitude of languages out there, shouldn't good programmers focus on learning what advances us? Shouldn't we learn what interests us? Should we not utilize our finite time moving forward? Why do some programmers disagree with this?

I believe that striving for excellence in what you do is the fundamental deterministic trait between good programmers and bad ones.

Does anyone have any real world examples of how something written in a high level language—say Java, Pascal, PHP, or JavaScript—truly benefited from a prior knowledge of C? Examples would be most appreciated.

toniedzwiedz
  • 1,345
  • 4
  • 16
  • 25
Stephen
  • 2,200
  • 6
  • 22
  • 24
  • @Stephen Oh, sorry... I misunderstood. (but u do see why u need to learn c /c++ right?) – ApprenticeHacker Jul 14 '11 at 13:27
  • 1
    @burningprodigy Yes, in the case that I need to do something where C/C++ is required, or makes the most sense, of course I would learn C. My beef is with people who say you need to learn C to be able to effectively develop in high level languages. And that is absurd. – Stephen Jul 14 '11 at 23:16
  • @burningprodigy let us [continue this discussion in chat](http://chat.stackexchange.com/rooms/817/discussion-between-stephen-and-burningprodigy) – Stephen Jul 14 '11 at 23:16
  • can you give us some context (url) where "can't handle programming concepts like pointer..." comes from? – k3b Aug 13 '13 at 12:47
  • If there was one language I wish I could learn, it would be Common Lisp, not C. As primarily a C# developer, I'm rather certain I'd benefit more from it. We already have pointers in C#. Mostly, I'd rather learn more ways to approach a problem than to try to implement my same solution in a more difficult way. (Just as a note, I'm half lying. I've done some C, and I know that it has its advantages. Just wanted to give credit to an incredibly powerful and expressive language that predated C by a decade.) – Magus Feb 18 '14 at 23:56
  • "*shouldn't good programmers focus on learning what advances us?*" - How dow you know that upfront? The problem is, you don't know what you don't know. You can't tell what you will get out of learning some C, or F#, maybe Haskell, Erlang or some of the not-so-mainstream languages. But you will get *something* out of it, even if you are never going to use them productively. – JensG Nov 23 '14 at 11:25
  • This seems like yet another instance of the [real programmer](https://www.cs.utah.edu/~elb/folklore/mel.html) [fallacy](http://xkcd.com/378/). – whereswalden Nov 24 '14 at 03:48

15 Answers15

111

The advantage to knowing C is that you have a very good idea of how a computer works. Not just how your programming model works, but how memory's laid out, and suchlike.

The only level below C is the assembly spoken by a particular CPU.

(I'd add that knowing C also lets you appreciate how much less work you have to do in a higher level language. And hopefully an appreciation of the cost involved in working in that higher level language.)

Frank Shearar
  • 16,643
  • 7
  • 48
  • 84
  • 12
    Frank: You hit the nail on the head. Understanding how a computer works, memory management and allocation along with the idea that you can further appreciate higher level languages is the reason to learn C. I am lucky we had to learn C to implement class projects such as implementing a basic TCP layer over UDP. – Chris Oct 26 '10 at 12:43
  • 12
    I agree with this, although: C brings you only a few steps closer to the grass roots, not all the way to the ground. Ok, there's a thing called memory layout. But what does it mean physically? Do you understand how computer works if you don't understand electronics? Quantum mechanics? And so on. I'm not sure if there's a single mind in the world who deeply understands the whole food chain from a high-level language, via C, down to quantum mechanics. – Joonas Pulakka Oct 26 '10 at 13:19
  • I recall a long debate with my boss once about what "physical layour of an object" actually meant. We boggled when we started talking about fluctuations in magnetic/electric fields. – Frank Shearar Oct 26 '10 at 13:23
  • Excellent way of looking at it, Joonas. – Stephen Oct 26 '10 at 13:25
  • 1
    "hopefully an appreciation of the cost involved in working in that higher level language" - wish I could up-vote this multiple times for this sentence. Fantastic answer. – DevSolo Oct 26 '10 at 13:47
  • 14
    My question is how can you benefit from knowing how a computer works internally? What are you gaining? Appreciation of what you have now isn't a very good reason to learn a very low level language like C. Its like saying I should learn Fortran to appreciate what I have now – TheLQ Oct 26 '10 at 14:15
  • 18
    @TheLQ I'm speechless. How can you benefit from knowing how a computer works internally? You're gaining a clearer understanding of what you're doing, is what you're gaining. Rather: you're learning what it is you're actually doing to the machine in the first place. – Frank Shearar Oct 26 '10 at 14:38
  • CPUs don't speak in assembly (I know I'm being a stickler lol). Still +1! – webbiedave Oct 26 '10 at 14:57
  • 3
    @Frank And I benefit from knowing what happens internally how? Framing people in constructions don't need to be physics majors to understand what exactly a 2x4 is doing unless their job requires it. Knowing what happens inside might be useful for embedded development but thats a specialized field – TheLQ Oct 26 '10 at 15:18
  • 1
    @TheLQ The gulf between quantum physics and mechanics is, in my opinion, orders of magnitude larger than the gulf between C and, say, Haskell. So I think your analogy's flawed. Putting that aside, if you use Java, Ruby, Smalltalk and simply have to increase performance, guess what? You're going to be rewriting part of your application in C. Oh, you don't know C? Oh, dear. – Frank Shearar Oct 26 '10 at 15:41
  • 4
    @Frank. At that point I'd learn C. Or figure out a better way. – Stephen Oct 26 '10 at 16:04
  • 15
    I'm going to mark this as correct, as it seems to be the favorite answer. That said, I don't really care "how a computer works" on a fundamental level, as it really doesn't help me develop the next cool feature of my application. It's like driving a car: I'm very good at it, but could care less how the break fluid pressure works. It just stops when I hit the brake. Also, I'm sure I would appreciate driving a car more if I had to first ride around in a horse-and-buggy for five years. Doesn't mean I'm incapable of postulating how much better things are with the car rather than the buggy. – Stephen Oct 26 '10 at 21:17
  • 2
    @TheLQ: You need to know how a CPU functions in order to write multi-threaded applications - cache coherence, for instance. One phenomenom that'll slow down your program is if the threads are subjected to _false sharing_, which will cause the CPUs' caches from being invalidated and unnecessarily increase data traffic even though there is no sharing of data. The whole point of multi-threading a program is often to make it run faster by utilizing the multiple cores. If you don't know how to avoid false sharing, your program will run _slower_, not faster. – gablin Oct 26 '10 at 22:09
  • 8
    @TheLQ: poorly chosen metaphor. A skilled woodworker *absolutely* needs to understand many aspects of the internals of wood to perform an above-average job. For instance, how might various types of wood change in size in response to varying humidity? A very necessary part of wood physics to understand. This is very similar to how, say, understanding the impact of CPU cache misses and what sort of cache locality characteristics various algorithm implementations might have. We cannot become masters of our trade without understanding the building blocks on a deeper level. – quentin-starin Nov 15 '10 at 19:40
  • 1
    That said, I have never been a fluent c/c++ programmer and I feel I have quite a depth of knowledge on hardware that helps me day to day in business programming. So the knowledge can be acquired without, say, learning C. – quentin-starin Nov 15 '10 at 19:41
  • 1
    @Joonas - I dunno. There are quite a few physics geeks in programming. ;-) – Jason Baker Nov 15 '10 at 21:40
  • 2
    @TheLQ, the reason why you can benefit from learning how a computer works internally is because a CPU cannot execute an infinite number of instructions per second. –  Nov 15 '10 at 21:43
  • 4
    @Stephen, regarding not knowing how break fluid pressure works in your car analogy - this means that YOU go to your mechanic and say "could you please make this car go faster, please, I need it!" as opposed to lifting the hood and start MAKING it faster. –  Nov 15 '10 at 21:46
  • @Thorbjørn: Serious drivers know a thing or two about a thing or two when it comes to the car, but they all have pit crews. ;) YOU make it go faster. I'll drive. ;) – Stephen Nov 15 '10 at 22:02
  • @Stephen, only experienced, talented racer drivers have pit crews. You can't have one if you don't want to learn racer driving ;-) –  Nov 16 '10 at 04:33
  • @Jason - I know, I happen to be one :-) So I kind of know that if someone claims to understand it all, he's more likely just an ignorant fool than a genius. – Joonas Pulakka Nov 16 '10 at 07:04
  • I think the car analogy is especially apt. If your car won't start, you need to have some idea how the engine works in order to fix it. If your app won't load, you need to have some idea how the computer works. Taking your car to a mechanic is like calling in a consultant to diagnose your app's problem. Sure, you can do it, but wouldn't it be better if you could do it yourself? – TMN Dec 23 '10 at 14:52
  • 1
    I'm still not seeing a good reason why you *really and truly know* need to how the computer works to write a webpage other than "someday you might need to know*. – Greg Dec 28 '10 at 15:04
  • 8
    Writing a web page is, of course, not programming. The point is that sooner or later the abstractions you take for granted will fail, and if you don't know a bit of how that abstraction works under the hood, you're hosed. Like the day you find your first compiler bug. – Frank Shearar Dec 28 '10 at 15:32
  • Web *app*, sorry...specifically CRUD applications with a database backend. You're more likely to find a bug with the Oracle database than in the .Net compiler, and there's not much you can/should do that about besides file a bug report. – Greg Dec 28 '10 at 18:08
  • 4
    @Greg: And if you find a bug in the database software, knowledge of relational database fundamentals will likely be invaluable to finding and implementing a workaround – compare to someone that just copies and pastes queries, but becomes *completely* lost when faced with the same problem. The point of this answer is learning C is one way to learn some of the required fundamentals, but not that C will teach you *all* of them. – Fred Nurk Jan 22 '11 at 11:12
  • @Fred: I like that – Greg Jan 22 '11 at 11:56
  • 1
    @Stephen Knowing how the computer actually works can become very useful when you're trying to debug the weird cases. I am of the opinion that all competent programmers need to be able to read the assembly language of their system so they're not lost when they suddenly end up with a screen full of it. (Note that writing it is another matter, that's a specialized skill most programmers will never need.) – Loren Pechtel May 08 '13 at 20:41
  • @gablin "You need to know how a CPU functions in order to write multi-threaded applications - cache coherence, for instance." <- true if you're writing your multi-threaded application _in C_; however, like other low-level details, high level languages abstract this away. – weberc2 May 14 '14 at 16:11
  • @LorenPechtel If you're not using a low level language like C, you won't end up with a screen full of ASM. Sounds like you're saying, "You should learn C because it will be helpful if you have a C problem" – weberc2 May 14 '14 at 16:13
  • @weberc2 Anything that compiles to native code can give you a screen full of assembly. – Loren Pechtel May 15 '14 at 19:48
71

I don't think any of the answers here are really what the OP was looking for, so I'm going to throw in my own opinion.

Look, I'm an unapologetic C snob. My attitude is that if you don't know C, then to some extent you don't really know what you're doing as a programmer. So, I think I'm the sort of "biased" person you're talking about here.

However, in practice, whether or not you really know what you're doing as a programmer doesn't necessarily prevent you from developing really awesome, useful software using high-level tools. I mean, the creator of Stack Overflow, Jeff Atwood, apparently doesn't even know C, and yet I would say Stack Overflow is a pretty damn good web application.

Whether or not you decide to learn C (or C++, or assembly) depends on what type of programmer you want to be. If you just want to develop cool web apps or business apps, that's fine - no real need to learn C. But if you want to really excel at what you do - if you want to work on really cool projects that push the state of the art, then you really need to take yourself seriously enough as a programmer to really understand how computers work. Since C is essentially the OS lingua franca, as well as the language that powers just about everything else (from the Linux kernel to most Java VMs, to the Python and Ruby interpreters, SQL databases, web servers, and just about every device driver), an intimate understanding of the language goes a long way.

Not to mention that knowing C (or C++) opens up a huge opportunity for contributing to large open-source projects that impact millions (or hundreds of millions) of people. Want to work on improving the Python interpreter, or the Chromium web browser? Well, you need to know C for the first and C++ for the latter.

That's why comparing C to dead natural languages like Latin or outdated technologies like the horse and carriage is completely wrong. A large portion of our 21st century software infrastructure is powered by C code, which is why C remains as relevant today as ever.

So, whether or not you should learn C really depends on what you want out of your career as a programmer.

Charles Salvia
  • 7,342
  • 1
  • 35
  • 33
  • 5
    You don't sound *that* snobbish. Okay maybe a little. :) – Stephen Nov 15 '10 at 18:37
  • 7
    Excellent answer. I programmed successfully for ten years without learning C and C++, and could have gone the rest of my career without ever learning it. But since I learned it last year, I've written *better* software, not just in C++, but in my other languages as well. – John M Gant Dec 20 '10 at 19:37
  • How well should one learn C before they can impress you? Some code in that language for 5 years and still learn ... – Job Dec 30 '10 at 03:41
  • 3
    Here are some things the other creator of SO has to say about knowing C: http://www.joelonsoftware.com/articles/ThePerilsofJavaSchools.html http://www.joelonsoftware.com/articles/CollegeAdvice.html http://www.joelonsoftware.com/articles/fog0000000319.html – Isaac Kleinman May 08 '13 at 19:22
  • 3
    Why would it be "completely wrong" to compare C to Latin? I think it's an excellent analogy. Latin is everywhere around us. 58% of the English vocabulary is influenced by Latin (directly or through other Romance languages). Latin also holds the key to understanding our culture. Law, democracy, religion, infrastructure, city-planning and a range of other areas can be traced back to the Roman Empire. You can choose to ignore C in the same way that you can ignore Latin, but you can never avoid them. "Latin and Greek are not dead languages. They have merely ceased to be mortal." (J. W. McKail) – Anders Sjöqvist Nov 23 '14 at 14:39
  • 2
    @AndersSjöqvist, it would be wrong because nobody speaks Latin anymore, even though it has profoundly influenced the development of modern languages. Whereas C is actively *used* and in use *everywhere* - in just about every OS, VM, database or interpreter. Latin is more like, let's say... [Simula](http://en.wikipedia.org/wiki/Simula) - a mostly dead language that has profoundly influenced living languages, yet isn't used outside of academia. – Charles Salvia Dec 22 '14 at 22:07
12

A practical rule of thumb is that you need to understand at least one level of abstraction below the one you usually work in. Consider that your PHP or JavaScript interpreter may actually be implemented in C or C++. Eventually you are going to hit a bug in the interpreter or even a C runtime error. If you don't understand C you are going to be limited to sending a bug report to the maintainer, hoping they can reproduce it and care about it, and then twiddling your thumbs. If you know C you can tell them exactly where the problem is and what it is.

This also means that if you work in C/C++ you should at least be able to read assembly on your platform.

As for learning C when you need it: my observation is that most programmers can learn Perl/Python/Javascript on demand, but assembler/C/Lisp seem to require a lot more time, so it's worth learning at least some basics before the need arises.

Charles E. Grant
  • 16,612
  • 1
  • 46
  • 73
  • 9
    Ok, "C/C++" I can live with (language lawyers be damned). And "Perl/Python/Javascript" is perfectly reasonable. But for the love of God, why "assembler/C/Lisp"? That's like saying "apple/orange/Barrack Obama". Those three languages have nothing to do with each other. – Jason Baker Sep 12 '11 at 05:07
  • @Jason, the only commonality I was suggesting is that most folks find that trio of languages harder to pick up on the fly, and so it might be worth the OP's while to spend some time with them before an immediate need to use them arises. Pointer arithmetic and functional programming don't have much in common except that people seem to have to stare at them longer before they make sense. – Charles E. Grant Sep 12 '11 at 06:02
  • I couldn't agree more. Going the other way, to higher levels of abstraction, the “office IT guy/gal” who can do at least some programming will usually be better than the one who can't. – Emmet Jul 27 '14 at 23:09
7

I don't agree that you need to learn C first, but I do believe you should learn C eventually. All abstractions are leaky and understanding C makes it easier to understand what's really happening when you use some fancy high-level abstraction. That said, I also think all serious programmers should eventually learn to at least read assembler, for the same reason.

Learning these low-level concepts gives surprising ability to reason about high-level stuff. For example, in C++ and D, default arguments to virtual functions are determined by the static (compile time) type of the object, not the dynamic (runtime) type. This makes no sense unless you understand how vtables and calling conventions work and why it would be extremely hard to implement virtual functions in the opposite way.

dsimcha
  • 17,224
  • 9
  • 64
  • 81
  • 2
    Learn to read AN Assembly language maybe. The problem is that I have upwards of 10 different processor families that I use and learning all of the very different variants is a recipe for confusion and chaos. Try comparing AMD SHARC with Atmel AVR32 and TI MSP430. – uɐɪ Oct 26 '10 at 12:51
  • @Ian: Right. Ideally you should learn the assembly language of whatever arch you develop most for. For most people I guess this will be either x86 or ARM. – dsimcha Oct 26 '10 at 12:59
  • 3
    "all serious programmers should eventually learn to at least read assembler" It's comments like these that got me started with this question. I think you are simply biased, sir. Although, I like what you said about leaky abstractions. That makes sense. On the other hand, these things don't make a whole lot of "real-world" difference in my arena. I'm still using the high-level abstraction, leaky or not. – Stephen Oct 26 '10 at 13:24
  • 1
    @Stephen, you should try writing some assembler language.The 8-bit CPU's are not hard and trying to implement the same small thing in both 6502 (like the C64) and Z80 (like CP/M business machines) is actually a very educative experience due to some very basic design differences (index page versus registers). –  Nov 15 '10 at 21:51
  • +1 despite the blatantly false `All abstractions are leaky` statement. – Thomas Eding May 08 '13 at 16:39
7

The bias is one of status quo. In the old days (1980s and earlier), C / C++ was pretty much a requirement for performance applications. That's changed but senior developers generally come from that old-skool background and view things in that context.

For actual development other languages are used - C# is a popular one, as is Java, while PHP and Python are popular for internal projects and it's always useful to have someone on hand with at least basic knowledge in that area in case you choose an open source PHP project for, let's say, your bug tracking system. However, job specs still seem to come from that standard template that was written 25 years ago.

JohnL
  • 1,890
  • 13
  • 14
6

What a great slug-fest! (As they supposedly say: Is this a private fight, or can anybody join in?)

I was a professor, and what I found (after some trial-and-error) was that it was much easier to lead students through the intricate concepts of programming if they understood, at a base level, just what a computer was doing. Not in all the nitty details, but the basic principle, like what memory is, what instructions are, etc. What I like about C is it's close to the machine.

That's not to say other teachers came to the same place. They started off in the high-level language (BASIC :-) and went forward from there, with no obvious ill effects.

So bottom line, Stephen, you could be right. I wouldn't think so, but I've been wrong before.

Mike Dunlavey
  • 12,815
  • 2
  • 35
  • 58
6

Much as I hate to post the obligatory Joel blog post, I agree with him here. C is the lingua franca of programming. I can't think of any high-level language that can't interface with it somehow. Because of that, C is still a popular choice for systems programming type stuff. You simply can't interface with some OS-level things without C.

Besides that, what do you plan to do when your high-level language isn't fast enough? Knowing how to write C is especially important when you're using a high-level, dynamically typed language like Ruby, Python, or PHP. But even Java and C# programmers need to drop down to C from time to time.

Jason Baker
  • 9,625
  • 8
  • 44
  • 67
  • lol. Joels advice in the linked column: "You'd be better off ignoring what I'm saying here and instead building some kind of online software thing that lets other students find people to go out on dates with." – Stephen Nov 15 '10 at 22:05
  • 3
    @Stephen: If you want people to really notice you, then get them either laid or paid. – Fred Nurk Jan 22 '11 at 11:17
  • @Fred Great advice, lol. – Stephen Jan 22 '11 at 13:52
4

I guess this is progress.

Twenty years ago, the conventional wisdom was that you had to learn assembler in order to understand what you were gaining from higher-level languages like C (which is why I had to take an assembler class in college using VAX Macro; guess how useful that turned out to be upon graduating).

There's a superstition that because C is somewhat hard to learn and that it provides almost no abstractions (pointers and byte streams are pretty much it), learning it will somehow make you a better programmer or give you greater insight into how things work at the hardware level.

This is not (necessarily) true. Standard C doesn't get you any closer to the metal than any other 3GL (Pascal, Fortran, etc.). Some C implementations may provide hooks that give you greater access to some areas, but in general naked pointers are about as close as you get, which isn't close at all. You cannot directly access registers or status words, for example.

In the end, it all comes down to opcodes and addressing modes, so if you're really interested in how things work at the lower level, you'd be better served learning assembler over C.

By itself, learning C will not (necessarily) make you a better programmer. It will definitely give you an appreciation for actual string types and standardized container libraries, though.

John Bode
  • 10,826
  • 1
  • 31
  • 43
  • I guess "appreciation" is one way of putting it. In my high school programming class, it was mostly just questions of "I need to use this function. How do I convert a LOLOMGCHAR* to a WTFBBQCHAR*?" – Katana314 Aug 13 '13 at 13:48
  • i think C was easy to learn. at least it was for me from just reading Kernighan & Ritchie . – robert bristow-johnson Dec 23 '14 at 00:38
2

A language is a tool. If you only have to write web pages and the like then I am sure that you can get away without having to learn C, in just the same way that if you only ever make plastic model kits you only need a sharp knife and glue, a spanner is not normally required.

I write code for embedded systems with highly restricted memory resources (the biggest I have done recently is 16kbyte and that was HUGE) In this market then C or assembler are the only options and any of the fluffy higher level languages just don't work.

uɐɪ
  • 3,001
  • 1
  • 16
  • 17
  • 1
    That's great... But not everyone does that. The implication seems to be that people who *aren't* writing for embedded systems are just playing and not doing serious development - at least, taking your model analogy in the context of your embedded systems point. That's clearly not the case and it's possible to write large-scale production applications without ever touching C. – JohnL Oct 26 '10 at 12:53
  • Of course it is possible to write large scale production applications without going near C. I wrote code for 10 years before I got to use C. I used PL/M, Pascal, ADA as well as assembler. These were easily as good as C for learning the underlying mechanics of the machine, and often better for producing error free code. – uɐɪ Oct 26 '10 at 13:07
  • Great - though your answer above didn't give me the impression that you thought that way, hence my reply... – JohnL Oct 26 '10 at 13:47
  • Do you have any experience with the Java engines targetting embedded usage? –  Nov 15 '10 at 21:48
2

Procoatively asked: Are you asking for confirmation that you do not have to learn C? If you learn pure C (not C++ necessarily) you will get a thorough understanding of the execution model of a computer. Especially about memory and allocation. This stuff also matters to people programming in higher level langauges.

For a PHP programmer its just less transparent how code is executed on the given machine. It might not matter for the PHP programmer since Network transfer is the bottle neck in the application, etc.

Plain PHP/Python/C# has a lot of abstraction layers between the language and the CPU. these layers are so thick that they do not allow you to look through them. When you learn C, there is a thin sheet between you and the CPU and the operating system. That does not make programming easier (and it might not even be better). But you are actually able to learn how the CPU works. Once you know the "intermediate" C, you can actually start to link that knowledge upwards to the higher level language. This is the immediate benefit that you will gain.

In my opinion a programmer should always spent some time learning different programming concepts. It definitely pays of to have a look at C, but also to have a look at even higher level programming languages such as Clojure, Haskell, Prolog.

You don't have to become a master in these, they will just teach you the lesson that "levels" of programming languages are not binary but there are a lot of levels. Get to know them, from top to bottom (Assembler). It will make you a better programmer.

wirrbel
  • 3,018
  • 2
  • 21
  • 33
2

You need to know enough C to read code written in C, because of the vast amount of very important code written in the language. That's about all you will retain from going well through a thorough manual on the subject (I used Kochan's "programming in C") without actually having to code in the language, anyway. Should you ever wind up in a situation requiring you to use the language extensively, you will have a good base to build on. You probably want to study something like Duntemanns Assembly book if the machine is an abstacted black box to you. I also recommend Petzold's "Code".

Outside of that--basic literacy in C and basic familiarity with the underlying machine--you'd be best served spending your study time on the real stuff, like SICP, TCP/IP Illustrated or books on Concrete Mathematics, algorithms or data structure. The real stuff.

Spending a lot of time studying C while coding in PHP simply isn't worth the opportunity cost. There's more helpful things to learn. C really is just another language that you can learn well only though study and use, but can pick up when you need to.

Sweat the hard stuff.

naftalimich
  • 433
  • 3
  • 9
2

In my experience, for a while C/C++ was a good buffer that segregated the good programmers from the VB6 coders. After doing five odd years of C/C++, I got a job working in VB6. I was amazed at the quality (or lack thereof) of the coders. They had little interest in the guts of the language, in design or about performance. Unfortunately, when the company moved to .Net, the C/C++ coders and the .Net coders were using the same tools. The VB coders were even worse VB.Net coders. The situation got worse when all development went to ASP.NET. Suddenly anyone who could drag and drop a control was a programmer.

In the job market, though, there was not much to differentiate the hard-core coders (ex C/C++) and the tourists.

As such, having C or C++ on your resume may help differente you from the riff-raff.

dave
  • 2,466
  • 15
  • 21
1

C is the language that is used to write other languages. It allows you to get as intimate with the CPU and other hardware as you like.

If you don't know C, you don't know how other languages achieve the results they do.

Abstraction is an important concept, of course, and not everyone needs to know how their framework of choice is achieving the results it promises. You don't need to spend 20 years writing C, or indeed thinking about what happens to your vtables when you use multiple inheritance, in order to write good code.

Now, you can drive a car without understanding how a 4-stroke engine works or indeed without being able to use a stick shift (manual gear box).

However, if you understand what is going on under the hood you will, from time to time, be able to achieve exceptional results that someone without that knowledge will struggle to replicate.

Bill Michell
  • 1,980
  • 14
  • 15
1

C (and possibly C++) is the sea you are swimming in. The OS that will run your code is probably coded in C (and C++). So your native API to access OS services will be in C.

If you can do without knowing what is there below, there is no need to know C. However most programmers need to dive into lower levels at sometime in their lives.

It is also based on your specialization of development areas. For example a web developer who writes HTML, Javascript and some server side scripting may never need to know anything about C, but a distributed system or game developer will.

It never hurts to spend a few weeks learning something so fundamental for your profession.

Mert Akcakaya
  • 2,089
  • 1
  • 13
  • 16
1

C has many advantages:

  1. C is a low level language.You can use c to develop kernel and driver.
  2. C is fastest language.Many power software be developed by c. For example: memcached,redis,nginx,apache,mysql etc.
  3. C is a cross-platform language. The program developed by c can run at every platform. Other cross-platform languages can not do this. Java,python,php etc can not run at iOS platform.
  4. C++ can not run at many embedded systems.
Ben McDougall
  • 716
  • 5
  • 17
Edward Shen
  • 139
  • 6