7 ms·
I never quite understood why people think that teaching beginners programming through languages like Python and C# is a good idea. It's really hard. Think about
by 10098 14y ago
I never quite understood why people think that teaching beginners programming through languages like Python and C# is a good idea. It's really hard. Think about it.
It may seem easy to start writing programs in those languages, but understanding what is actually going on is sort of difficult for someone who has no idea how things work. When you're implementing a linked list or a binary search tree for the first time, it's important to understand how your data structure is laid out in memory, otherwise it's a pointless exercise. Higher-level languages are convenient, but they hide a lot of what is going on, and that, in my opinion, is bad, if you are learning.
I think the best language to start with is C (and not C++, of course). One must understand pointers and bytes and bits and memory management and all that shit that leads to segfaults and many hours of debugging to be a programmer. I would even go as far as to say that one should start with an assembler and not C, but given the immense complexity of contemporary hardware, I understand that such approach is infeasible. However, teaching kids programming with a physical (not emulated), really simple, toy CPU is probably a good idea. Too bad I don't know any such CPUs.
- scott_s 14y agoI would even go as far as to say that one should start with an assembler and not C, but given the immense complexity of contemporary hardware, I understand that such approach is infeasible. Someone could make a similar argument about starting in C. And make similar arguments that you made for the benefits. You have to start teaching somewhere in the stack. I actually disagree that it's infeasible to start with assembly. I don't think it's wise, but it's certainly feasible. I think people tend to have a bias that beginners should start at the same level of abstraction that they did. But I think that in online discussions, we place too much emphasis on where to start. I doubt it matters as much as the other factors, such as motivation of the student and the patience and care of the instructor.
- jodoherty 14y agoWhy not just start with some embedded development then? 8-bit PIC and AVR microcontrollers have very simple instruction sets and can be connected to simple I/O devices like switches and LEDs, but they both use Harvard architectures, so you have different address spaces for code and data. The newer 32-bit PIC micros use a MIPS core, but the development tools aren't very open, despite being based on GCC. The 16-bit MSP430 is fairly simple, has good open-source development tools, cheap development hardware (check out the Launchpad), and a more conventional von-Neumann architecture. Check out some of Michael Kohn's sample code for the msp430 assembler he wrote: http://www.mikekohn.net/micro/naken430asm_msp430_assembler.php http://www.mikekohn.net/micro/naken430asm_msp430_assembler.p...
- 10098 14y agothis is great, thanks
- anthonyb 14y agoThe canonical IT answer applies here: it depends. Learning C is good if you want to learn most of the canonical CS stuff - linked lists, bla, bla, bla. If you want to recommend it to someone who is learning how to program so that they can get their web startup off the ground (where Python or Ruby would be a better fit), or someone who is trying to parse CSV files for work (C# or Python), then you can, politely, fuck off and die. > One must understand pointers and bytes and bits and memory management and all that shit that leads to segfaults and many hours of debugging to be a programmer. No, no really you don't. Perhaps to be some sort of archetypal "Real Programmer", but that's different from learning to program. There are all sorts of other factors at play: motivation, being able to get something working relatively quickly and iterate, being able to show friends/colleagues what you're working on, accessibility of libraries, etc. Disclosure: I wrote a book on how to program in Python: http://manning.com/briggs/ http://manning.com/briggs/
- 10098 14y ago> No, no really you don't. Perhaps to be some sort of archetypal "Real Programmer", So, are you saying that if you asked a candidate during a job interview what malloc is or why inserting things in a linked list is faster that inserting things into an array, and he gave you a blank stare, you'd still hire him?
- smallblacksun 14y ago>what malloc is There is no reason someone who never programmed C would (or should) know what function is used to allocate memory in C.
- 10098 14y agoFair enough, but don't you think they should at least know that memory is a resource that needs to be allocated and deallocated and how come that they never have to deallocate memory themselves when writing in python?
- 14y ago
- hsshah 14y agoIMHO, this is bad advice. It is like saying if you want to teach how to change oil in the car, teach the entire automotive engineering curriculum. Introducing extreme complexity so early in the process turns off people; they give up easily and (falsely, in many cases) start believing that programming is not for them. The first introduction should have enough fundamental programming concepts to enable the students to make something useful and tangible, by themselves. As the interests and the objectives grow, they can delve deeper into the domain. I think with Khan Academy, Udacity and others, we are entering a new paradigm of "Just in time learning". Schools should focus on teaching smart learning techniques, critical thinking etc instead of cramming more and more topics in their curriculums.
- Permit 14y agoI completely agree with this. Nothing is more frustrating as a beginner than getting confused and not even knowing what questions to ask. When you introduce concepts such as addressing/pointers(which are typically in hexadecimal) and memory management you add many more moving parts to the mix. In my opinion, abstracting a lot of this stuff away helps lower the number of opportunities on which a beginner can get caught up.
- fusiongyro 14y agoIs it true? It's easy to spout platitudes about what learners should and should not have to learn and why, but have they been tested? A lot of people who went to my school would have preferred a curriculum based on Python and writing games, but the ones that graduated seem pretty glad they instead endured a curriculum based on C and culminating in compiler writing. I'm happy to live in a post-Alan Kay world, but I think maybe it's time to dust off that sculpture of Dijkstra we keep in storage and move it out into the foyer. Programming is hard; glossing over what makes it hard in the name of doing stuff sooner may or may not help, but as long as we debate it without testing it empirically we're sure to get nowhere.
- hsshah 14y agoThat is indeed a good question. One of the key challenge in reforming education field is the feedback cycle is big. Very time consuming to track experiments. So I have add that what I stated was my hypothesis reinforced with a small dataset of my experience teaching 'Computing & Internet' to middle school kids. I have to clarify that my comment was targeted towards current Udacity (other MOOC) participants who wants to learn programming as a value added skill or hobby. If you want to graduate with CS major and/or want to pick CS as a profession; I do believe you need to have a good understanding on the entire stack. There are no shortcuts to being a good professional and achieving mastery in any field requires committed hard work.
- zedshaw 14y ago> When you're implementing a linked list or a binary search tree for the first time... You're about 30 levels above an actual beginner. You have to think even lower capability, like this: > When you're trying to print "Hello World" you have to know all this hard stuff like how to type "python" into PowerShell, or even just install Python on Windows and fix it's broken PATH settings. That's where you need to be thinking if you're thinking about what a beginner struggles with.
- LinXitoW 14y agoI learned C++ by accident: A friend of my moms had an old programming book laying around and gave it to me. Next thing i know, i'm "wasting" my vacation reading the book from cover to cover. I never actually used C++ though. Not once in my admittedly very short time as a hobby and/or employed web dev have i ever actually needed to know C++ or even memory management. So i don't think it's as important to know as you claim it to be. I'm still very glad i learned C++, though. I think it best equates to learning latin in school: You're probably never going to need it, but it gives you great insight into how languages work on a lower level and where they come from. While this won't help with your vocabulary necessarily, it will help with autodidactic learning. For example, if i didn't know about pointers, it's likely i would never have wondered about how the parameters get passed to a function: By reference or by value.
- danssig 14y agoI disagree completely. I would say everyone should start with Smalltalk. Start with something beautiful and clean and then learn the messy stuff that makes it possible later.
- mover 14y agoWell, I think some kids care about the abstract and fundamental workings of computers, but a lot are initially interested in learning programming because they see cool stuff and want to make it themselves. Teaching them the "just in time" simple concepts that lead to concrete results without making them struggle with syntax to start out is a good way to keep them motivated initially. Then after you hook them, you can start teaching them the fundamental concepts of how stuff works.