I think it may have helped me that, when I first learned BASIC, I saw/learned it as LET X = X + 1
The version of the Piagets test I have seen requires you to draw in where the water level would be in a half full tilted glass, which I can imagine getting “wrong”, or not too accurate. The angle of the water surface, not so much. Is that really what people, and particularly women, got wrong?
There are times I can’t understand how my husband doesn’t know where we’re going, and he doesn’t understand how I do. I know he navigates by landmarks, and I also know he has, more than once, driven past a turn or an exit because he’s thinking about something other than where he’s going. And no, he’s not just spacing out - if he’s concentrating on traffic, he seems to forget about navigating.
When we’re going some place unfamiliar, I’ll look at maps ahead of time to get a general sense of where we’re going, plus I’ll zoom in or read the turn-by-turn instructions till I feel comfortable. I also tend to carry the directions as a map in my head, even in areas that are more familiar, so I’m comfortable saying “If we turn here, we can avoid the accident ahead and then take Route X.” He is totally amazed, often asking “How do you know that??” I dunno, I just do. Similarly, I can’t fathom that he doesn’t know it himself.
I’m sure it’s a left brain/right brain thing or something similar. What really cracks me up is when he’d be on the road for business or something and he’d call asking me for directions if he’d taken a wrong turn. It doesn’t happen as much now that he has GPS in his car, but I still chuckle about the time I was 800 miles away in my office (pre-mapquest days) and he called for help. I got him where he was going just based on my general knowledge of the area he was visiting.
Unfortunately, our daughter is just like her dad…
That’s me. I am a truly horrible singer, and I know it. It sounds awful to me, too. I’d love to be able to sing - I know I’d really enjoy it - but I just cannot adjust my vocal cords to make the right note. I can “hear” the note I am striving for in my head, but I cannot produce it. I think it’s a physical thing.
I find it surprising that people get confused by the rules of cricket.
I can certainly understand the lambasting of cricket as a stupid pointless pastime, especially when singling out such absurdities as matches that last five days, or spending most of the game standing in a field doing absolutely nothing, but the basic rules of the game are perfectly straightforward.
To be honest, I can’t understand how I can’t understand it either! I’ve tried and I want to get it, but there’s some mental block preventing me from even starting to grasp it. Weird, right? I just hope that there are cricket fans out there who have the same problem with baseball, so I’m not alone.
I’ve always loved “Cricket in a Nutshell; or, Confusion Reigns” – see below.
There are two “sides”. One side is “out” in the field, and the other is “in” (batting).
Each man who’s in the side that’s “in”, goes out, and when he’s out, he comes in, and the next man goes in until he’s out.
When the “in” side are all out, the side that was “out” comes “in”, and the side that’s been “in” goes “out”, and tries to get those who are now coming in – out.
When the tenth wicket falls, there is always one man from the team which is “in”, who is still in, so he is recorded as “not out”.
When both teams have been “in” and “out” (including those two men who were “not out”), both teams come in – but then the really exciting part begins ! It starts again, for the second “innings”.
I love the fact that there is a position called “silly sod off” (or something).
As a non-programmer, the only thing that confuses me in this example is why it is i<=10 rather than i<10. Surely if you only want the program to count up to 10, then it should only increment i by one if i is LESS THAN 10, not LESS THAN OR EQUAL TO 10? Otherwise it would go up to 11. Which is louder, obviously, but not desirable in this instance.
It’s because i doesn’t get incremented until after the stuff gets done. It basically means start with i equal to 1. Do some stuff, then increment i. If i is less than or equal to 10, do the stuff again, then increment i again. If the condition is i<10 the stuff only gets done 9 times.
I still don’t quite get it. The only programming I’ve ever done was Sinclair Spectrum BASIC, but it looks to me like the original code given:
for(int i = 1; i <= 10; i++) {
system.out.Println(i)
}
is more or less equivalent to the old BASIC that I can just about remember:
10 FOR i = 1 to 10
20 PRINT i
30 NEXT i
So if i <= 10, i becomes i + 1.
Or does everything in the brackets get considered in one go, i.e. i has to remain at or below 10 after everything is done, and if it would result in i > 10 then don’t do any of it?
Everything in the brackets does get considered in one go.
It’s more or less equivalent to:
10 i = 1
20 PRINT i
30 i = i + 1
40 if i <= 10 then GOTO 10
(That was your “my way to teach for loops” post).
Yeah, that’s one of the ways I teach it. My “nuclear option” is essentially the “assembly”/“goto” way you did it in your last post
1 set i to 1 (i := 1/ int i = 1)
2 print i
3 set i to one greater than its current value (i = i + 1)
4 if i is less than or equal to 10, start at 1 again (if i <= 10 GOTO 1)
I don’t like doing it that way because I prefer to think of “for” as a construct or function (so to speak), and in my opinion it can make it harder to remember the for syntax itself, but sometimes it’s necessary.
Colophan – most programmers who wanted to execute something ten times would probably do:
for( i = 0; i < 10; i++) {
// stuff
}
But there are two reasons I don’t here:
- Since we’re printing it out, we either have to print out i+1, or watch it count 0-9 (which is undesirable, see 2).
- In my experience, complete non-programmers have issues with starting their counting at zero. I think you’re partially being colored by your knowledge of BASIC.
ETA: Also, I understand that the keyword “to” in basic is inclusive, and that was your confusion. I was just saying that “in most cases” < is used, but you start at zero for that. DougK’s explanation is right, everything in the parenthesis is evaluated “at once”.
I don’t understand why some people on bicycles ride facing traffic. They are worried about not being seen so their solution is to increase their closing speed with traffic? By the time they realize it is time to bail out it is way too late and a head-on collision is a near certainty.
People that don’t understand the difference between anecdotes and data.
This is one I didn’t really understand until I got old enough to drive. If you’re on a bike, you feel more vulnerable to traffic coming up from behind you; but if you’re driving a car, and you come upon a bicyclist, it’s a lot easier to avoid hitting them if they’re going away from you.
People do this? Wow. I’ve never seen it, and as a regular cyclist it would never even occur to me that it might be a good idea!
Take birthdays, for example.
When you are ten years old, you’ve had eleven birthdays.
Nobody ever counts the zero day.
This is an infinite loop if you set i to 1 on each iteration. The proper step 4 would be:
4 if i is less than or equal to 10, go back to step 2 again (if i <= 10 GOTO 2)
Okay, I’ve got one.
what is Up with random Capitalization in sentences. I Mean, usually I will Be online (not Here of Course) and I will encounter Posts by people who seemingly Randomly capitalize Words. And it’s Not Consistent. Sometimes it’s verbs, Nouns, adjectives, Articles. it has the Effect of making you Look batshit Insane. The rules for capitalization are fairly Standard in English, and Even if you don’t know them you’d Look far more intelligent going for the all lowercase e.e. cummings style.
Hitting shift randomly through your typing has got to put a cramp in your typing speed. Why do people do this? These aren’t illiterate people - and capitalization is something we teach in first and second grade (trust me, I’m a former teacher).