|
|
|
|
|
by philbarr
4769 days ago
|
|
I don't mean to do the automatic-HN-criticism bit, but... I reckon I can think of better examples for each of the terms than he/she's come up with there. The two we have are: "A is for Array: a place to store your toys." - then there's a picture of a box with lots of DIFFERENT toys in. Shouldn't they all be toys of the same type? It should be obvious that an array means "more than one of the same thing". "W is for While: While there is food on your plate, you will sit there" - doesn't really describe what WHILE does? The operation should be related to the condition. For example, maybe it should be, "While there is food on your plate, you will keep eating." Not to be too picky over a book for 3 year olds, of course. :) |
|
Not any more "the same thing" than all being toys. C, C++, Java, Ruby, Javascript, PHP all let you stuff references to objects that are entirely different into arrays some way or other, and I'd be quire confident in claiming that the same is true for most languages in common use.
> "W is for While: While there is food on your plate, you will sit there" - doesn't really describe what WHILE does?
It describes exactly what WHILE does. Whether or not there is an operation that changes the condition within the loop is an entirely separate concern from the while construct. Anyone with a child will have experienced situations where the child most definitively will not keep eating, and what changes the condition is that a parent as an outside actor finally takes the food away, for example.