6 ms·
I think this depends on the student. I do not have a CS degree. I dabbled in Python, but the first programming course that I took was Harvard's CS50 MOOC. I rea
by ArikBe 6y ago
I think this depends on the student. I do not have a CS degree. I dabbled in Python, but the first programming course that I took was Harvard's CS50 MOOC. I really appreciated learning C because it taught me about the underlying system through concepts like memory management. I agree that Python is friendlier, but I feel like C trains a particular mindset. Python may be more suitable for those who want to get off the ground quickly.
- ant6n 6y agoyou learn Python to get the basics: what are variables, what are values, what is control flow, what are functions, what are modules, how does it fit together as code to perform tasks. Worrying about the memory and the underlying machine can come later. The biggest problem with Python as a beginning CS course is that it´s not a great language to learn about types (meaning it's more difficult to learn the cluster of related concepts expression, value, type, variable).
- ryandrake 6y agoI guess I have different thoughts about what the basics are. I would advocate to start with assembly, but I’m biased because I started with assembly. Things like what is memory? What is a register? What is the Program Counter? What (really) is the call stack and how does it work in memory? Fetch-decode-execute? Jumps, conditional branches, loops. Address modes. If you know these things, then you know how the computer actually works, and a lot of the mystery of C is behind you already. Then you can start introducing stuff that’s built on top of it all like types, if statements, pointers... build the building from foundation up, don’t start on the second floor and tell the student not to go downstairs yet.
- lostcolony 6y agoBottom up vs top down. A lot of people benefit from a top down approach, especially those who haven't already decided they want to heavily invest in the subject.
- esoterica 6y agoThat's not a good way to teach someone to code and there's a reason why absolutely no curriculum on the planet does it that way. If you're teaching someone how to operate a car you start by showing them which pedal is the gas and which is the brake, not by explaining to them how a differential works. The pedagogical basics and the lowest level system primitives are not the same thing.
- wrs 6y agoTotally agree you need to learn C before getting too far, but it can make intro programming more challenging than it needs to be. Since this is supposed to be an ML-targeted curriculum it seems like Python is a better start. However, as I said, it’s an eternal debate. At least we have choices!
- opportune 6y agoThe thing about languages like C is that they will teach students to do many things by rote that they aren’t equipped to understand until later. I’m talking about things like includes, using a compiler, << and other facets of basic I/O, defining a main function. Python allows students to hit the ground running much faster. Once they learn the very basics, then it can make sense to introduce something like C, but not require them to temporarily ignore magic incantations with the promise they’ll understand them later.
- znpy 6y agoit's really a big-endian vs little-endian matter, if you think about it. Starting with C means sitting down, thinking hard and taking the time to understand how the basic model of a computer works, along with all the issues and annoiances that come with it. Starting with python really means leaving out the details and just getting into programming and maybe one day you'll wonder ow stuff actually work underneat.
- rhapsodic 6y ago>Starting with C means sitting down, thinking hard and taking the time to understand how the basic model of a computer works, along with all the issues and annoiances that come with it. Then perhaps ASM would be an even better starting point?
- jcranmer 6y agoI TA'd an introductory computer architecture course (basically, start with a MOSFET transistor and end up with "here's how you write malloc/free"), which was students' first introduction to both assembly and C. That experience helps solidify that you really want to students' first experience with programming to be a high-level language. One of the problems with teaching is a phase-ordering problem: what order do you teach the concepts in? As GP notes, C starts you off with a lot of boilerplate that isn't going to become relevant until a month or two down the line. Concepts like functions, libraries, the insanity that is the C preprocessor are distractions when your first challenge is just getting people to understand the mental model of how a procedural program works (i.e., understanding what x = 5 really means!). On top of that, C imposes a mental burden of understanding the stack versus the heap and the relevant memory management concerns. And then you get into C's string handling... I suspect many of the people commenting here are in the class of people for whom programming was obvious and easy, and never struggled with any of the concepts. This class of people will do fine with any language being used to introduce the concepts, because they're not really learning the concepts. Where the language matters most is for those for whom programming is not obvious, and they need help identifying which parts of the material is more fundamental than others. Giving these people a language that is more forgiving of mistakes is going to go a longer way to democratizing CS education than insisting people start by learning how computers really work. That isn't to say that this isn't something that should be taught pretty early on: far from it, I think a computer architecture class should be the second or third class you take on the topic. Delaying the introduction of C until computer architecture means that you can use C as a vehicle to introduce all the other parts about computers that are important, such as 2's complement arithmetic, ASCII, what the stack and heap are, etc.