Conflating pointers with arrays: C's biggest mistake? (2009)
My guess is this won&#x27;t be a popular post given the average age of HN participants.<p>There&#x27;s nothing whatsoever wrong with C.  The problem are programmers who grew up completely and utterly disconnected from the machine.<p>I am from that generation that actually did useful things with machine language.  I said &quot;machine language&quot; not &quot;assembler&quot;.  Yes, I am one of those guys who actually programmed IMSAI era machines using toggle switches.  Thankfully not for long.<p>There is no such thing as an &quot;array&quot;.  That&#x27;s a human construct.  All you have is some registers and a pile of memory with addresses to go store and retrieve things from it.  That&#x27;s it.  That is the entire reality of computing.<p>And so, you can choose to be a knowledgeable software developer and be keenly aware of what the words you type on your screen actually do or you can live in ignorance of this and perennially think things are broken.<p>In C you are responsible for understanding that you are not typing magical words that solve all your problems.  You are in charge.  An array, as such, is just the address of the starting point of some bunch of numbers you are storing in a chunk of memory.  Done.  Period.<p>Past that, one can choose to understand and work with this or saddle a language with all kinds of additional code that removes the programmer from the responsibility of knowing what&#x27;s going on at the expense of having to execute TONS of UNNECESSARY code every single time one wants to do anything at all.  An array ceases to be a chunk-o-data and becomes that plus a bunch of other stuff in memory which, in turn, relies on a pile of code that wraps it into something that a programmer can use without much thought given.<p>This is how, for example, coding something like a Genetic Algorithm in Objective-C can be hundreds of times slower than re-coding it in C (or C++), where you actually have to mind what you are doing.<p>To me that&#x27;s just laziness.  Or lack of education.  Or both.  I have never, ever, had any issues with magical things happening in C because, well, I understand what it is and what it is not.  Sure, yeah, I program and have programmed in dozens of languages far more advanced than C, from C++ to APL, LISP, Python, Objective-C and others.  And I have found that C --or the language-- is never the problem, it&#x27;s the programmer that&#x27;s the problem.<p>I wonder how much energy the world wastes because of the overhead of &quot;advanced&quot; languages?  There&#x27;s a real cost to this in time, energy and resources.<p>This reminds me of something completely unrelated to programming.  On a visit to windmills in The Netherlands we noted that there were no safety barriers to the spinning gears within the windmill.  In the US you would likely have lexan shields protecting people and kids from sticking their hands into a gear.  In other parts of the world people are expected to be intelligent and responsible enough to understand the danger, not do stupid things and teach their children the same.  Only one of those is a formula for breeding people who will not do dumb things.<p>Stop trying to fix it.  There&#x27;s nothing wrong with it.  Fix the software developer.