Python has the advantage of being easy to read and write, but other than that it's another complex object-oriented language that might overwhelm the novice with its libraries and language features, all while omitting types. While this is good for rote programming practice, python itself doesn't teach how to think like a computer scientist. The urge to get people into programming without a core understanding of what they're doing is a modern industry-driven approach that just doesn't produce good computer scientists. It's what lead to C++ being used in the first place.
When first learning to program, you learn a language for the concepts behind programming, not to make shitty software. With that in mind, C is the most powerful candidate.
Let's enumerate some of the main benefits.
C Is Small and Extremely Elegant
Unlike its cousin C++, or the overloaded Python, the core C language has a small set of features. C doesn't throw anything crazy at you; it has a small handful of packages, each of which has a solid, clear goal. In-fact, let's list them here.| assert.h | float.h | math.h | stdarg.h | stdlib.h |
| ctype.h | limits.h | setjmp.h | stddef.h | string.h |
| errno.h | locale.h | signal.h | stdio.h | time.h |
This list is from ANSI C, which provided 15 separate packages to perform all reasonable tasks. 15! That's tiny! Most of the library code is well documented, and easily readable by even a novice programmer. By letting a student read over a quick summary of what each library does, the scope of C becomes easy to understand. Unlike large languages like python, or endless wells like C++, the entire scope of C is easy to comprehend. More importantly, since you can see the "bottom" of the language, the scope of the software you build on top of it becomes clear as well.
Understanding this, and then building on top of it teaches the most important compsci skill: abstracting, and doing so gives a new programmer a sense of accomplishment.
C is Close to the Metal, but in a Friendly Way
C reminds the user of an important point, that the computer is a machine, and the language is an abstraction on top of it. Most "intro to C" books give some kind of diagram explaining the layout of memory in the computer. Some even touch on registers. However, a new computer scientist probably wants to learn how a program actually works, and C provides an extremely easy way to illustrate that. Most lines of C map to 1-3 lines of assembly, so disassembly provides a lot of instruction. Interfacing with an operating system is extremely simple, since it's just another function that the user has to import. Most importantly, the cognitive notion that the computer is just a series of memory instructions gives a better understanding of how more advanced topics, like data structures, actually get implemented.One important point you wouldn't get from python is the concept of types. C is an excellent language for this, due to it's weak typing. Basically, types act more like a set of defaults for operations on data than like hard restrictions to what you can do with data. The use of typing gives intuition for understand operations under the hood, but in C it's so easy to cast and reinterpret types that it feels like a dynamically typed language. In language terms, C is basically the equivalent of running around the house in your underwear. Ultimately, you get the felling of freedom, without the drawbacks of losing perspective.
When you choose to learn with a high level language, you don't know what's actually happening. The only logic is the seemingly magical syntax behind it. Nothing you're learning is transferable or general, the only thing starting programming with a high level language does is to get a student familiar with common syntaxes of procedural coding, which is certainly not worth time and effort doting over.
C is the Basis of all Modern OS's, Programming Languages ..well.. Everything!
When you move on to learn about linking, compiling, libraries, operating systems, system calls, and C++, C provides the basis, and the knowledge of those other topics will naturally flow from your C well. Python, PHP, Perl, Ruby, Go, C++, C#, etc... heck, even C is written in C. Languages that aren't written in C, almost always provide a C-interface to work with the wealth of code that's been developed since C's inception.The small size of C, elegance of the standard, and intuitive use is why the foundations of our computing world: Windows, Linux, Unix are almost entirely in C. Embedded systems almost always support C before any other language due to the relative ease of implementing a compiler. Our modern software lives are built on countless libraries written in C. C is ubiquitous because it's widely been considered one of the best languages for a long, long time.
Ultimately, the point of a good introductory programming language isn't just to make a bunch of code, it's to learn the concepts associated with coding. The concepts C teaches enable you to dive into any code-base, language or software concept and, like some kind of natural-born technomancer, piece together an understanding from the ground-up.
When you move onto Java, M-Sochist, Rondo, PhyreScrypt, or whatever language is currently popular, the warm, loving fundamentals of C will always be there cheering you on, and empowering your understanding beyond superficial details.
No comments :
Post a Comment