4 ms·
The 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 abo
by opportune 6y ago
The 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.
- jghn 6y agoThis resonates with me. When I was an undergrad about 25 years ago most intro to programming classes were taught in C. There were a lot of concepts I struggled with at the time that now I find trivial. In retrospect, what I was really struggling with was some of the lower level gnarly bits C exposes to the programmer. While it's good that I know how those things work, I did not need to understand them to just get a basic understanding of strings, data structures, etc. For instance it wasn't that I couldn't grok linked lists, I couldn't grok pointer manipulation at the time. But that still meant my code didn't work.
- jimbob45 6y agoPuts/gets negates the need for includes and >> isn’t in C. Also Python has a horrific main method syntax and duck typing is ultra confusing early on.
- makapuf 6y agoIfmain style main can be omitted for beginners (no syntax for main). Duck typing can be explained easily : we need something that has a food method.
- whjeon 6y agoPersonally, I dislike all the 're-learning' process. However, by 'Python', I had to re-learn quite a few concepts when I touched C ground. Of course, it was a 'A-Ha' moment to put in positive way.
- legerdemain 6y agoYou might say it really "took you on"!
- blackrock 6y agoIn C, you learn to modify a letter to upper or lower case, by finding its ascii number, and adding to it, or subtracting from it, a magic number. In Python, you just use the .lower() or .upper() function. One and done. Move onto your next problem. In C, you hope to not trigger an array-index-out-of-bounds error, resulting in a segmentation fault. Then, not understanding what you did wrong, and then having to fire up the debugger to find your needle in the haystack. Hours later, you’re just like, I just want to modify a string. Why is it so difficult?
- tpoacher 6y agoThis is a silly argument. You have to do the exact same thing in python if you don't want to use a standard method/function. There's nothing stopping you from using a standard function in c either. Your rant should be about bad teaching of bad habits instead
- blackrock 6y agoWhat I’m trying to point out, is that C has a lot of compromised and poor design decisions made, as a programming language. Maybe it was because it was designed in the 1970s, when computers were more primitive. But better alternative languages were designed back then that didn’t have the failings of C. But these designs permeates throughout the language. So eventually errors keep coming up.
- Imnimo 6y agoWhen teaching new students Java, the first step is "type these exact lines character for character, you won't understand what they mean for the next year, but you need to type them at the start of every new program.", which can be a little rough.
- tpoacher 6y agothat's a fault with the teaching method, not the language.
- chii 6y agono it's not. The language _requires_ those incantations, but to explain it all to a beginner requires a lot of time and effort which, to the student, doesn't look like any payoff (until they have internalized it completely, and understands their meaning). It's the same as human learning natural languages - you have specific grammar and rules you _just_ follow, without understanding their etymology or how it evolved to be this way (and their uses).
- tpoacher 6y agoAnd python requires its own boilerplate incantation. One is neither considerably less verbose than the other, nor any less cryptic. Both take exactly two lines. The python incantation simply "feels" simpler to you, because you as a seasoned programmer comprehend the 'intent' behind it as being simpler. But this is more likely to relate to our inability to perceive from a point of ignorance that which we already understand. A good lesson could start by explaining what these do by way of dissection and for the purpose of orientation, without going down the rabbit hole.
- rottc0dd 6y agoYou have to create a class with main method, just to start. And you need to know, what are access specifiers, what are classes and static methods. Of course, you can just ignore them as something you just have to do, but I think buy design OOP is not an additional requirement but starting point in Java. But, it is not like you have to use them, in that case why start with a complex language as a beginner anyway? It will either be too much of details or too much of magic to remember. (Digression : in my beginner days I was using C as a glorified assembly language with control flow redirection only through, (wait for it) goto. Even after grew up to 700 lines. Only while doing a java port I got used to using methods because java does not have goto)