in reply to The Big Test

I'm afraid I have to totally disagree with your premise.

Take the "how to get unique elements from a list" question. How would you do this as a human? If you can't answer that question, then chances are you won't be able to get Perl to do it for you. And even if you do, you probably don't know HOW Perl did it. So sit down, and think about it in human terms -- Perl might afford you a different approach, but at least be able to do the task in real life.

Okay, if I have, say, a shopping list, and I want to see if apples is on it, I look through it for apples. Which is pretty much what the person did with their code. This turns out to be lousy efficiency BECAUSE HUMAN BRAINS AND COMPUTER PROGRAMS ARE NOT THE SAME. We don't have to look through lists of 10,000 when the inefficiency would be obvious, and if we did we'd alphabatize the list, and perform an kind-of-but-not-really-binary search. Are you suggesting _that_ should have been obvious?

You (I, in this case) would go through the list of things and put all like things in respective piles. Then I would take one thing from each pile.

Really? You think this is the way we naturally approach problems?

Perl is revolutionary because it makes a computer language act like humans, not the other way around, but it isn't perfect. We all, with experience, learn to shape problems into programming methods we know how to deal with. I think your post is unfairly critical of new programmers, and somewhat elitist.

Do they not know how to look up a function for themselves?

Quite possibly, they DON'T. So we teach them perldoc. Most of them can then look up syntax after that.

Has the person never used arrays before? Do they not know how array indexing works (that is a HIGH possibility, seeing as how tons of people use @array[$x] when they shouldn't)?

You said it yourself: they may not have used arrays before. They probably DON'T know how array indexing works (particularly perl's syntax). You're dealing with a new programmer, not an idiot. So they'll make mistakes, and they'll learn. The "seeing a pattern" that you find lacking is a learned skill. (learned at different speeds for different people, but learned)

Update:Tilly provided an execellent example of how we do "is a number even" differently than computers above.

Replies are listed 'Best First'.
RE: RE: The Big Test
by japhy (Canon) on Oct 17, 2000 at 19:30 UTC
    I think a human brain works more like a hash than an array or list. Do we associate things in our brains sequentially? I sure don't. That would require a lot of time to remember something early (or late) in life. I think our brains work like hashes of hashes (of hashes...) -- and no, I'm not insane, I'm thinking in terms of Perl, and how a brain would work if it was Perl.

    Hmm, I'm stopping this here and opening a new meditation. See you there in a bit. Look for something like How do our brains work?...

    $_="goto+F.print+chop;\n=yhpaj";F1:eval
      I'm posting in reply to this because this post is more relavent to this thread.

      I think you've outlined the basic problem: You are thinking of your brain and thought processes in Perl terms. New programmers don't KNOW those terms, so they don't view their own mental processes in that framework. When we learn to think in the Perl framework, we become better programmers.

      Thinking in frameworks happens in all sorts of things. Role Players are often heard to describe themselves/movies/most anything in terms of their favorite game.