3 ms·
> Every single one of your points ... presupposes that the reader knows what a pointer is and how it works. Pardon my mistake; I made these points under the be
by kazinator 8y ago
> Every single one of your points ... presupposes that the reader knows what a pointer is and how it works.
Pardon my mistake; I made these points under the belief that I'm in a debate about how to teach pointers to a beginner audience, not that I'm addressing that audience itself.
- torstenvl 8y agoDistinction without a difference. If you can't explain to your students why the words out of your mouth are useful, you've already lost them. The fact of the matter is that you're getting hung up on implementation details that do nothing to explain the concept. Pointer arithmetic, how pointers interact with the type system... those are important, but they're completely incidental. There's no fundamental reason C had to implement pointers that way. They're factoids about how pointers work in C, practical mechanics. They tell you nothing about what pointers are in essence: a memory address. And I don't know if you've worked with novice programmers lately, but it seems pretty obvious to me - based on how so many people get their heads discombobulated about pointers - that that conceptual clarity is needed. The details you're listing don't need to be in the first sentence.
- kazinator 8y agoThat C pointers have a type which is used for checking, semantics of memory access and arithmetic falls into a category that I like to call requirements, whereas I use the word implementation detail for something like how many bits are in a pointer, and do pointers to bytes have the same representation as pointers to wider types. (These are also requirements, but ones an implementation can vary.) I accept your terminology, though. Let the key features of C be called "implementation details". Then, if the goal is to teach C, it is "implementation details" we must teach. (In any case, the students are probably eager to learn implementation details in the regular sense also, otherwise they would have been satisfied with their Python or Javascript class.) If what you really mean is that we should teach C by instead teaching the architecture of a machine, whereby C is treated as just a notation for manipulating that machine, and concepts like the type system are considered annoying/distracting details in that notation, then I strongly disagree. Even if it is easier to teach that way, and the students eagerly absorb and regurgitate the simplified misconceptions, they are ill served.
- deleted 8y ago[deleted]
- dang 8y agoPlease stop now.
- deleted 8y ago[deleted]
- dang 8y agoCome on, please don't be a jerk on HN.
- kazinator 8y agoI think this was misunderstood due to not being phrased right; I do not believe, let alone wish to insinuate, that torstenvl is a newbie who doesn't understand pointers. I mean, that doesn't even make sense. Though flagged, it was also upvoted to +2 at one point.
- dang 8y agoI'm sorry if I misread you. The comment sounded like a putdown to me, but it's easy to misread intent, especially when reading quickly, as moderation entails. If I read it the opposite way, I think I can see what you mean—but then it's a subtle enough point that the nuance was likely lost on more readers than just me.