5 ms·
I find it odd that anyone would question the value of learning C. I find the negative attitudes toward C to be very odd in general. Now, it is clear to me that
by goodcanadian 11y ago
I find it odd that anyone would question the value of learning C. I find the negative attitudes toward C to be very odd in general. Now, it is clear to me that I am in the minority, but I can't understand why people would be doing serious work in an interpreted language. I detest garbage collection as I have no control over it. I am sure I could write statements like this all day.
Don't get me wrong: I use perl when it makes sense; I use Java when it makes sense. I quite like playing with new languages and seeing what I can do with them. There are many languages that are safer than C or easier to do particular tasks than with C, but I am very rarely happy with the trade offs. When I am trying to do serious work that is meant to stand the test of time, I'll use C.
- munificent 11y ago> I can't understand why people would be doing serious work in an interpreted language. I detest garbage collection as I have no control over it. You have no control over C's register allocator. (Well, very little, `register` doesn't mean much.) Assuming you use it, you have no control over how the standard library's malloc() and free() work. malloc() could be best-fit, first-fit, something else entirely, who knows. No control over fragmentation. You have no control over the CPU's branch predictor or cache eviction policy. You don't control the OS's thread scheduler, virtual memory implementation, etc. Everyone picks a spot where things below that level are details they don't want to care about. You may have picked a slightly lower level, but there's nothing fundamentally different between you liking C and someone else liking Java (which is GC but not interpreted), Forth (interpreted but not GC), or Ruby (GC and interpreted). People do serious work in Ruby for the same exact same reason you do serious work in C, it lets them control the things they need to control and ignore the things they don't.
- AnimalMuppet 11y agoExactly. If I don't need to care about X, picking a language where I don't have to care about X is a win (for any value of X). That is, it's a win right up until the scope or scale grows to the point that I now have to care about X. Then the language where I "don't have to" usually turns into a language where I can't, and I'm trapped.
- goodcanadian 11y agoYes, but interpreted is slow, and garbage collection causes pauses at essentially random times. These things are fine for one off sorts of problems where it doesn't matter much if it takes a little longer. If you are writing an application that is meant to be run thousands or millions of times, I start to wonder why people don't care more about these trade-offs (the answer is, of course, they do . . . if they are, for example, running large infrastructure like Google or Amazon). My point isn't/wasn't so much to crap on other languages, but to express dismay at why people crap on C so much or view it as irrelevant. Ruby is definitely not irrelevant. Why would people think C is?
- umanwizard 11y agoThe main language at Amazon is Java. Lots of Java code is being run millions and millions of times there. Java isn't as slow as you think it is.
- goodcanadian 11y agoI didn't say Java is slow. I said that garbage collection introduces unpredictable pauses. This is potentially an issue with Java, but it all depends on the problem you are trying to solve. In many cases, it won't matter, but in some, it will. How is this relevant to the idea that C is an important and relevant language?
- munificent 11y ago> My point isn't/wasn't so much to crap on other languages, but to express dismay at why people crap on C so much or view it as irrelevant. Well... you did kind of just crap on other languages. Personally, I like C, C++, Java, Ruby, JS, and lots of other languages, all for different purposes. I don't feel dismay when people use GC languages, or when they use languages that make it easy to have buffer overflows or security bugs. I just get dismayed when they use them for the wrong kinds of programs.