|
|
|
|
|
by mywittyname
2954 days ago
|
|
I'll throw out my $0.02, which is C is a terrible language to learn. Much of writing "good" C revolves around knowing all the pitfalls to check for, then dealing with the archaic error handling mechanisms. Tomes have been written on the subject of proper error handing in C. > fundamentals of things like memory allocation, data types, call stacks, etc. remain a mystery to them. I don't think C is especially good at teaching these. Unless you roll your own malloc, the big difference in memory allocation in C vs. say, Java is that C requires the programmer free memory after allocation on the heap. This is more tedious than difficult. Data types exist in other languages. You can unpack raw bytes of data using Java and simulate the behavior or unions. You'll have to explain how call stacks are more exposed in C. Best I can think is calling conventions, but that's more the domain of compilers than language. Buffer overflow prevention, maybe (but again, I think that's more tedium to deal with). C is great because it's a small language. But I don't think it's an especially educational language. |
|
Many times that doesn't matter, but to me it's important to have a supple and complete understanding of the underlying ideas. Java fails at that.
When I referred to memory I meant more than malloc and free. It's things like understanding how an array of ints is laid out in memory and what happens when you treat it as an array of chars instead. If you talk about this to a Java programmer, their eyes are likely to cross.