News for hackers. Stuff that matters.
Re:Java in College: "You might as well be teaching Chinese t... by stcredzero on Saturday December 20, 2008 @10:16AM (#404559)
I taught Comp Sci 101/102 as a TA at a state university in the US. Yes, there are students who just don't get it. There was one student of mine who seemed to think as if the machine contained some weird little fussy creature, and if you somehow made nice to it in its unusual language, it would decide to like you and do you a favor and run your program correctly.

Seriously. He couldn't comprehend:

    X = X + 1
To be fair, that might seem paradoxical, but I would break it down for him, going step by step with cards and boxes labeled by the variable names. He just couldn't comprehend. He had a hard time with variables. Heck, I think he had a hard time with anything but social interaction. What was disturbing to me, was the amount of energy he devoted to sucking up to me and trying to scam me by mimicking the "Ah-HA!" moment.

Other disturbing observations: many of my fellow grad students didn't get it either. To them, the C compiler was just magic. No understanding of how things were marshaled on the stack or how operations were implemented in machine language. Surprisingly, they were often about as bad as the local community-college students who got employed by a local corporate body-shop.

At one point, one fellow grad student got exasperated at me in a study session and said, "I don't care about the principles, just give me the answer so I can get an A on the test!" She later told me she was just planning to go into management anyhow. (In a way, that was really disappointing. She was one of the few women in the program, and pretty cute.)

Re:Java in College: "You might as well be teaching Chinese t... by jey on Saturday December 20, 2008 @01:25PM (#404678)
one fellow grad student got exasperated at me in a study session and said, "I don't care about the principles, just give me the answer so I can get an A on the test!"

IMO it's a serious bug in the educational system that people are able to pass by following that approach.

Re:Java in College: "You might as well be teaching Chinese t... by jrockway on Sunday December 21, 2008 @01:53PM (#405595)
I think the bug is that finding the right answers is considered important. There is no such thing as a "right answer" unless you can prove it's right. If you don't understand the concepts, you can't know that you got the right answer.

(Then, in "real life", you are really on your own. If you are doing something new and original, you won't know if you are right immediately. You have to convince yourself by applying what you've learned. The answers to test questions, in this case, are completely meaningless. I don't think enough people realize that.)

Re:Java in College: "You might as well be teaching Chinese t... by tlrobinson on Saturday December 20, 2008 @10:55PM (#405156)
I can see how "X = X + 1" could be confusing to someone who has never been exposed to programming before. All your life you're taught in math classes that "=" means the things on both sides are "equal" at all times.

Maybe replacing the "=" with an array while teaching would be helpful. Then once he understands the concept, try to introduce the "=" syntax.

Re:Java in College: "You might as well be teaching Chinese t... by mattmcknight on Sunday December 21, 2008 @10:59AM (#405465)
This is why a certain language used := as the assignment operator and = as the boolean equality operator. It really doesn't make sense as written when compared to all of the maths people have learned up to the point they are introduced to programming. It's where learning about addressable memory and pointers compared to the values stored at those addresses actually made more sense to me than the optimized syntax (at least when I was 12 or so). It also operates backwards in most languages, where the stuff on the right of the equals happens before the stuff on the left. It really should be something that reads as "take the value in box with address x, add one to it, and store the value back in the box with address x" (basically show the student what the assembly language looks like).

I really don't have a problem with people not getting x=x+1, I think it shows someone is actually trying to deeply understand what is going on.

Re:Java in College: "You might as well be teaching Chinese t... by marius on Sunday December 21, 2008 @12:28PM (#405507)
This is one of the advantages of using Scheme as an introductory language: (define x 1) (set! x 2) (let ((x 3)) (1+ x)
Re:Java in College: "You might as well be teaching Chinese t... by ricree on Sunday December 21, 2008 @01:11AM (#405249)
I think that this is one of those areas that would be greatly improved by starting students with assembly. It's fairly easy to grasp what each statement does in a small instruction set like MIPS since there aren't these sorts of preconceived ideas. Then once students have learned assembly, teachers can explain statements such as "X=X+1" unambiguously with the assembly instructions the students are familiar with.
Re:Java in College: "You might as well be teaching Chinese t... by jrockway on Sunday December 21, 2008 @02:01PM (#405608)
I disagree about starting students on assembly. Assembly exposes all the implementation details on how we got computers to work efficiently, and exposes none of the theoretical basis for computation. Obviously you need to know both eventually, but to get started, I think it's a better idea to build on the mathematics students already know.

Say you want to print 2+2. In assembly, you have to put a two in two certain registers, then call add, then call a routine to convert the number 4 to the string "4\0", then find a file descriptor, then signal the OS that you want to make a system call (fwrite), ...

That is not a good way of teaching how computation works. The details in this case are arbitrary and irrelevant; there is no reason a computer has to distinguish between the string "4" and the result of adding 2 and 2.

Re:Java in College: "You might as well be teaching Chinese t... by tlrobinson on Sunday December 21, 2008 @07:09AM (#405399)
Oops, I meant "arrow" not "array", and didn't notice in time to edit.

Can you tell I'm a programmer, not an archer? (actually, I have practiced archery in the past)

Re:Java in College: "You might as well be teaching Chinese t... by stcredzero on Monday December 22, 2008 @01:15AM (#406151)
Actually, I did at one point diagram all of the states of X across time, so it was an array. (There was also iteration in a loop involved.) I think this only confused him even more, though.
Re:Java in College: "You might as well be teaching Chinese t... by michaelneale on Sunday December 21, 2008 @04:03AM (#405328)
Perhaps he could be a functional programmer if X = X + 1 doesn't make sense ;)

I could understand why if a mathematician found it odd - of course in practice they would understand it, but they would probably in their head make the left most X to be X' or somesuch so they could understand what was going on.

When you do a mutation of a variable - there are all sorts of subtle things to understand about the machine underneath that you wouldn't have to if everything was immutable. I guess its easy to forget that in the day to day.

Re:Java in College: "You might as well be teaching Chinese t... by coliveira on Saturday December 20, 2008 @07:34PM (#405003)
Maybe the problem is that programming is taught without a foundation on how computers work. Before I really learned how to program, I spent some time studying basic computer architecture, so I knew what was behind the programming language. Without this knowledge, I find it is really hard to understand what programming is.
Re:Java in College: "You might as well be teaching Chinese t... by stcredzero on Saturday December 20, 2008 @08:53PM (#405070)
For me, I only really got it after I had taken all three courses:

    - Machine Language 
    - Compiler Construction
    - Operating Systems
Just after that, a bunch of lightbulbs started to fire off. I think the NAND to Tetris approach is really great in this regard. It's designed to be the place where it all comes together for a Comp Sci person.

http://video.google.com/videoplay?docid=7654043762021156507

Re:Java in College: "You might as well be teaching Chinese t... by gaius on Sunday December 21, 2008 @12:17PM (#405501)
I once tried to teach programming to someone who called all of his variables x. He genuinely couldn't understand why the machine couldn't just figure out which x he meant. This particular someone was due to replace us (a consulting firm) at the client. Heh, I wonder if they're still in business.
Re:Java in College: "You might as well be teaching Chinese t... by davidmathers on Sunday December 21, 2008 @03:59AM (#405326)
"Seriously. He couldn't comprehend: X = X + 1"

Isn't that really all there is to comprehend, when you get right down to it?

For all the people who don't "get" programming, I think that's exactly what they don't get.

Unless you're teaching functional programming. Then it would be f(x).

Re:Java in College: "You might as well be teaching Chinese t... by pageman on Sunday December 21, 2008 @12:13PM (#405500)
"To them, the C compiler was just magic."

Any sufficiently advanced technology is indistinguishable from magic. - Arthur C. Clarke

it must have been too advanced for them? :)