3 ms·
Stanford used to teach C as its first programming language. I think that was the right choice, Java is suboptimal and JavaScript is a flat-out mistake. C is op
by tardo99 9y ago
Stanford used to teach C as its first programming language. I think that was the right choice, Java is suboptimal and JavaScript is a flat-out mistake.
C is optimal because it sits at a nice fulcrum point between assembly language (the code the CPU actually executes) and human-readable structured programming.
Java hides important things from the programmer, most notably how memory allocation works, the necessity of managing memory and freeing it at the right time. Java introduces higher-level abstractions such as classes which make programming more complex for a starting programmer without much benefit. Beginning programmers need to learn the simple process of conceptualizing and writing procedural code and adopting basic formalisms such as decomposing complex codepaths into functions for clarity and conciseness.
JavaScript compounds these issues. It makes it essentially impossible to see the actual code running on the CPU to execute a given set of instructions. It introduces functional programming concepts which, while important, are really better used once a programmer has developed more intuition about how CPUs actually process instructions. Its syntax is so fluid that it's difficult for a beginning programmer to understand what is "right" and "wrong" in many cases, because so many different idioms "just work."
I very commonly encounter programmers who have never used C and therefore have next-to-zero intuition about memory allocation and how CPUs actually process instructions. I'm not suggesting engineers should all learn x86 ASM coding, but I do think C provides the best basis for becoming a strong engineer later in life. As a general rule, the strongest engineers I know all have a significant background in C programming somewhere in their education or professional resume.