3 ms·
As a first language, a lot of students face major stumbling blocks when they deal with pointers and manual memory management. It's hard enough learning how to
by linguae 3y ago
As a first language, a lot of students face major stumbling blocks when they deal with pointers and manual memory management. It's hard enough learning how to program for the first time; I remember learning QBASIC as a ten year old from a textbook and online tutorials. Over twenty years later I had experience teaching introductory Python to absolute beginners, and they have to learn how to convert problem statements into code. They have to learn how simple constructs such as loops and functions work. The course would have been much more difficult for my students if I needed to teach them about pointers and manual memory management. I still remember when I first encountered C in high school, and I struggled with segmentation faults due to my inadequate understanding of how pointers worked. It wasn't until my sophomore year of college when I finally understood pointers. It was when I took a computer organization course that used assembly. It was then when I had a better understanding of how memory worked and how C's pointer syntax directly translated to assembly.
I admit that I still have a soft spot for C; once I finally understood pointers I did most of my projects in C; it helped that I had (and still have) a love for systems programming. To this day I can write C in my sleep even though it's been two years since I've last written a significant amount of C. But in grad school I got bit hard by the Lisp and Smalltalk bugs....I went from a big Bell Labs fan to a Xerox PARC fan, and in my professional career I've been largely coding in Python for the past five years since it's now the lingua franca of machine learning.
But I wouldn't recommend C as a first language; I feel it's too much for absolute beginners. I'm torn between Python and Scheme; my feelings right now is that Python is a good introductory language for helping people gain programming experience and allowing students to build interesting things using Python's extensive libraries, while Scheme is an excellent vehicle for teaching how programming languages work at a high level; I have a soft spot for The Structure and Interpretation of Computer Programs (this was the introductory CS textbook at MIT from the 1980s to the late 2000s when MIT switched to Python) and I used it as part of an upper-division course on programming language principles and paradigms at a university where Java is the introductory language.