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.
Why Learn to Program in C?
11–20 of 123 posts
Re: Why Learn to Program in C?
#12Re: Why Learn to Program in C?
#13Why? 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 stdio functions 'not working right' and asking how to do menial things like collect keypresses.
C works well as a first language if you teach it like assembly (use of which as a teaching language is another debate): flip some bits and do some loops. But not for collecting user input/output. Half of your students are going to get stuck trying to collect a list of names from the user, before they even get a chance to get stuck trying to sort the list.
Re: Why Learn to Program in C?
#14But what surprised me more was that the courses became more institutionalized. Professors were bettering you for a cushy career as an employee at a bank or large corporation instead of showing you how to use the computer to solve a dizzying amount of technical, social and and financial problems. I could understand a technical college emphasizing a safe, risk-free entry into a nice career but I expected better from a university.
Re: Why Learn to Program in C?
#15I'm surprised that people have managed to get through a CS program without learning C (or, at least, C++)! It seems to me that programming should be taught simultaneously in Haskell (or Lisp?) and C. - C teaches you how computers work. - Haskell teaches you how programming logic works.
C doesn't really tell you how computers work, a healthy dose of Hennessy's book and an accompanying lecture works much better than learning C. But C has immense cultural value. Lots and lots of extant source code, important source code: Linux. The BSDs. PostgreSQL, SQLite, whatever. C is the lingua franca. "Everybody" speaks at least a little C, so it can be used as pseudocode notation (without learning some specific…
Yes, exactly! In my opinion, C for a programmer or computer scientist is like Latin for a medieval scholar. You don’t need to speak it fluently, but it’s good to know enough to read other people’s works and understand how concepts are expressed.
In practical terms, I think that almost any programmer can benefit from reading K&R and doing the exercises in it, even if they never go on to write “real” programs in C. The book is very short and readable, and finishing it is a much tinier task than learning the standard libraries and toolchain options and best practices and all the other stuff you need to be productive writing production-quality code.
Re: Why Learn to Program in C?
#16Re: Why Learn to Program in C?
#17Re: Why Learn to Program in C?
#18Until 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…
Re: Why Learn to Program in C?
#19C 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?
#20C 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…
Overcoming goofy shit and gotchas is part of any programming system.