I can understand if one is a) very motivated and b) has the right mindset to properly frame their ideas at the low level c operates at, C could be a good starting language. But this is not the case for many beginners.
The "to some degree agnostic of language" part has been available for a long time in computers, initially as flowcharts and later as pseudocode.
>and b) has the right mindset to properly frame their ideas at the low level c operates at, C could be a good starting language
That requires prior knowledge and practice more than a mindset, IMO.
Over a few years of working as a teaching assistant, I saw two types of students: those that had some prior knowledge and effortlessly picked up the concepts, and first-timers that had to put in serious effort to stay afloat. If you were in the former camp, it's hard to envision how the latter might feel, and why every bit of additional complexity is a menace to someone who's already struggling with frustration over internalizing the basics. If you add too much complexity, the novice becomes discouraged, gives up trying to understand, and simply tries to memorize - this is always catastrophic for them.
As an example, I'm taking about students that write code like:
if(x == true){
y = true
}
else if (x == false){
y = false
}A programmer should definitely eventually learn C, but there's no reason it needs to be their first language and definitely no reason it should be their only language.
They'll only wonder that if the book / course / instructor teaching them C, does NOT explain it to them. Which would be more of a reflection on said book / course / instructor than on the C language or the students.
Second, your point may (or not) be correct, but it is at best tangentially related to the point I was replying to, or to mine.
If the student doesn't have to focus on remembering whether or not you need a semicolon or a colon on switch statement cases, they can focus more on actually grokking the process of translating thoughts and algorithms to code.
Python is great but some of the things I've come across:
Why do some keywords use parenthesis and others don't?
What's this Python 2/3 hubbub all about?
What are __INIT__ and __MAIN__?
Why do I see single, double, and triple quoted strings?
What does the u prefix mean in u"Hello World"?I can agree with this, if not moreso the fact that you also have to learn the underlying system when you learn C.
For example, I 'learned' C from Greg Perry's "C Programming in 12 Easy Lessons". I was 11 or 12 years old at the time, had played around with a few other languages, but I knew C was the language video games were written in, so I wanted to learn C.
Part of the reason I wanted to buy that book was because it came with a compiler, Borland C++ 1.0. The book was also only $29.99 and was at a store in town. You'd be learning how to use functions like fscanf() but they never covered the details of 'when things go wrong'. You're missing some bytes, your file is incorrect, DOS does this while UNIX does that... You learn just enough to get you in trouble.
Sure, one book can't teach you everything, but it wasn't quite enough to give you a real good understanding of how C worked.
http://www.amazon.com/C-Programming-12-Easy-Lessons/dp/06723...
I eventually bought a game programming book and started to learn all the 'hard' stuff that I didn't even dream about when I first started. x86 interrupts, accessing joysticks and sound cards, writing to video memory...
All of this can be solved to a point by dumbing it down and using libraries. You still have to make sure you've got things like pointers down, though. You don't quite have to worry about that stuff with say, QuickBASIC or Turbo Pascal.
The reason I think this is important to point out is that I believe programming knowledge could be more widespread than it is today but unforgiving beginning languages tend to weed out people who aren't as familiar with computers as we are.
In the end people will always choose the tool they're most comfortable with, whether it's the right tool for the job or not. I have no problem with this because, if there are not enough C experts in the team to maintain the project, it would be a good enough reason why a high-level language becomes the "right tool for the job".
I think I agree.
> It's like saying one must learn "nedit/pico" before starting with editors like "emacs/vi".
It's very little like that. Other languages have their own strengths in a way that nedit/pico do not.
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 :-))