Until not too long ago, De Anza College still taught C as an introductory programming language (I think because some recently retired instructors wrote a textbook on it). Even now, from what I've seen of the syllabi online, their C++ course that replaced it is still mostly C with some sprinkling of classes added on. I thought it was a horrible idea, and I had a pretty miserable experience at De Anza. If you're just s…
My experience is the reverse. I think that beginning with C gives you the necessary knowledge of the inner workings of programs and systems that is required if you want to end up with a degree in CS/CE/similar. I've seen too many programmers that started with Java or Python and then didn't know what exactly is memory, what is "allocation" or similar concepts that are required if you want to understand what's going on…
Why Learn to Program in C?
31–40 of 123 posts
Re: Why Learn to Program in C?
#32I am a strong believer in learning C as your first language. Why? Well a number of reasons but the two main ones are 1) it teaches you about what is happening at a lower level so you have some idea about what is happening behind the scenes of that Java code you wrote or whatever and 2) it makes you appreciate just how lucky you have it in higher level languages. However I don't think you should start writing all your…
Honestly, at this point you're probably better of using Rust for that.
Re: Why Learn to Program in C?
#33I 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…
> 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.…
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.
Re: Why Learn to Program in C?
#34I 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…
> 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.…
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?
Re: Why Learn to Program in C?
#35C is great. I wouldn't recommend starting programming in C, though. At least not with the standard exercises you see. Get user input, read a file, do this do that with it. Why? the C standard library is full of gotchas and tricks and goofy shit that makes it unsuitable for new programmers. The comp.lang.c FAQ should be standard reading material for anyone taking a C class. Look at all the posts on StackOverflow about…
The argument that one "should study other languages before they're fit to learn C" is terrible IMO and somewhat condescending. It's like saying one must learn "nedit/pico" before starting with editors like "emacs/vi". Please stop repeating that - especially if you have not done much C.
I am probably too old to understand the constant hate and criticism on why C shouldn't be taught to beginners. Not everything "has to be easy". Starting with C & Linux, I always had an advantage later in my career because it was these skills that enabled me to drill deeper than those who didn't know C & system programming.
C isn't just hard for beginners because of the language but the rest of the tool-chain. If you can get over this then learning C will also teach how to debug with gdb, strace, valgrind and learning about low level system calls, and a great deal about how a program can be loaded/structured e.g.: dynamic & static linking. Also where the resources are used and how to eliminate it’s bottlenecks. What is a heap, stack or static memory? How does memory management or garbage-collection work on a modern OS? What is IPC and how do the individual system calls function & require as input? How do you compile a program and optimize it for different target platforms? How do you write Makefiles or use autotools etc ...
Tell me again which other language forces you to learn these things? You could easily build a career just on C & Linux because of this "additional learning curve" and extra knowledge that a good C developer will have.
Sorry for all my bias (as I said my views might be very outdated :-))
Re: Why Learn to Program in C?
#36C is great. I wouldn't recommend starting programming in C, though. At least not with the standard exercises you see. Get user input, read a file, do this do that with it. Why? the C standard library is full of gotchas and tricks and goofy shit that makes it unsuitable for new programmers. The comp.lang.c FAQ should be standard reading material for anyone taking a C class. Look at all the posts on StackOverflow about…
Re: Why Learn to Program in C?
#37Earlier quoted context omitted.
Overcoming goofy shit and gotchas is part of any programming system.
Yeah, but why start with an exceedingly painful one except to needlessly inflict pain and suffering on students. Better to lay the groundwork with a friendlier language, learn the basics, and then move on to the more complicated gottchas (at least in my amateur opinion).
Re: Why Learn to Program in C?
#38Re: Why Learn to Program in C?
#39Until not too long ago, De Anza College still taught C as an introductory programming language (I think because some recently retired instructors wrote a textbook on it). Even now, from what I've seen of the syllabi online, their C++ course that replaced it is still mostly C with some sprinkling of classes added on. I thought it was a horrible idea, and I had a pretty miserable experience at De Anza. If you're just s…
No one should get bogged down in pointer hell. I program C for real work all the time, and I teach it to undergrads, and we use pointers carefully and with awareness. We don't do arithmetic or other 'clever' stuff. And we don't get bogged down in pointer hell.
Why do we teach it to undergrads? Among other reasons, because trying to teach OS or compilers to students who don't get pointers or any other low-level stuff is miserable.
Re: Why Learn to Program in C?
#40Earlier quoted context omitted.
Yeah, but why start with an exceedingly painful one except to needlessly inflict pain and suffering on students. Better to lay the groundwork with a friendlier language, learn the basics, and then move on to the more complicated gottchas (at least in my amateur opinion).
What language would you suggest is friendlier, and less rife with gotchas? I find the rules of C fairly reasonable, at least on the surface.