Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Why does the author insist that to teach each to a beginner he has to teach all of those concepts? Sure, to understand it fully you need to know about those things, but you can definitely get a beginner far enough along without explaining every detail.

Did K&R explain everything about the preprocessor with their "Hello, world!" example? Or the implications of different return codes from main(), what 'return' from a function even means, etc?



> Why does the author insist that to teach each to a beginner he has to teach all of those concepts?

Because you aren't teaching, and it merely becomes rote memorization. After all, what does || really mean? What does it do there? Without explaining it, it's magic. And instead of learning, the student must disassociate || with what it really and merely associate it with each.

On top of this, you'll have those wondering what || is, and bothered that they are using something without understanding it's importance.

> Did K&R explain everything about the preprocessor with their "Hello, world!"

No, but they explained what that line (#include <stdio.h>) did. They didn't just gloss over it. They covered every line, and every element, including the different braces.

So, either you teach what || is, or you ignore it, and that will only make things more difficult later on.


K&R eventually did, even if they didn't at the very beginning. I also don't teach everything right away. But, if I'm going to teach the concept of looping, I'm going to teach the one that's easiest to grasp and fully know. That's a for-loop, not a .each method dispatch.


The concept of a jump is not one you want to ever teach, and I think you've chosen to go into more detail in one list than the other. In terms of "what does it do", both bits of code call "puts elem" on each element of the array. In terms of "what it's actually doing", the .each example is forming a block and passing it to a method, while the for example is a special syntax with its own scope implications. So the complicated parts of the .each version (blocks and method calls) are general concepts used throughout the language, that you would always want to teach to learners sooner or later. Whereas the complicated parts of the for example - the scoping and the for syntax itself - are dead ends that don't help you learn the rest of the language at all.


>The concept of a jump is not one you want to ever teach,

That is again another arbitrary social more invented by a rant written by Dijkstra. Learning that a computer processes code by using jumps is an important concept to learn, and it's actually a useful technique in many languages. Saying someone should never learn them is just stupid.


Perhaps people wouldn't mind jumps so much, if they called them tail calls?




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: