# 有没有一些有意义的百分比的学生谁不能学习编程？

Ben I. 10/30/2017. 17 answers, 21.591 views

int answer = -1;
System.out.println("Please enter a number from 1 to 5.");
} 

15 chrylis 10/30/2017

7 Cort Ammon 10/30/2017

17 Ben I.♦ 10/30/2017
@CortAmmon也许你指的是臭名昭着的骆驼有两个驼峰 ，它的部分撤回
7 Andrea Lazzarotto 10/31/2017
“一定是这样吗？”是的。 和数学一样，弹钢琴什么的。 每个人都有不同的智慧。 有些是数学导向的，有些则不是。
14 Ben I.♦ 10/31/2017
@Lynn我同意代码可以更清楚，但它还不是很复杂。 在Java中学习多少课程后，有人不能遵循这个代码片段仍然是合理的，尽管它可能是不完美的？ 20？ 100？ 500？ 万？

Buffy 10/30/2017.

## 成功的故事

28 KRyan 10/31/2017

3 KRyan 10/31/2017
（在这里做一些尽职调查）似乎我读过的论文表明，他们有证据表明，不是每个人都可以学习计划的证据已被撤回，夸大其结论。 However ，你可以在这里看到撤回 - 但仍然不是极大的鼓舞。 这说明收录的论文中的大量数据是真实的，如果对这些数据提出的解释缺乏足够的证据，我们仍然留有一些我们不知道的原因。
2 KRyan 10/31/2017

20 Buffy 10/31/2017

1 Carl Christian 10/31/2017
@Buffy：我爱你的回应。 我现在讲课，我的第一个助教是21年前的工作。 你没有说出一件从个人的经验或从我的父亲那里听不到的东西:)

nova 10/31/2017.

• 放弃“不能得到”的学生
• 不反思教学如何改进，因为失败的人“不会得到”
• 在“不明白”的学生中注意“模式”

8 Ben I.♦ 10/31/2017

1 kubanczyk 10/31/2017

17 Michael0x2a 10/31/2017
@ kubanczyk - 来吧，不要自相矛盾，答案并不是说“科学不行”或任何愚蠢的东西。 相反，这个答案是说，无论预测的价值是什么，教育工作者要做的最好的事情就是帮助所有的学生尽其所能。 所以，既然预测的结果不会（至少不应该）影响你的教学方式，而且由于预测是困难的，为什么还要花费精力去担心呢？

2 nova 11/01/2017

Ben I. 11/01/2017.

1 Buffy 10/30/2017

6 Douwe 10/31/2017

6 J.R. 10/31/2017
+1“布线”。 我没有那么多的数据点（只有20多个），但是我曾经教过“非CS专业的编程入门”，这是我所教过的最具挑战性的课程 - 不是因为材料太硬，而是因为太多学生们很难掌握基本概念。 班上有三组：从第一天开始编程的“自然”; 与“ Hello, World ”一起奋斗的“迷失”，随着课程的进展而更加艰难地挣扎; 和那些一开始就挣扎的“学习者”，但最终还是拐弯了。 （我的学生中只有一个是学习者。）
SGR 11/03/2017

3 SGR 11/03/2017

mamcx 10/30/2017.

2 Ben I.♦ 10/30/2017

5 Mark 10/31/2017

4 mamcx 11/01/2017

3 Graham 11/01/2017

4 Mark 11/01/2017
@mamcx，是的，Pascal是作为教学语言创建的。 Python也是如此。 Basic也是。 所以是徽标。 AppleScript有“任何人都可以编程”作为目标。 维基百科列出了几百种其他语言来教人们编程。 然而，不知何故，人们仍然有困难。 也许这不是问题的语言？

KRyan 10/31/2017.

Ben I.♦ 10/31/2017

Shane 11/07/2017
+1。 非常难过地看到唯一的答案，试图把实际的数据，以教育工作者如此之低。 我不会认为这是一个基于信仰的社区。 可耻:(

Flater 10/31/2017.

## 你需要调查无知。

• 她是否知道一般情况下会用到什么？ （不管为什么它在这个特定的例子中被使用）
• 她是否知道这是一个结束条件？ （不管具体情况是什么）
• 她是否知道这是一个布尔评估？ （不管被评估的是什么）
• 她能否解释评估（评估一个数字是否大于另一个数字），而不是两个评估的综合意图（评估数字是在一个下限和上限之间）

This can be subconscious ，对老师也不是恶意的。

Once she is able to recite the steps, change one thing in the code (eg one of the numbers in the while condition). Repeat the breakpoint guessing game.

If she actively disagrees with what you say the next breakpoint will be; that's a really good thing. This means that she has an opinion about the flow of the code. Ask her to justify her claims. Do not correct her, just get her to clearly express her own thoughts. Find the error in her claims, but don't point it out.
Instead of correcting her, show what the next breakpoint is. Ask her to explain why the outcome is different from what she said. Only explain things once she gives up with explaining, or is clearly saying random things and hoping to get lucky.
As a software developer, I notice every day how often I spend talking to myself about how the code is going to flow. This is a quintessential skill for a programmer. If you're too quick to explain, you're effectively preventing her from trying to think for herself. The idea is that she shouldn't rely on what others say, but rather try to find the answer for herself.

Every person should be able to understand the logical flow of a simple code snippet, given enough repetition of the guessing game. Every human is innately able to distinguish and recognize patterns (even if they can't do it intuitively).

Everyone is capable of learning programming, but different people will have different levels of intuition and will learn things at a different pace .

The only people who actually cannot be taught something, are the people who do not want to be taught something (or do not want to put effort in learning). As long as she wants to understand it, she eventually will.

thesecretmaster♦ 11/06/2017
I really like this answer, thank you for taking the time to write it. I hope to see you around the site more!
Flater 11/06/2017
@thesecretmaster: You're welcome :)

Nile 10/31/2017.

Always try to explain it some other way.

Try it in another language - there are reasons why BASIC and Visual Basic are used as 'beginner languages', although I would look for 'teaching languages' that entrain a better understanding and good coding habits.

I would no more teach someone to program in Java than I would teach them to fly in an F-104.

However, this isn't about syntax and choice of programming language.

There may be some flaw in your logic, or a gap that you're skating over without even realising that there's an unaddressed assumption or assumed knowledge.

There may be some error in your student's understanding - some unstated assumption or 'gap' that she's filled-in incorrectly and internalised - and she might not be aware of it. If that unstated error leads to a dead-end, that's it: game over. The exercise has failed .

It would be entirely unsurprising that she isn't able to elucidate and express the 'blocking' point: you are working to develop this ability formal logic in your student and you are both well aware that it is developing from a very low base.

The question is: can you reframe the exercise in a way that might reroute you both around a problem that neither of you can identify?

That's enough on teaching technique from me. I coach something else entirely unrelated to coding - although I do coach and mentor my fellow-programmers - and you need to discuss this with your professional colleagues in teaching.

Now to address the more general question: are there students who simply cannot be taught to program?

I'm assuming we're discounting students who have a generally-poor intellectual ability, and that this is about intelligent and able people who have some specific cognitive impairment.

Dyslexic people may have difficulty and it isn't just 'they can't read'. They can interpret symbolic information, but layout and formatting are far more important than you realise.

There are people who simply cannot dial a telephone number or retype an eight-character code unless it is broken up into smaller groups - and you will empathise with them if I tell you to type in "1101110111111111101110111111101" on your keypad right now.

What if your code sample is wriggling in front of them, like ones that binary, and they cannot pin down extract the logic from this unusable and illegible text? It doesn't matter that it's perfectly legible and comprehensible to you, or even to ninety-five percent of your students.

Dyslexic people are very good at concealing their impairment, and at working around or under or over it. Often, so good at both these skills that they work out how to read all by themselves, despite the ineffective assistance of their teachers, and are never even aware that they have dyslexia unless they are tested by professionals.

And now they've met source code, which is another reading skill: text that conveys formal logic, and has none of the structure of spoken language. Or at least, not the structures that they have learned in their internalised implementation of reading.

Try the same problem in Python. And discover that there are coders who are fluent in slicing and never, ever, code a loop - not even in those rare cases where it really is the best way to proceed: I wonder why that is?

Be warned, dyslexic people are also very, very good indeed at spatial visualisation and logical abstraction: the mistakes they make as beginners, including the attempts they make to 'bridge' over gaps like unstated assumptions and assumed knowledge, can be incredibly convoluted. This will be especially true of the mistakes or 'blocks' that they cannot elucidate and explain to you!

It is in the nature of dyslexic peoples' unconscious (but highly-developed )strategies for reading (and, say, successfully associating names with faces) that they apply extremely complex abstractions to everyday problems without even knowing.

This isn't about dyslexic students: I'm using them as one example among many, of students who can program - and program very well indeed - but can be surprisingly difficult to teach.

There is, of course, dyscalculalia: a fundamental inability to perform arithmetic. Or so I'm told: I'm still sceptical, and I would classify these rare students as "people that a long line of increasingly-specialised teaching professionals are unable to teach arithmetic".

If it's real, it probably does have an analogy in a fundamental inability to program.

I am reminded that Bertrand Russell's wife, who spoke seven European and oriental languages fluently, and who was regarded by her husband, among others, as his intellectual equal, never understood the operation of canal locks: despite all attempts at explanation, with working models, by the most eminent engineers philosophers and professors of the British Empire.

So yes, you are probably right that some people will never program; and I am completely in agreement with JWZ's assertion that the extended abstraction required to 'get' pointers, rather than merely use them in a pro-forma way, is absent from all but a tiny minority of the human beings alive today.

A final point, and a deeply unpleasant one: you may have inherited the results of bad teaching in the student's past.

Be warned, some people who are labelled 'introverted' have been very, very badly taught and it is a common malpractice in bad teaching for girls to be conditioned, by a sustained campaign of extremely negative feedback, to step back and step out of a challenging problem that they are not 'expected' to be able to solve. They will have internalised this, and they will have been very thoroughly socialised in the skill of diverting themselves - and you - around that. And they will absolutely steer you around the dangerous confrontations inherent in considering the problem to be anything other than their problem, and their fault.

This is less common with boys but it exists: and the higher education institution that you work in is, perhaps, more of a place for people who have been encouraged or permitted to excel than the place where all excellent students can enter and reach their potential.

You may be very fortunate, with this particular student, to have been given an opportunity to undo that; and, whether this is the case or not, I am very pleased to hear that you have both the will and the resources to find out what she can really do.

I think F-104 and Java is a bad comparison... the F-104 set lots of world records for speed and altitude and had a poor safety record... that sounds much more like C.
Faheem Mitha 11/04/2017
"I am reminded that Bertrand Russell's wife". I was curious about this anecdote, which I'd never heard of before. I think it mght be Russell's grandmother, not his wife. I got an hit on Russell's autobiography, which says "She never could understand how locks on rivers worked, although I heard any number of people try to explain it to her". It's possible one of Russell's wives has a similar problem, but it seems more likely you've read a scrambled version of this anecdote, or remembered it incorrectly.
Faheem Mitha 11/04/2017
From context, his grandmother would have been born Lady Frances Anna-Maria Elliot-Murray-Kynynmound, the second wife of Sir John Russell, once British Prime Minister. They lived in Pembroke Lodge.

ctrl-alt-delor 10/31/2017.

# Nature vs Nurture

It seems that nature plays a large role: you can not teach a cat to code (even though they share approximately 90% of our DNA. However most of the variance between humans is probably nurture.

See Carol Dwecks word on growth mindset, for who some learn and some don't. Note that we can have a growth mind set in some subjects, but a fixed mind set in others, “I can't do maths.”, “I can't program.”.

Everyone (that can learn anything) should be able to learn to code at the level of you example. However not everyone will be excellent at it. I have taught a lot of pupils in year7 (UK), they can do this in scratch. Many of them that had good teachers in primary school, can do it when they arrive (see choice of language below).

Therefore help students to get a growth mindset.

# Syntax vs Concept

Is the student struggling with reading the language, or with the underlying concepts? If the student does not know the idea of a loop, or the higher level idea of loop until successful. Then understanding the code will be very hard, it may even rely on discovering the idea.

Therefore ensure that students understand the concepts, before teaching a language. This can be done using «robot teacher/student», or other paper/acting/physical based activities.

# Procedural vs Functional vs …

Are you teaching in the best language? What influenced your choice of language? Is it the best teaching language? vs Is it popular in industry?

Bertrand Myers has claimed in (I think) “A touch of class”. That it is easier and quicker to teach Eiffel then C# and Java and …, than to teach any one of these from the start. Yes he teaches his CS student all of these languages, but starts with Eiffel, as it is easier to learn (yet also more powerful that the others, and the only pure OO language that I have seen. It is also one of the languages where all the new ideas are coming from (see also lisp) ).

In a camel has two humps (an argument for natural ability, I won't go into why this research is not valid here, but there is one thing of relevance), it looks at mutating-assignment, and shows that student that don't get mutating-assignment struggle to program.

Therefore teach mutating-assignment last. Eg functional, but you can do functional in any language.

Is this semi-functional program easier to read?

do {
System.out.println("Please enter a number from 1 to 5.");
myScanner.next();
} while ( myScanner.currentInt() < 1 ||  myScanner.currentInt() > 5 ) 

This code snippet uses «Command query separation», that is every method is ether:

• a command that does something but does not return anything (a procedure), or
• a query that returns something but has no side affects (a function).
kubanczyk 11/07/2017

Ted Delezene 10/30/2017.

I'd like to preface this by stating that I am not an educator, and thus have had no formal training, however I have had experience while working on my undergraduate in computer science helping people to code. Then after I graduated I helped my wife through an informatics degree in which she had to take programming classes, and I found the following article to be very insightful, and actually described the problems my wife was having quite clearly.

Now her goal was to just pass the class, as she had no intentions of moving on to any sort of a programming degree, and I'm sure that contributed somewhat to her continued difficulty with the course, but should never fully got over the first hurdle illustrated by the article (a hurdle, that I submit your student is probably having difficulty with at this time).

The authors of the paper posit that the primary hurdles in computer science are..

1. assignment and sequence
2. recursion / iteration
3. concurrency*

The article (and linked paper ( link here ) indicate that some people have extreme difficulty figuring out operator assignment, and they can't tell you the value of variables a and b after the follow chuck of pseudo code (even after explaining the basics of pseudo code).

int a = 10
int b = 20
a = b 

The test was administered twice; once at the beginning, before any instruction at all, and again after three weeks of class. The striking thing is that there was virtually no movement at all between the groups from the first to second test. Either you had a consistent model in your mind immediately upon first exposure to assignment, the first hurdle in programming – or else you never developed one!

I hate to use a single study / article to say there are people who can't learn to code, rather I like the idea that, armed with this knowledge, educators can better understand where to focus, and maybe develop better techniques to overcome these specific hurdles.

5 Ben I.♦ 10/30/2017
Welcome to Computer Science Educators ! It might be worth noting that the study he is citing was partially retracted, as I described in my answer here .
2 nova 10/31/2017
I really wish Jeff Atwood would post an update / disclaimer on that blog post
1 Michael Kay 11/02/2017
I read that code fragment and saw instantly that the value of (a = b) could only be "false". Wrong! the author was writing in one language, I was reading in another. I think an immense number of these difficulties are actually caused by misunderstanding the notation.
kubanczyk 11/07/2017
The paper sourced in this answer and on CodingHorror blog was retracted by its author .

KriszDev 11/02/2017.

Well I'm not a teacher myself but I can tell about what happens in our programming classes. My class has 32 people in it and we all have to learn coding in C#, a language that basically everyone of us hates. Last year we had the best teacher in the school but he had to go away and we've got one of the worst one. The class is divided into 2 groups with each having 16 people in it. Well truth be told none of us actually wanted to be a professional code but he have to learn it as it's part of the curriculum. So from all 2 groups there are only 4-5 people who is actually interested in it for many reasons. (one wants to make games, other android apps, and the others, including me, as a hobby). Well from what I see in my group (and hear in the other) most kids are not interested in learning coding. Even though they'll need it in their finals they just don't care. When I look around at class I always see around 5-6 people using their phones or sleeping in classes. Well probably because the teacher is not good now all they know is last years things (partially, very partially) and when ti comes to writing anything complex: they just look at each other. And when you ask them why don't you learn if you are concerned about your grades? They would say "because I won't ever use it after school".

Well it's true that my class doesn't really have anything to do with coding, but the system we're in makes us learn them. I sometimes speak with other teachers who teach the kids who are in the ACTUAL class that learn coding and will work as software developers and he says that they aren't interested either . So in my school the kids, who will work as devs, are not interested in it? (that's a 32 people class too) of course there are always a few who wants to learn but in general here it's quite low.

So from what I'd seen and heard you need:

1. first and foremost: they just look at it as an other subject to learn and have grades from. They are simply not interested in it even if that's what they'll be working as. They need will to learn it.
2. Then there is of course the power of a good teacher. My current teacher came into this school 4 years ago and well knows nothing and is really boring. Many times we have to correct his code. The teacher should try to make the classes interesting for everyone also maybe she needs some special methods. Like as OP said some extra sheets to test on and experience.
3. Maybe she doesn't have time to learn or thinks it's not as important as other subjects because it takes more work and time to learn and understand. (for example here we (those who know some more) usually correct other people in the class and explain why that code was wrong.)

And to end this I want to say the same as what that other teachers told me about it: They just don't care about it, they are not interested in it anymore. It's plain boring for them to look at a black console with white letters.

Loren Pechtel 11/02/2017.

(Sorry, too much for a comment) I've had a related experience back in college that I think is relevant. I was a lab assistant, the lab was sometimes used for a computer literacy for seniors class. I could see one fundamental sticking point for nearly a third of the attendees: They couldn't comprehend changing the meaning of a key. The machines were TRS-80s--they don't have a control key. The word processor needed one, thus IIRC the @ key was hijacked for the purpose.

Students either got it or they didn't, the ones that didn't never got it and struggled greatly even with the aspects of the class that didn't involve that. The ones that got it fared much better.

If they didn't understand the remapped key by the end of the second class period neither the teacher nor I had a single success.

I have seen various students that seemed about as clueless when it came to understanding code but I've never been in a position to help them over an extended period of time to see deeper into what's wrong and whether it could be overcome.

Marco Salerno 10/31/2017.

Everybody is a genius. But if you judge a fish by its ability to climb a tree, it will live its whole life believing that it is stupid.

Coding is an art. It isn't a thing for everyone, you need a vocation to be a programmer. The example that you provided, is something really basic, if she can't understand it, maybe she will never do.

There is a possibility that you aren't a good teacher, but you know, programming isn't something that you can discuss, everything has a sense, a logic, if she can't program, try to suggest her to study something different

2 Flater 10/31/2017
I disagree with the notion that a teacher (of X) should be advising a student to not study X (arguments can be made if the student is not their student; but that is not the case here). You mention the possibility that the OP isn't a good teacher; which is exactly why he shouldn't suggest that the student quits the study, he might end up discouraging someone while the fault lies with the OP.
Marco Salerno 10/31/2017
True, that's why i used the word suggest, it's different than saying "you suck"
2 Flater 10/31/2017
That's not really the point. Whether OP phrases it rudely or kindly, it still ends up discouraging the student who may simply have been subjected to a bad teacher in the past.
NRiding 11/01/2017
Or maybe the student is not suited to the vocation, and he's doing the person and society a great favor. As I see it either the student with come to realise that its good advice and adjust their major before it's too late, or they will buckle down and work harder. It's quite possible that the student knows the correct answer, but is afraid that they are wrong so doesn't want to say anything.

NRiding 11/01/2017.

Just cause you can write a few lines of code does not make you a programmer. Just like every student who learns English is not going to write a best selling novel.

Do this child a favor and steer them to a different career path. If they can't determine the function of that code snippet they how are they going to debug a truly complex problem. Do you want this person writing aircraft guidance systems, banking software, or self-driving cars?

1 ItamarG3 11/02/2017
Welcome to Computer Science Educators ! This answer could be much better if you expand and add explanations to it.

Michael Kay 11/02/2017.

Some personal experience. I have a PhD in computer science and have had a very successful 40-year career in software development. But often, when presented with a new concept, I have had great difficulty "getting it". I think the problem happens when you build an incorrect mental model of what is going on.

I think the first time this happened was on first introduction to algebra: with x=3 and y=4, I was convinced xy had to be 34. There's nothing stupid or ignorant about this, and it doesn't mean the pupil will never overcome it: there's just a misunderstanding that has crept in somewhere, and I think it can be very hard for a teacher to discover where that misunderstanding lies, and correct it, because the teacher simply doesn't realise where the faulty step in the reasoning occurs.

Later, when introduced to programming, I remember I found it really hard to understand function calls. I don't know now what the problem was, just that I had great trouble with it. (I also found it hard to grasp that xy was no longer 34, or even 12, it was now completely unrelated to the values of x and y.)

In recent years I've taught a good number of XSLT courses. One of the areas where I find students really struggling is with recursion. The main frustration in teaching this is that you don't know why students are finding it difficult. Sure, it's a very abstract concept but it becomes so second nature that you no longer see the difficulties, and that makes it hard to help the students overcome them.

user3386 11/02/2017.

Probably almost everyone can learn to play basketball, but if you intend to go up against professionals at some point, the taller you are, the better, because they are going to be tall. If you are not going to be a professional, then no problem, just have fun.

This points out the essential question: Why are we educating people?

• So that they can get good jobs. Parents push their kids toward or away from things for this reason. (Mine pushed me away from programming, but I resisted and became a programmer and now teach programming.) It is certainly important for everyone to be able to make a decent living, so this horn of the dilemma cannot be refuted.
• To make well-rounded people. We all need to have some understanding of a very large and rapidly growing number of topics to function well in this world. So this horn cannot be refuted either.

It would be great if students knew early on what they were interested in (as I did) and had the drive to overcome obstacles to get there (as I did), but apparently, mystifyingly, many kids and young adults simply have no idea what they want to do for a living. I don't know where the failure lies for that, but it is the cause of the seeming dilemma that we face. More drive on the part of a student will push them to either eventually succeed, or fail fast. But, like the famous basketball coach said, "You can't teach height", and we can't impart drive.

I agree with everyone who said that it is not a teacher's job to decide what is best for a student - whether they belong in the program or not. Do your best as a teacher and stop worrying about whether it can be done or not. This is the conclusion I came to after 4 years of teaching.

Dan Mills 11/01/2017.

I am not a CS educator, I just do far too much programming in the day job.

A question if I may, what course are you teaching, Programming or Computer Science? I would be disturbed to sign up for a CS course only to have it spend significant time on programming.

From the "Computer Science" title I would expect that actually programming the things would be a very, very small part of such a course (And actually not worth many marks, so why really sweat it). There are far more important things to teach on an introductory computer science course IMO, calculus of sets, complexity, some discrete maths, introductory algorithms, maybe some computer architecture, but programming is not something that it is worth wasting much time on in a CS course.

I don't know if there is anyone who could not be taught to program, but certainly most people can be taught some formal logic and ideas about algorithms. If you can give people the tools to break big problems into manageable chunks that would be counted a win in my view, if you can give them the tools to read specifications with a sufficiently critical eye for ambiguity that would be a HUGE win even if they come out unable to write a line of Java.

2 John Coleman 11/02/2017
"certainly most people can be taught some formal logic and ideas about algorithms." Not in my experience. It is not uncommon to see a student who has learned some of the basics of programming to nevertheless struggle mightily when they get to classes like Discrete Mathematics or Algorithms and Complexity. Introductory CS courses typically concentrate on programming for the same reason that introductory math classes concentrate on basic calculus. It isn't what the major is really about -- but it is an essential prerequisite.

Andres Alvarez 11/02/2017.

I am fairly new to teaching and found some students to simply not understand programming. Computer programming involves problem solving and some memorization and not a lot of kids are into that. Let's face it, computer programming can be a bit tedious and frustrating for a lot of people and so its no wonder why some kids don't choose a career in it. In order to be good at programming you need to have some desire and perseverance.

I find the kids that are good at math are also good at computer science. However these kids also lack a sense of creativity whereas the other kids who don't do so well in CS are more extrovert and excel in reading/writing classes.