Answers.Body: <h1>Nature vs Nurture</h1>
  <p>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.</p>
  <p>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.”.</p>
  <p>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).</p>
  <p>Therefore help students to get a growth mindset.</p>
  <h1>Syntax vs Concept</h1>
  <p>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.</p>
  <p>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.</p>
  <h1>Procedural vs Functional vs …</h1>
  <p>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?</p>
  <p>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) ).</p>
  <p>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.</p>
  <p>Therefore teach mutating-assignment last. E.g. functional, but you can do functional in any language.</p>
  <p>Is this semi-functional program easier to read?</p>
  <pre><code>do {
      System.out.println(&quot;Please enter a number from 1 to 5.&quot;);
      myScanner.next();
  } while ( myScanner.currentInt() &lt; 1 ||  myScanner.currentInt() &gt; 5 )
  </code></pre>
  <p>This code snippet uses «Command query separation», that is every method is ether:</p>
  <ul>
  <li>a command that does something but does not return anything (a procedure), or</li>
  <li>a query that returns something but has no side affects (a function).</li>
  </ul>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-11-07T09:45:19.287Z
Answers.Text: [Affects](https://en.wiktionary.org/wiki/affect#Noun)? [Effects](https://en.wiktionary.org/wiki/effect#Noun)?
Answers.UserDisplayName: kubanczyk
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2024-02-03T13:51:58.583Z
Answers.Text: When I first learned Lisp in college I could see why it worked and was so powerful (you can do essentially everything it is possible to do, you'll just have to build the universe yourself), but I thought it would be easier to tackle something more "domain specific" and less free-form, initially. There's a reason Fortran was so successful: it was designed to implement formulas, which is what the users normally did all day. Few people spend their days making new universes. When I learned C in college, I thought, ok, now I can finally learn: *how can such a thing as a computer possibly work?*
Answers.UserDisplayName: Scott Rowe
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-10-31T09:47:36.843Z
Answers.LastActivityDate: 2017-10-31T10:11:25.700Z
Answers.LastEditDate: 2020-06-18T08:36:57.023Z
Answers.UserDisplayName: ctrl-alt-delor
Answers.Body: <p>(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.</p>
  
  <p>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.</p>
  
  <p>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.</p>
  
  <p>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.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2024-02-03T13:23:20.257Z
Answers.Text: It is an insight, a clue. Remapping has to do with treating things symbolically, not in a fixed way. If you see a world of as-if where everything just happens to be a certain way but could easily be different, then it will be easier to think and manipulate programs and data that way. As a snarky, jaded kid who thought everything was arbitrary, wrongly set up, unfair and inflexible, I saw copious opportunities to remap basically everything. Why is Joe so great? If he was 3 inches shorter, then everyone would like Tom better! See? It's one small step to manipulating joe and tom as variables.
Answers.UserDisplayName: Scott Rowe
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-11-02T14:24:52.153Z
Answers.LastActivityDate: 2017-11-02T14:24:52.153Z
Answers.UserDisplayName: Loren Pechtel
Answers.Body: <p>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 <strong>"because I won't ever use it after school".</strong></p>
  
  <p>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 <em>they aren't interested either</em>. 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.</p>
  
  <p>So from what I'd seen and heard you need:</p>
  
  <ol>
  <li>first and foremost: <strong>they just look at it as an other subject to learn</strong> 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.</li>
  <li>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 <strong>his</strong> 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.</li>
  <li>Maybe she <strong>doesn't have time to learn</strong> 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.)</li>
  </ol>
  
  <p>And to end this I want to say the same as what that other teachers told me about it:
  <strong>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.</strong></p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2024-02-03T13:28:19.680Z
Answers.Text: They used to force everyone through all these math classes, now it is programming. What is the objective? Formal Operational thought. You must get that if you are going to have more complex work. Get it somehow: be a team captain, join the Army, just get it. Programming is easier to fit in to the classroom, and more fun than math. Math never made a web page.
Answers.UserDisplayName: Scott Rowe
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-11-02T13:40:38.847Z
Answers.LastActivityDate: 2017-11-02T13:40:38.847Z
Answers.UserDisplayName: KriszDev
Answers.Body: <p>I was a CS student for several years and therefore a programming student for several years. In many different classes/groups that I was in there were always the ones who could program and the ones who just didn't get it. I believe that some people have a knack for some things and some people don't. </p>
  
  <p>Things like music or drawing or math or programming logic/algorithms, etc. I tried to teach some people and no matter what I did they couldn't do even the most basic programs. Of course you can eventually teach people things, some one with a lot of learning and practice can get good at drawing but it's unlikely they'll do it as good as someone who already has a natural knack for it.</p>
  
  <p>It is weird when you can see it all clearly in your head, the loop, the values that $i takes, the calculations, how the array is formed and the other person doesn't get it even when you write it down and show it to them. But this is normal, it's the way we are. Sure this person can make the effort, learn but they will never "get it". They'll always need extra time, resources and testing or they can study CS and focus on other things like I don't know networking, modules, database design, etc.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-11-07T15:37:59.127Z
Answers.LastActivityDate: 2017-11-07T15:37:59.127Z
Answers.UserDisplayName: favosys
Answers.Body: <p>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.  </p>
  
  <p><a href="https://blog.codinghorror.com/separating-programming-sheep-from-non-programming-goats/" rel="nofollow noreferrer">https://blog.codinghorror.com/separating-programming-sheep-from-non-programming-goats/</a></p>
  
  <p>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).  </p>
  
  <blockquote>
    <p>The authors of the paper posit that the primary hurdles in computer science are..</p>
    
    <ol>
    <li>assignment and sequence</li>
    <li>recursion / iteration</li>
    <li>concurrency*</li>
    </ol>
  </blockquote>
  
  <p>The article (and linked paper ( <a href="https://web.archive.org/web/20090401003425/http://www.cs.mdx.ac.uk/research/PhDArea/saeed/" rel="nofollow noreferrer">link here</a> ) 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).</p>
  
  <pre><code> int a = 10
   int b = 20
   a = b
  </code></pre>
  
  <blockquote>
    <p>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!</p>
  </blockquote>
  
  <p>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.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-10-30T22:47:01.583Z
Answers.Text: Welcome to [cseducators.se]!  It might be worth noting that the study he is citing was partially retracted, as I described in my answer [here](https://cseducators.stackexchange.com/a/784/27).
Answers.UserDisplayName: Ben I.
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-10-31T02:47:46.417Z
Answers.Text: I really wish Jeff Atwood would post an update / disclaimer on that blog post
Answers.UserDisplayName: nova
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-11-02T00:38:44.020Z
Answers.Text: 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.
Answers.UserDisplayName: Michael Kay
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-11-07T09:32:43.887Z
Answers.Text: The paper sourced in this answer and on CodingHorror blog [was retracted by its author](http://retractionwatch.com/2014/07/18/the-camel-doesnt-have-two-humps-programming-aptitude-test-canned-for-overzealous-conclusion/).
Answers.UserDisplayName: kubanczyk
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-10-30T22:40:05.930Z
Answers.LastActivityDate: 2017-10-30T22:40:05.930Z
Answers.UserDisplayName: Ted Delezene
Answers.Body: <p>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. </p>
  
  <p>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.</p>
  
  <p>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.)</p>
  
  <p>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.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2024-02-03T13:35:47.860Z
Answers.Text: Yeah, recursion is not an everyday thing in most people's lives. You've learned the forest and can walk around blindfolded but students keep smacking in to trees they can't recognize. What's *different* about programming? Symbolic manipulation. It's not the everyday way of approaching a problem, and some problems cannot be solved without it. Teach that. Math was the 'way' in the past but we need to move on.
Answers.UserDisplayName: Scott Rowe
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-11-02T00:29:48.680Z
Answers.LastActivityDate: 2017-11-02T00:29:48.680Z
Answers.UserDisplayName: Michael Kay
Answers.Body: <p>I think the answer is "yes". </p>
  
  <p>It seems obvious that there is a segment of the population with severe intellectual disabilities, severe learning disabilities, brain damage, cognitive inability to read or do problem-solving, etc., who will be unable to do programming. The real, difficult, question is: What percentage of the population is that? (Or perhaps, as educational leaders with limited time and resources: For what sort of students is it profitable for us to invest resources into their programming education?)</p>
  
  <p>As partial evidence, it seems clear that on the continuum of subject matter, computer science is intellectually demanding in a special way. <a href="https://dl.acm.org/citation.cfm?id=1272879" rel="nofollow noreferrer">Benneden/Caspersen start their 2007 article</a> with the following: </p>
  
  <blockquote>
    <p>It is generally accepted that it is very difficult to learn to
    programming. For example Bergin and Reilly note that
    <em>It is well known in the Computer Science Education (CSE) community that students have difficulty with programming courses and this can
    result in high drop-out and failure rates.</em> (p. 293).</p>
  </blockquote>
  
  <p>Current data show that computer science has the highest dropout rate of any college major. E.g.: <a href="https://www.computerweekly.com/news/252467745/Computer-science-undergraduates-most-likely-to-drop-out" rel="nofollow noreferrer">10% of UK CS student drop out in the first year</a>, with next-highest major at about 7%. (see <a href="https://www.hesa.ac.uk/news/07-03-2019/non-continuation-tables" rel="nofollow noreferrer">HESA data</a>, 2017-2018, Table NC1). Similar discussions are seen in <a href="https://www.irishtimes.com/news/education/concern-over-drop-out-rates-in-computer-science-courses-1.2491751" rel="nofollow noreferrer">Ireland</a> and <a href="http://trinitynews.ie/2016/02/why-are-computer-science-drop-out-rates-so-high/" rel="nofollow noreferrer">Trinity College</a>, etc. Borzovs et. al. in <a href="http://journals.ru.lv/index.php/ETR/article/viewFile/175/680" rel="nofollow noreferrer">Latvia 2015</a> share their motivation for a study this way:</p>
  
  <blockquote>
    <p>In recent years the observed practically stable trend to lose from
    one-third to half of students in the first year of computing studies
    motivated us to explore, whether the world has not found indeed a
    method, how to determine in advance such applicants that have no
    chance to overcome the first study year. On the one hand, the dropout
    students and the teaching staff have wasted their  resources...</p>
  </blockquote>
  
  <p>Benneden/Caspersen show an overall worldwide dropout rate of about 33% from the programs that responded to their survey (about 12%). Interestingly, it's almost impossible to find hard data from U.S. 2-year programs, but I think the following estimate is accurate:</p>
  
  <blockquote>
    <p>A colleague from the ACM Education Council mentioned an internal
    report of community colleges (two-year schools) in the US who were in
    a coalition to improve their retention rates in CS. One school
    reported an average failure rate, over a ten year period, of 90%!</p>
  </blockquote>
  
  <p>Related, on SE Mathematics Educators, we have the question: <a href="https://matheducators.stackexchange.com/questions/11396/what-fraction-of-the-population-is-incapable-of-learning-algebra/">What fraction of the population is incapable of learning algebra?</a> Ben Crowell, looking at demographic and standardized-test scores, has an answer where he estimates around 50%. Separately, I found an overview of research into Piaget's theory of learning stages (Mary Carol Day, <a href="http://www.ascd.org/ASCD/pdf/journals/ed_lead/el_198110_day.pdf" rel="nofollow noreferrer">"Thinking at Piaget's Stage of Formal Operations"</a>, <em>Educational Leadership</em>, October 1981), which found that among those tested, only a similar 50% could ever perform at the terminal "formal operational stage", which would seem highly related to performance in math and computing:</p>
  
  <blockquote>
    <p>Piaget's position has often been used to predict that one who can
    think in a formal operational manner will always do so. However, only
    about 50 percent of those over 12 years of age who are presented with
    tests of formal operations perform in what would be considered a
    formal operational manner. This is true of college-educated adults as
    well as adolescents. In addition, even people who use formal
    operational skills on one task may not use them on another.</p>
  </blockquote>
  
  <p>Anecdotally, when I started teaching CS courses at a community college about 20 years ago, my starting assumption was a passionately-held "no, of course anyone can learn programming!". That particular ship broke and sank on the first day, when I sat with a student after class for an extra 3 hours trying to get him to understand the first lab, until he said, "I just can't get this", and walked off. Now I'm going to believe what that student told me, as I've seen it many, many times in this context. In fact, in some cases I think it's cruel and dispiriting and immoral to continue encouraging some people to pursue CS programs, e.g., after they've failed to pass CS1 for several semesters in a row. My instinct would be to politely challenge those who think otherwise to try and teach CS at a U.S. open-admissions community college for a semester.</p>
  
  <p>I will hold forth that there's a fairly large segment of the population that can never understand the concept of a <em>variable</em> no matter how much or long or how many strategies they use to try. This is similar to the observation by Joel Spolsky, one of the founders of the Stack Exchange network, <a href="https://www.joelonsoftware.com/2006/10/25/the-guerrilla-guide-to-interviewing-version-30/" rel="nofollow noreferrer">who wrote</a>:</p>
  
  <blockquote>
    <p>I’ve come to realize that understanding pointers in C is not a skill,
    it’s an aptitude... <em>For some reason most people seem to be born
    without the part of the brain that understands pointers</em>.</p>
  </blockquote>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-12-23T12:13:51.510Z
Answers.Text: Sorry, but "can't learn" and "difficult to learn" are completely different.
Answers.UserDisplayName: Buffy
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-12-23T18:29:14.213Z
Answers.Text: @Buffy: Re: "can't" vs. "difficult" -- they're not the same, but one is evidence for the other. Especially in the overall context of the rest of my answer.
Answers.UserDisplayName: Daniel R. Collins
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-12-23T19:46:33.707Z
Answers.Text: Actually no. People drop out for a lot of reasons. They fail to learn for a lot of reasons. One is poor teaching. Another is no real desire to learn. Sometimes when a field is advertised in the popular press as having good employment prospects (CS often) people flock to it with no idea about what it is and then drop out when they learn it is hard work. But, desire is the key, not any innate ability or lack of it.
Answers.UserDisplayName: Buffy
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-12-23T19:51:24.547Z
Answers.Text: Hmmm. You down vote my answer for lack of evidence, I see. But I happen to know (and have worked with) some of the people you mention here and they don't come to the same conclusion you do, so your "evidence" is misleading..
Answers.UserDisplayName: Buffy
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-12-23T22:44:02.293Z
Answers.Text: @Buffy: I would be skeptical of that. If you could link to the counter-conclusions by some of those people I think that would be very valuable for all of us.
Answers.UserDisplayName: Daniel R. Collins
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-12-24T12:55:02.630Z
Answers.Text: They have a public presence. You could ask yourself.
Answers.UserDisplayName: Buffy
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-12-24T18:10:07.513Z
Answers.Text: @Buffy: You've made positive claims and the burden of proof for them is on you. You haven't even told us which of the people referenced in my answer you're talking about.
Answers.UserDisplayName: Daniel R. Collins
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2024-02-03T12:42:00.860Z
Answers.Text: Ok, I think the Formal Operations part has to be crucial to the 'answer' . Also Executive Functioning (focus, persistence, winnowing options) and, yeah, desire. All Of The Above. But without Formal Ops, boy, it's going to be tough sledding. We have to teach that *before* college, it's almost too late by then. Thus the "can't learn this" aspect. If you're not a gymnast by age 10, you probably never will be. Programming is kind of like watching yourself think and then manipulating *that*. Few people tend to do it. But enough about me.
Answers.UserDisplayName: Scott Rowe
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-12-23T07:19:19.880Z
Answers.LastActivityDate: 2019-12-24T05:55:02.863Z
Answers.LastEditDate: 2019-12-24T05:55:02.863Z
Answers.UserDisplayName: Daniel R. Collins
Answers.Body: <p>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.</p>
  
  <p>This points out the essential question: <strong>Why are we educating people?</strong></p>
  
  <ul>
  <li><em>So that they can get good jobs.</em> Parents push their kids toward or away from things for this reason. (Mine pushed me <em>away</em> 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.  </li>
  <li><em>To make well-rounded people.</em> 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.</li>
  </ul>
  
  <p>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 <em>no idea</em> 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.</p>
  
  <p>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. <strong>Do your best as a teacher and stop worrying about whether it can be done or not.</strong> This is the conclusion I came to after 4 years of teaching.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2024-02-03T13:31:25.183Z
Answers.Text: But, but... Formal Operations too.
Answers.UserDisplayName: Scott Rowe
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-11-01T15:23:01.627Z
Answers.LastActivityDate: 2017-11-02T12:41:15.757Z
Answers.LastEditDate: 2017-11-02T12:41:15.757Z
Answers.UserDisplayName: user3386
Answers.Body: <p>Many of the existing questions are excellent, but I'll throw my two cents in:</p>
  
  <blockquote>
    <p>Is there some meaningful percentage of students who can't learn to program?</p>
  </blockquote>
  
  <p><strong>What is programming?</strong></p>
  
  <p>The problem is that <strong>programming</strong> can mean many different things. I remember a discussion on this site where somebody suggested using Excel spreadsheets as an introduction to programming. I would have failed that class, and I would have realized that I just wasn't cut out for programming.</p>
  
  <p>Programming with a focus on command line interfaces is a step up from Excel spreadsheets, but it's still alienating and disengaging for many students.</p>
  
  <p><em>"But command line programming is the simplest form of programming!"</em> Command line programming can seem straightforward to more experienced users, and we can see it as the simplest form of programming. But that's not true for people who haven't worked with a command line in their daily lives. <em>"I use websites and apps every day, and I'd love to learn more about creating that stuff, but if programming is just staring at a command line all day then maybe this isn't for me!"</em></p>
  
  <p><strong>Frame Things Differently</strong></p>
  
  <p>So although this student had trouble wrapping their brain around command line programming, maybe they'd have better luck with other types of programming:  maybe they'd be able to better reason about robotics, or code that outputs a physical drawing, or more creative coding? Maybe if the output was a webpage instead of in a terminal, they'd have to spend less time remembering how the terminal works.</p>
  
  <p>In other words, it's not that students can't learn programming. It's that they have trouble reasoning about a particular type of programming. The answer is not that they can't program, the answer is that they need to be introduced to programming using topics that engage them.</p>
  
  <p><strong>Line by Line</strong></p>
  
  <p>Similarly, maybe the student has trouble explaining their thinking to a teacher. <em>"Okay they asked me a question. Oh god. They want to know why the number is initialized outside the loop. How should I know, I didn't write the code! Oh no I'm not saying anything, this is awkward. Maybe if I stay silent they'll give me a hint. Wait what was I supposed to be answering again?"</em></p>
  
  <p>The answer to this is to encourage students to <a href="http://happycoding.io/tutorials/how-to/program" rel="nofollow noreferrer">break things down into smaller pieces</a>. Don't ask the student why the variable is created outside the loop. Ask them what the first line of code does. Then ask them what the second line does. Have them work through it line-by-line, and then have them combine that into a bigger picture. This is a very hard thing to teach, and I think many students get stuck trying to understand entire pieces of code instead of just focusing on one line at a time.</p>
  
  <p><em>"I must not be cut out for programming, because I can't look at 10 lines of code and tell you what they do."</em> Neither can I, and I've been programming for my entire adult life. I look at one line at a time.</p>
  
  <p><strong>Gym Class</strong></p>
  
  <p>When I was in school, I hated gym class. I hated basketball, and I hated running the mile. I'm sure if you would have asked my gym teachers, they would have told you that I'm part of the certain percentage of students who simply can't learn to be physically active. That lasted pretty far into my adult life. <em>"Maybe I'm just lazy."</em></p>
  
  <p>But the thing is, I love hiking. I love just walking around a city. I love riding my bike, and I love running, as long as I can do it with headphones in and at my own pace. I wish I could go back in time and introduce younger me to this stuff. What would gym class have looked like if it had included these types of activities?</p>
  
  <p>Sorry for going off-topic, but I think about that whenever I hear people say that "some people can't learn programming". I don't think it's that some people can't learn programming, I think it's that we often have an overly restrictive definition of what programming is, or how we frame programming.</p>
  
  <p>Programming doesn't take some magic brain part that only certain people have. Whenever I hear the argument that some people can't program (especially when that argument comes from established successful folks), I cringe pretty hard. It always comes off as discouraging (especially to people from under-represented groups) and gate-keeper-y to me. We can do better.</p>
  
  <p>Just like every other creative endeavor, learning how to program requires engagement, and breaking things down into smaller pieces, and tons of practice. Maybe it takes a little more of those things than other subjects (probably as a result of most students not seeing programming until high school or college), but I honestly think anybody can learn how to program. It's "just" a matter of finding out which type of programming they're interested in. But that's a whole other question.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2018-02-23T20:15:33.843Z
Answers.LastActivityDate: 2018-02-23T22:12:48.037Z
Answers.LastEditDate: 2018-02-23T22:12:48.037Z
Answers.UserDisplayName: Kevin Workman
Answers.Body: <p>I'm going to be quite honest.</p>
  
  <p><strong>Why the heck do you care?</strong></p>
  
  <p>Even if there was such a thing, you could never know if that student was truly in that category of unable, or if it just hadn't clicked for them yet. You could never know if you were biased, if the student had never learned how to learn, if something else was going on you didn't know about, if a previous teacher had mistaught them, if, if, if.</p>
  
  <p>Even if there was such a thing, it shouldn't impact your judgement.</p>
  
  <hr>
  
  <p>If a student is struggling, there's a couple of important things:</p>
  
  <ol>
  <li>Do they understand any prerequisites necessary?</li>
  <li>Do they know how to learn?</li>
  <li>Do they remember what they've learned in the past?</li>
  <li>Do they understand what they've learned in the past?</li>
  <li>Do they know how to build up on what they've learned in the past?</li>
  </ol>
  
  <p>By prerequisites I mean primarily math skills. There are plenty of kids in my grade who struggle with basic math facts like 5*9, or order of operations. That inability also damages coding ability. Further, a lot of the logic taught in math comes over to CS/coding. Math practice may be necessary to help give them more confidence.</p>
  
  <p>A lot of students don't know how to learn. Maybe they've had it easy in school. Maybe it's been hard for them all along and they've just checked out. Maybe they've been struggling but don't really know how to do it other than cram for a test.</p>
  
  <p>Teach them how to learn - taking notes, understanding conceptually, understanding practically.</p>
  
  <p>A lot of students, especially in countries where there's a summer break, forget a whole lot over the summer, over the months, etc. Do they even remember what they've learned? I sure as heck couldn't tell you what we talked about a year or two ago. Do they remember what a variable is? Do they remember how loops work?</p>
  
  <p>Even if they remember the concepts, it's even harder to actually understand them, and be able to apply them themselves in their own thinking. Explore what they mean beyond just definitions and coding, but what they mean intuitively. </p>
  
  <p>Lastly, perhaps they know and understand concepts, but they don't know how to build on them. That requires practice and patient teaching, and then a little waiting for that aha! moment when it all clicks and settles into the framework of what they've learned. Help them make connections to other topics. </p>
  
  <hr>
  
  <p>I said earlier in this, "even if there was such a thing". I don't believe there is such a thing. I don't exactly have evidence to back it up. I just have two reasons.</p>
  
  <ol>
  <li>People are amazing. I could tell anecdote after anecdote about someone who would have looked, to teachers, below average - but as a friend I could see that they were way more intelligent than the teachers thought.</li>
  <li>I can't believe that as a matter of principle. If other people might be limited at learning, I might be too. I don't want to think that. I want to believe that with enough hard work, I can learn what I wish to learn. Sure, others might, probably will be, better at it than me. But I believe I can learn it, whatever it may be.</li>
  </ol>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-12-07T13:13:22.880Z
Answers.Text: You are making a huge assumption that this would be used to evaluate students instead of to self-evaluate as a teacher. I would never give up on a student, really for all of the reasons that you just outlined. But part of the emotional life of a teacher is that you *really want* to do a good job. It matters to you. So, when I look at my own numbers, I also need a way to contextualize them. Am I doing a reasonable job, or do I need to go back and rebuild everything from the ground up?
Answers.UserDisplayName: Ben I.
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-12-07T16:14:06.010Z
Answers.Text: I guess I didn't read it the same way @BenI. did. I think the advice is good, and yes, you _can_ be doing a "reasonable" or even excellent job and _still_ need to at least reevaluate everything. Hmmm, what could I have done to reach the three that failed the course??? Maybe nothing, but you need to think about it.
Answers.UserDisplayName: Buffy
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-12-08T13:06:19.900Z
Answers.Text: @BenI. I missed that interpretation ;) I guess I would say that, confronted with a student who was struggling, checking that they know how to learn, know basic math facts, etc, etc, would be an important first step to knowing whether it's your teaching or whether what they learned in the past.
Answers.UserDisplayName: auden
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-12-07T01:58:42.277Z
Answers.LastActivityDate: 2017-12-07T01:58:42.277Z
Answers.UserDisplayName: auden
Answers.Body: <blockquote>
  <p>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.</p>
  <p>Albert Einstein</p>
  </blockquote>
  <p>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.</p>
  <p>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</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-10-31T14:34:54.993Z
Answers.Text: 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.
Answers.UserDisplayName: Flater
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-10-31T14:41:57.947Z
Answers.Text: True, that's why i used the word suggest, it's different than saying "you suck"
Answers.UserDisplayName: Marco Salerno
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-10-31T15:40:45.160Z
Answers.Text: 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.
Answers.UserDisplayName: Flater
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-11-01T17:49:11.513Z
Answers.Text: 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.
Answers.UserDisplayName: NRiding
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-10-31T08:34:46.390Z
Answers.LastActivityDate: 2017-10-31T08:34:46.390Z
Answers.LastEditDate: 2020-06-18T08:36:57.023Z
Answers.UserDisplayName: Marco Salerno
Answers.Body: <p>Yes, absolutely. I'm not an educator myself but I've been a programmer for a long time.</p>
  
  <p>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.</p>
  
  <p>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?</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-11-02T12:42:45.423Z
Answers.Text: Welcome to [cseducators.se]! This answer could be much better if you expand and add explanations to it.
Answers.UserDisplayName: ItamarG3
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-11-01T17:19:05.333Z
Answers.LastActivityDate: 2017-11-01T17:19:05.333Z
Answers.UserDisplayName: NRiding
Answers.Body: <p>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.  </p>
  
  <p>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.  </p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-11-02T12:40:09.503Z
Answers.Text: Welcome to [cseducators.se]! This answer could be much better if you expand and add explanations to it.
Answers.UserDisplayName: ItamarG3
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-11-01T17:28:40.810Z
Answers.LastActivityDate: 2017-11-02T14:47:10.290Z
Answers.LastEditDate: 2017-11-02T14:47:10.290Z
Answers.UserDisplayName: Andres Alvarez
Answers.Body: <p>I am not a CS educator, I just do far too much programming in the day job.</p>
  
  <p>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.</p>
  
  <p>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, <strong>maybe</strong> some computer architecture, but programming is not something that it is worth wasting much time on in a CS course. </p>
  
  <p>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.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-11-02T14:57:06.067Z
Answers.Text: "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.
Answers.UserDisplayName: John Coleman
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-11-01T10:48:11.527Z
Answers.LastActivityDate: 2017-11-01T10:48:11.527Z
Answers.UserDisplayName: Dan Mills
Answers.Body: <p>There are a number of reasons why students <em>don't</em> learn, but few non medical ones why they can't. Leaving aside the medical reasons, such as hormonal imbalance or other disorders, I think that students who don't learn either have little desire to learn or have had poor teaching in the past. Even students with some learning disorders can learn given desire and patient teaching, but it can take a lot of work and understanding of the student to enable it. Once common problem with students is extreme introversion. That can make it difficult for the student to seek help and ask questions. It is good if you can find ways to help students deal with that in a positive way. See <a href="https://cseducators.stackexchange.com/questions/3854/making-technical-presentations-safe-for-novices">this question</a> for more on the idea here.</p>
  <h3>Desire</h3>
  <p>Some students don't learn what you are teaching because they have little desire to learn it and no incentive to put in the work required. They may be in your course for the wrong reasons and would rather be anywhere else if it were only possible. They put in the time, but nothing else. There is probably not a lot you can do for them as that desire needs to be internal. Some students develop desire after a period of indifference, but I don't think this is common. I've had undergraduates in CS who were only in the major because their family (father) would only support them if they stayed. Such students can be counseled to study something more interesting to them if possible, even if it requires doing that in addition to computing. Better, though, if you can counsel the parents to better support their child.</p>
  <p>Some classes are required, of course, and so interest for some will be higher and for some it will be lower. If you know something of the goals of the student you might be able to connect the current class to those goals, increasing interest and desire.</p>
  <h3>Poor Teaching</h3>
  <p>Many students do poorly in CS (as in mathematics) due to poor or indifferent teaching; especially the attitude among some teachers that it is OK to leave some students behind. Not every student takes the same amount of effort to teach and every student learns differently. My usual mantra in this situation is that &quot;Your students are not like you.&quot; They learn differently than you did. Your presence in the classroom as a teach is proof enough that you are a special case.</p>
  <p>Some especially bright kids do poorly in school because they are simply bored and nothing is exciting enough <em>to them</em> to put in the effort. Some students find other subjects especially easy and don't really know what it is like to have to <em>work</em> to learn. Some students don't learn because no one ever taught them <em>how to learn</em>. Some think that hearing something once means they have learned it and are surprised later when they can't recall something, wondering why you never taught it to them. Some students have a fundamental misconception about some small thing that has snowballed into a big block. Some students have never had a positive learning experience (maybe generally and maybe just in some topic) and simply hate everything about the process. Some teacher say incredibly stupid things to students and even some institutions have incredibly stupid ways to deal with students, actively damaging them.</p>
  <p>I have examples in my learning and teaching background of each of these things.</p>
  <p>As a student I was a thought not very bright when I was a kid and was nearly &quot;held back&quot; to repeat an early grade. However, I was just <em>deadly</em> bored with school. No one ever bothered to tell me why I was there or why or how I should try to succeed. Being bored I was a bit of a troublemaker, leading to lack of support from teachers. Later on, I was given an IQ test and the results were reported back to me as &quot;You probably have the skill to succeed in a Junior College, but probably would only be frustrated by a full undergraduate program.&quot; I later earned a PhD, of course, so the assessment was a bit &quot;off&quot;. The first course in which I actually learned anything was in Plane Geometry in HS. I got entranced by the problems there. Prior to that, mathematics was, perhaps, my worst subject. The doctorate is in Mathematics, of course.</p>
  <p>In teaching, I once had a student with two problems. First he was dying of a chronic condition, but also he had been given misinformation about the precedence of operators by some early teacher that was reinforced when he used a too-simple pocket calculator. He couldn't seem to get it right in elementary programming and learned to hate it. He thought he was stupid that he didn't <em>get it</em> and he thought that all of his teachers also thought he was stupid. I think I managed to convince him otherwise before he died but we banged heads a bit before the reason for his difficulties became clear to me. It took a bit longer to convince him that I wasn't actively trying to deceive him.</p>
  <p>I once had a class of students who were almost all doing very poorly. Since my teaching style then was to face them, rather than lecture with my back to them, the diagnosis was pretty simple. No one had ever taught them how to learn in a classroom. They sat passively and listened and watched, taking no action themselves. I asked one why he didn't take notes and he pointed to his head and said &quot;It's all here.&quot; Well, I had evidence otherwise, so had to interrupt the syllabus to actually teach them how to learn and to force them to actually do it. I've discussed part of the method in <a href="https://cseducators.stackexchange.com/a/1168/1293">another answer on this site</a>.</p>
  <h3>Solutions</h3>
  <p>If you want to <a href="https://cseducators.stackexchange.com/questions/1347/how-can-i-convince-my-fellow-cs-teachers-that-reaching-every-student-is-a-worthw">teach every student</a>, however, you need to <em>know every student</em>. If someone is doing poorly, you need to try to understand why that is and to tailor a solution to their needs. To do that you need to be dealing with a reasonable number of students, of course, so if you are a professor of 800 students, the individual care must be given by your army of helpers. But even wit 20 or so students you need help. This is why pairing and group work is so important and why you can't always let students choose their own groups. You need to get feedback from the members of the groups (peer evaluation) and you need to find ways to act on what you learn.</p>
  <p>The solution to teaching every student is not to individually tutor every student, but to find ways that every student can learn what they need to learn <em>on their own terms.</em> Not every student wants to earn first marks. They want to learn &quot;just enough.&quot; They are <em>satisficing</em> rather than <em>optimizing</em>. You can make that work for them too, so that &quot;not earning first marks&quot; doesn't mean &quot;failing.&quot;</p>
  <h2>Success Story</h2>
  <p>I once had two students (compiler course) who were repeating the course after failing it. The classmates of these two were generally among the best I've ever had in one group. But these two had, seemingly, never had a positive experience in CS. They seemed to be dull, requiring repeated explanations of the simplest ideas over and over. Fortunately the course was taught in an incremental way in which the students could accumulate points toward success rather than by demonstrating it on exams: a project course. I convinced them to come to my office hours and there was never a time thereafter that they weren't there. Fortunately the other students didn't require such high maintenance. I also had simple ways for students to ask questions when they were working on their own and so these two could get small helps whenever they needed it. It turned out that these two wound up (a) explaining things correctly to me by the end of the course (b) earning the highest grades that term, and (c) angering the other students who thought I'd put these two in the class to make themselves look bad. My last contact with them was to remind them of what they had done and that they could repeat that elsewhere if they were willing to put in the same amount of work. I think that teamwork also helped here and they supported one another throughout. Note that I didn't need to put additional time into the course for this to happen. The office hours were required and the mailing list for questions was a common feature of all my courses. Another question here seeks ways to make this <a href="https://cseducators.stackexchange.com/questions/3811/answering-student-questions-as-they-work-outside-class">out-of-class communication</a> easy, though I think it needs better answers at this time.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-10-31T03:52:11.780Z
Answers.Text: This is also lacking any kind of evidence. You may *think* “that students who don't learn either have little desire to learn or have had poor teaching in the past,” but can you actually back that statement up with some kind of evidence? I have read evidence contrary to that statement, and while it was far from ironclad proof of any kind, I think this question desperately needs more than generalities and possibly-wishful thinking.
Answers.UserDisplayName: KRyan
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-10-31T04:02:10.447Z
Answers.Text: (Doing some due diligence here.) It seems that the paper I had read suggesting that they had evidence demonstrating that not everyone can learn to program has been retracted for overstating its conclusions. *However*, you can read the retraction [here](http://www.eis.mdx.ac.uk/staffpages/r_bornat/papers/camel_hump_retraction.pdf)—it still isn’t supremely encouraging. It shows that a lot of the data that went into the retracted paper is real, and if the suggested explanations for them lack sufficient evidence, we’re still left with problems we don’t know the causes to.
Answers.UserDisplayName: KRyan
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-10-31T04:03:07.577Z
Answers.Text: In short, once again, I strongly recommend finding actual research and evidence for your claims that the answer to the title question is “no.” You kind of just assert that and then go into all your hypotheses for reasons why students fail despite the lack of a population destined to fail.
Answers.UserDisplayName: KRyan
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-10-31T10:36:22.340Z
Answers.Text: Actually, having taught for about 45 years, my sample is >10K. Every student is an anecdote, of course, but there are a lot of them. Since I also taught at quite a variety of places, I'd guess I've seen most of the range of possibles.
Answers.UserDisplayName: Buffy
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-10-31T22:13:45.047Z
Answers.Text: @Buffy: I loved your response. I lecture now and my first TA job was 21 years ago. You did not say a single thing which is didn't recognize from personal experience or from listening to my father :)
Answers.UserDisplayName: Carl Christian
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-11-03T10:17:07.333Z
Answers.Text: You may be onto something here. There was a girl like that in my CS classes back in the 80's. Her goal was just to get a degree so she could go into teaching. She was in CS because her dad was a prof in the Engineering department, so her classes in that department were free. CS was less math than ChemE, so there she was.
Answers.UserDisplayName: T.E.D.
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-11-05T08:52:38.247Z
Answers.Text: I have to agree with this. One of the reasons I never bothered to futher my education was because I found the stuff we were doing in class to be far below what I was capable of doing at home ("make a simple asteroids game" vs "simulate rigidbody physics", "make a simple 1 operation calculator" vs "write a recursive descent parser").
Answers.UserDisplayName: Pharap
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-11-05T10:19:32.917Z
Answers.Text: This post seems to be 80% about bad teachers. However programming is a *constant, never-ending learning process*. If you want to be successful, you must be able to study and learn new things by yourself without the assistance of a teacher. Having a good one can help, but a good programmer ought to have enough learning aptitude to learn to program from scratch, if need be.
Answers.UserDisplayName: Matti Virkkunen
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-11-07T05:36:58.150Z
Answers.Text: Sure, with tons and tons of work everyone can pass a course. *But if they need that much special attention next semester as well, they haven't learned how to program*. I have a colleague who googles his problem then pastes in whatever code he finds on stack overflow randomly into his code. He kinda gets things working most of the time. This isn't someone who has learned how to program. This is someone who spent a lot of time with his teachers who helped him pass courses. Getting your code to work or passing the course through the application of sheer brute force is not learning how to program.
Answers.UserDisplayName: Shane
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-12-23T18:27:17.353Z
Answers.Text: -1 "few non medical ones why they can't" this hand-waves away, without any evidence, at least two very large levels of reasons why people could not interface with programming. It sounds like you accept that some people clearly cannot learn to program (bounded from below by "hormonal imbalance or other disorders"). The honest question then is really: what is that percentage?
Answers.UserDisplayName: Daniel R. Collins
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-12-20T22:32:45.337Z
Answers.Text: I'm sitting here with 23 years of teaching experience, and yes Buffy is spot on.
Answers.UserDisplayName: Captain Giraffe
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-05-12T12:05:03.540Z
Answers.Text: +1 for "No one had ever taught them how to learn in a classroom." COVID has really not helped with that one, at least in the UK
Answers.UserDisplayName: Dikran Marsupial
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2024-02-04T22:49:44.510Z
Answers.Text: Perhaps your two successful students had learned enough Formal Operations by the end to make a good go of it. Some learn FO before CS courses, some during, some later or mostly, never. We don't want the nevers in the workplace, at least not for anything crucial.
Answers.UserDisplayName: Scott Rowe
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-10-30T19:51:20.307Z
Answers.LastActivityDate: 2017-10-30T19:51:20.307Z
Answers.LastEditDate: 2020-06-18T08:36:57.023Z
Answers.UserDisplayName: Buffy
Answers.Body: <p>Maybe. It's hard to prove a negative. </p>
  
  <p>How does knowing that help educators in any way?</p>
  
  <p>If that knowledge helps somehow, how does that compare to all the ways that belief can be harmful? </p>
  
  <ul>
  <li>Giving up on students who "just won't get it"</li>
  <li>Not reflecting on how teaching can improve, since the ones who failed "just won't get it"</li>
  <li>Noticing "patterns" in the students who "just don't get it"</li>
  </ul>
  
  <p>There have been students who privately I had serious doubts about. Repeated explanations went nowhere. Trace after trace was slow and labored. Then... later... eventually... they figured it out. Next year they passed the class.<br>
   Later, they got a job as a programmer.</p>
  
  <p>I realized that <strong>I just can't know</strong>. Students come back and get it together. If I had shared my judgments it would have completely derailed their success. I can only help each student the best I can. And that includes believing that each and every student is capable of learning programming.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-12-17T03:32:29.613Z
Answers.Text: @Mehrdad Your analogy makes no sense. Intrinsic fuel consumption happens to dwarf passenger count in airplanes but that isn't because of the fundamental logic of the situation, but because of the laws of physics. I think a better analogy would be to stocks: With companies founded at different times there is massive variance in profit growth in an absolute  sense, even if profit growth as a percentage of the previous years profit is the same across all companies.
Answers.UserDisplayName: Retired account
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-12-17T03:32:47.757Z
Answers.Text: @Mehrdad To take the analogy to students, there could be an intrinsic learning rate as a percentage of prior knowledge but given varying backgrounds of students this would be only extremely loosely correlated to absolute growth in knowledge over a given term.
Answers.UserDisplayName: Retired account
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-10-31T03:01:21.237Z
Answers.Text: This is a surprisingly practical answer.
Answers.UserDisplayName: Ben I.
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-10-31T19:16:34.530Z
Answers.Text: This answer says that no matter how many wrong predictions (patterns or others) you try, you can't predict an observable quantity X. Like ever. So basically it says science can't work.
Answers.UserDisplayName: kubanczyk
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-10-31T20:02:11.777Z
Answers.Text: @kubanczyk -- come on, don't be factious, the answer isn't saying "science doesn't work" or anything silly like that. Rather, this answer is saying that regardless of what the predicted value is, the best thing for the educator to do is to help all students to the best of their ability. So, since the predicted outcome doesn't (or at least shouldn't) influence how you teach, and since prediction is difficult, why expend effort worrying about it?
Answers.UserDisplayName: Michael0x2a
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-11-01T18:13:59.043Z
Answers.Text: I think you're being a little too naive here. If person A requires 10x as much work to "get" a topic X as person B in school, then there's a nontrivial chance that that's going to be just as true on the job as it was during school. Meaning that hiring them for that job might be bad both for them and for the employer. You don't expect see this when they're hired because they could (and should) have already spent the 10x time necessary to become as good as everyone else who is applying. But their recognizing this can be useful knowledge for them: they can try doing something they are better at.
Answers.UserDisplayName: user541686
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-11-01T18:16:51.033Z
Answers.Text: So if you're going to take this practical view, you should be asking yourself whether it's better to inform them of this when you think you recognize it, or better not to. Of course I can think of arguments both ways, and I'm not claiming that "do not tell them" is necessarily the worse option. But the point is, it's not about whether *you* will be able to teach them that particular topic or whether *you* should just "give up", but about whether it'd help them in choosing the right path (future career, etc.).
Answers.UserDisplayName: user541686
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-11-01T20:34:04.870Z
Answers.Text: @Mehrad I think you're assuming each person has an intrinsic learning rate for programming topics. I don't think learning science supports that.
Answers.UserDisplayName: nova
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-11-02T13:05:57.790Z
Answers.Text: They might just have trouble to get the basis, since they finally got their degree without doubling all their year, it's seems that what you assume here is not enterely true. If we generalize (and exagerating a little) that, you're basically saying that anyone that made a year of class twice (excluding personal matters and keeping only learnin problem) should just have drop school from where that year. Nova : I guess this is why it's always better to try to explain differently instead of just repeating.
Answers.UserDisplayName: Walfrat
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-11-04T07:04:07.577Z
Answers.Text: @nova I am no educator and have no knowledge of learning science; but my life experience seems to indicate that there are truly stupid people. (More generally, there is a wide spectrum of intelligence, but this discussion centers on the lower end.) Obviously a stimulating and supportive environment can improve intelligence even with young adults, but my layman's idea of the state of research is that there is a limit to environmental influence at that point. That would indicate that yes, there is an intrinsic leaning rate (ceiling). That fits with my personal experience. Do you disagree?
Answers.UserDisplayName: Peter - Reinstate Monica
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-11-06T20:17:38.457Z
Answers.Text: @nova: Oh, OK, please link me to said science? A priori, it would seem absolutely *shocking* for everyone to have the same learning rate for {any given topic} (even on average, if not uniformly). So if you have evidence to the contrary, I'm all ears (er, eyes).
Answers.UserDisplayName: user541686
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-11-07T13:10:23.963Z
Answers.Text: @Mehrdad and Peter The key point is that prior knowledge greatly influences ability to learn. New knowledge is incorporated into existing knowledge structures, which may be more or less receptive to the addition (see: constructivism). Those with well-organized prior knowledge can see patterns others can't, and therefore learn better (see https://www.nap.edu/read/9853/chapter/5#32). I believe there may be differences in "intrinsic learning rate", but I think those are dwarfed by the effect of differences in prior knowledge. By building the right knowledge, we can accelerate learning.
Answers.UserDisplayName: nova
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-11-07T13:37:42.890Z
Answers.Text: @nova: Apply your logic to something more tangible and you'll see it makes no sense. It's like I'm claiming that one airplane can be intrinsically more fuel-efficient than another one, and you're trying to somehow counter it with *"No, the key point is that the number of passengers greatly influences the fuel usage, and those with fewer people use less fuel. [1] [2] [3] I believe there may be differences in "intrinsic fuel consumption", but I think those are dwarfed by the effects of differences in passenger count."* I mean, you can believe what you want, but your argument doesn't support it.
Answers.UserDisplayName: user541686
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-11-07T13:52:24.093Z
Answers.Text: @nova: If we're going to go based on our own beliefs, I know I personally have had lots of trouble learning certain topics (e.g. analog circuits) despite pretty equal background to my peers' and putting in ridiculous amounts of effort as compared to other topics. At some point I figured people really do just have different strengths. Now of course that won't convince you and you'll instead just conclude "oh but you're just 1 sample" (no, I've seen others too) or "oh you were learning it *incorrectly*" (uhm, yeah, sure...) but I hope you realize your personal beliefs aren't any more convincing.
Answers.UserDisplayName: user541686
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2024-02-03T13:05:49.290Z
Answers.Text: If Formal Operations is necessary, and student doesn't have it yet, then BY learning programming they can start to gain it. But it will be harder than for someone who already has some FO. Like learning calculus while also learning English as a second language.
Answers.UserDisplayName: Scott Rowe
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-10-31T03:00:19.020Z
Answers.LastActivityDate: 2018-02-25T12:38:51.927Z
Answers.LastEditDate: 2018-02-25T12:38:51.927Z
Answers.UserDisplayName: nova
Answers.Body: <p>This is all from my own personal experience, no research:  I believe all students can learn to program, and can "get it", barring some mental handicap.  But they have to have the desire, as many have stated - that's the kicker.  And you, the educator, must have the patience to stick with them until they "get it".</p>
  
  <p>I have been a computer science educator for six years at the high school level.  Prior to that I was in software development.  I tell my students they are all climbing a mountain.  I tell them some will reach the top and see into the promised land well before the others.  But, I tell them, if they will work hard, and not give up, they will all eventually reach the peak of that mountain and see over.</p>
  
  <p>And I see that happen.  Some of them reach the peak in Programming I (at my school that is Visual Basic).  Some of them are still struggling toward the peak in Programming II (C#).  And some of them give up before they reach the peak.  They drop the course or don't take Programming II at all.  But those who stay the course, pun intended, almost always develop a deep understanding and love for coding, and I see them in Programming III (AP Java), which is my goal.</p>
  
  <p>For what it's worth, here are some "tactics" that may be useful to others:<br>
  1)  Allow students to turn work in "late".  Yes, those programs were due yesterday, but you kept working and have them ready today?  Good for you, for persevering!  Of course I'll take them.     </p>
  
  <p>2)  Conversely, allow students who are always finished quickly to move ahead in the course or give them "challenge" exercises to complete.  Or send them to a web site like HackerRank where they can practice their code and compete with others.    </p>
  
  <p>3)  Also allow students who are finished quickly to move around the room and help others, if they desire.  But don't force them.  And pay attention that they're not just "dictating code" to others.  Instruct them that they must explain or give direction only.  Some students are really good at this and enjoy it.  (FYI my school is on the block schedule with 90 minute classes.  We are in a lab and when I am not instructing my students are writing code.)   </p>
  
  <p>4)  Preach Carol Dweck's growth mindset.  Effort == success.   </p>
  
  <p>5)  Seat students so that those who are struggling are next to someone who has only <em>slightly</em> better understanding than they do.  They will naturally work together because they are both lost a lot, and the one who understands a little bit more will spend a lot of time explaining to the other, thereby gaining confidence.  The one who has slightly less understanding will also gain confidence because they will realize they are not the only one who doesn't get it instantly.   </p>
  
  <p>6)  Make them write code on paper, both for practice and for tests.  So many students become dependent on their "smart" IDE and don't know their syntax!  </p>
  
  <p>7)  As a corollary to the previous, emphasize the necessity of memorizing syntax.  Whether you understand it or not, you can memorize the syntax of a for loop to iterate through an array.   </p>
  
  <p>8)  Remind them that they didn't learn something they are good at overnight, nor did they do it perfectly the first time.  Programming takes practice, just like anything else.  And sometimes they may have to move ahead without fully understanding what they just did.  As they use it more, one day it will come to them.    </p>
  
  <p>9)  This is similar to someone else's idea about "predicting" in the debugger:  make your students "read" their code to you.  I make mine, periodically and individually, tell me, line by line, what a piece of code THAT THEY WROTE is doing.  If they can't, I tell them to go home and study it and try again tomorrow.   </p>
  
  <p>10)  Structure programming assignments with "levels" of scaffolding.  In your Word document, or web page, or however you give the assignment, give a high-level overview of what the program is supposed to do first.  Students who have understanding will take it and run with it.  Then, after the high-level description, for students who need more, provide a more detailed description with pseudo-code or code snippets.  This will allow more students to be able to do the program and to feel successful.    </p>
  
  <p>11)  Celebrate small victories.  When a student finally gets something, even something simple, get excited.  Encourage them not to give up, and when they don't, when they persevere, and they have a breakthrough, no matter how small, praise them!      </p>
  
  <p>12)  Sometimes you have to have a frank but gentle conversation with a student - if you hate this, and don't want to put in the time necessary to really GET the topic, then why are you here?  I would wager that the girl who didn't understand the while loop after several semesters of instruction was spending little time outside of class studying about what a while loop was, when and why you use it, and practicing coding with it.  She was depending on an instructor to "teach it" to her, to feed her like a baby bird.  She didn't want it badly enough.    </p>
  
  <p>OK, I've said enough, I know a lot of this is anecdotal, but I hope some of it is helpful to someone.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2018-02-25T23:29:35.317Z
Answers.Text: Welcome to CSEducators. You show a sophisticated view of teaching that I hope you will bring back here often.
Answers.UserDisplayName: Buffy
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2018-02-25T23:53:29.773Z
Answers.Text: Agreed. Welcome to our community!
Answers.UserDisplayName: Ben I.
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2018-02-26T00:04:13.540Z
Answers.Text: Thank you, Buffy and Ben, I am excited to be here!  I hope to learn a lot!
Answers.UserDisplayName: Java Jive
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2018-02-26T02:11:36.680Z
Answers.Text: Now this is the kind of answers we need on this site. And six years of teaching might not qualify as "research" in you lexicon, but most research is based on experiential data, whether it's acknowledged or not. Along with Buffy and Ben, I'm glad to see another thoughtful voice in on our site. __Welcome__
Answers.UserDisplayName: Gypsy Spellweaver
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2018-02-25T23:17:39.367Z
Answers.LastActivityDate: 2018-02-25T23:17:39.367Z
Answers.UserDisplayName: Java Jive
Answers.Body: <p>Always try to explain it some other way.</p>
  
  <p>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.</p>
  
  <p>I would no more teach someone to program in Java than I would teach them to fly in an F-104.</p>
  
  <p>However, this isn't about syntax and choice of programming language.</p>
  
  <p>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.</p>
  
  <p>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. <strong>The exercise has failed</strong>. </p>
  
  <p>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.</p>
  
  <p>The question is: can you <strong>reframe the exercise</strong> in a way that might reroute you both around a problem that neither of you can identify?</p>
  
  <p>That's enough on teaching <em>technique</em> 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.</p>
  
  <p>Now to address the more general question: are there students who simply cannot be taught to program?</p>
  
  <p>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.</p>
  
  <p>Dyslexic people may have difficulty and it isn't just 'they can't read'. They <strong>can</strong> interpret symbolic  information, but layout and formatting are far more important than you realise. </p>
  
  <p>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. </p>
  
  <p>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.</p>
  
  <p>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.</p>
  
  <p>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.</p>
  
  <p>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?</p>
  
  <p>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!</p>
  
  <p>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.</p>
  
  <p>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.</p>
  
  <p>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". </p>
  
  <p>If it's real, it probably does have an analogy in a fundamental inability to program.</p>
  
  <p>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.</p>
  
  <p>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.</p>
  
  <p>A final point, and a deeply unpleasant one: you may have inherited the results of bad teaching in the student's past.</p>
  
  <p>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.</p>
  
  <p>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. </p>
  
  <p>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.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-11-01T18:40:37.837Z
Answers.Text: 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.
Answers.UserDisplayName: user541686
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-11-04T11:11:53.207Z
Answers.Text: "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.
Answers.UserDisplayName: Faheem Mitha
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-11-04T11:18:03.270Z
Answers.Text: 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.
Answers.UserDisplayName: Faheem Mitha
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2024-02-03T13:43:43.917Z
Answers.Text: Locks: walk to where there is a small stream with a little pond in it. Block the upper end, observe, unblock. Block the lower end, observe, unblock. Done. Teaching is about pointing the nose in the right direction and getting out of the way. Sometimes it just takes a bit more time and effort to get to the right place.
Answers.UserDisplayName: Scott Rowe
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-10-31T13:34:01.733Z
Answers.LastActivityDate: 2017-10-31T13:34:01.733Z
Answers.UserDisplayName: Nile
Answers.Body: <p>As I indicated in the question, it has been my experience that there are certain kids who never seem to come along.  My data is drawn from a rather small group (definitely under 1000 kids learning CS over the course of my career), and @Buffy's idea that these students are <em>satisfying</em> rather than <em>optimizing</em> may well be correct.  However, I haven't seen convincing evidence of that.  What evidence I do have, unscientific though it may be, is that there are, indeed, students whose brains are simply not wired for this field.</p>
  
  <p>It always appears to be the case that, with enormous effort, they can obtain some very basic competencies, but the material does not fit "naturally" into their way of thinking, in much the same way as not everyone can feel certain aspects of musicality.  (See <a href="https://www.washingtonpost.com/news/to-your-health/wp/2014/11/12/why-some-people-just-cant-dance-or-clap-to-the-beat/?utm_term=.8579364c9e82" rel="noreferrer">beat deafness</a> and the 4% of humanity with <a href="http://www.abc.net.au/radionational/programs/allinthemind/definitely-tone-deaf/8307996" rel="noreferrer">congenital amusia</a>.)</p>
  
  <p>It is important to note that I am <em>not</em> suggesting that people with such musical disabilities can learn nothing of music; rather, I am suggesting that  <strong>a very high level of musicality (such as that associated with the professional musician) may never be realistically attainable</strong>.  It is also worth noting that 4% is not a terribly low number; over the course of a teaching career, one would encounter many students with such handicaps to overcome.</p>
  
  <p>Programming requires substantial sequencing ability, a certain intuitive capability to informally understand (and guarantee) post-conditions, and the ability to simultaneously understand multiple layers of abstraction.</p>
  
  <p>Within the normal distributions of abilities, therefore, it stands to reason that there will be a (not insubstantial) subset of people who will have enormous difficulties with the topic.  And, similar to music, it may not be that they are incapable of learning any particular aspect of programming, but they may never really be able to pull it all together with any sort of facility, no matter how hard they work.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-10-30T20:46:18.517Z
Answers.Text: I'll admit that some have "enormous difficulties". But that isn't the same thing as "can't learn". Ask Stephen Hawking about difficulties. I'll also admit I have no ability in music. But I have no desire, either.
Answers.UserDisplayName: Buffy
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-10-31T15:26:16.237Z
Answers.Text: My experience as a dev (mainly teaching interns/juniors, but also as a quest teacher at our local uni) is that you hit the nail right on the head. The comparison with musical ability is spot on in my view. I tend to give these students the same tough love my guitar teacher gave me: If you like it, by all means continue, but I would look elsewhere for a career if I where you. Maybe they will learn 'eventually'  and with 'enormous difficulties' but the student you described in your question will never get hired here, as we value 'learning speed' over actual knowledge.
Answers.UserDisplayName: Douwe
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-10-31T20:42:02.287Z
Answers.Text: +1 for "wiring". I don't have so many data points (only ~20), but I once taught "Intro to Programming for non-CS Majors", easily the most challenging course I ever taught – not because the material was hard, but because so many students found it hard to grasp basic concepts. There were three groups in the class: the "naturals," who programmed with ease from Day 1; the "lost," who struggled with *Hello, World* and struggled even more mightily as the course progressed; and the "learners," who struggled at first but eventually turned a corner. (Only one of my students that term was a learner.)
Answers.UserDisplayName: J.R.
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-11-03T11:39:05.447Z
Answers.Text: I can speak to the combination of desire to learn and inability to do so. I cannot hold a tune. In fact, at most, I can only tell that one note is higher or lower than another, no more than that. Yet I still played Clarinet for years. My only reference for whether the note was actually in tune is if someone else told me, I simply had no ability to tell myself. I tried so hard to learn, but I am seemingly fundamentally incapable of hearing if a note is in or out of tune and what the note is or isn't.
Answers.UserDisplayName: SGR
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-11-03T11:39:52.303Z
Answers.Text: I had all the mechanics of playing an instrument down, I just had no way of knowing if what I was playing was actually in the correct pitch. In a similar fashion, I can see a student who understands all the parts to a program but can't make sense of the program as a whole in their mind.
Answers.UserDisplayName: SGR
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-05-12T11:59:58.107Z
Answers.Text: Playing a musical instrument is the analogy I would make.  Programming is pretty natural to me, even without the need for regular practice.  I wish playing the guitar (well, baroque lute these days) were the same.  The hours I have put into practice and I am still useless!  I can play, but I will never play well (I used to say "I play with a guitar" rather than "I play guitar" ;o)
Answers.UserDisplayName: Dikran Marsupial
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-10-30T20:40:41.677Z
Answers.LastActivityDate: 2017-11-01T10:28:56.253Z
Answers.LastEditDate: 2017-11-01T10:28:56.253Z
Answers.UserDisplayName: Ben I.
Answers.Body: <blockquote>
    <p>However, every year, I find a small number of students who just don't seem to get it. They get through, but the CS major program becomes harder and harder for them as their four years go by. Must it be this way?</p>
  </blockquote>
  
  <p>Think of it this way:</p>
  
  <p>An alien lands on Earth. He sees a human, who encounters another human. The first human flips the second one off. In response, the second one flips the first one off.<br>
  The alien goes on to meet world leaders, scientists, philosophers, ... Every time he meets someone, he flips them off. After flipping them off, the alien's behavior is perfect, he makes no other mistakes. <strong>No one corrects the alien</strong>, because they understand that he's culturally unaware of its meaning and they understand that the alien is trying to say hello. Since the alien is capable of being friendly, no one is really incentivized to address that one mistake that the alien makes. It seems like nitpicking.</p>
  
  <p>After the alien has met with diplomats (and diplomatically minded people), he eventually ends up in situations where there is less goodwill towards the alien's cultural obliviousness. The alien starts noticing that people are reacting less friendly towards him, even though he's still trying to use human greetings.<br>
  As time goes on, the alien struggles more and more to keep interactions with humans on a friendly level. After several years, he finally fails and ends up in a fight with an angry human.</p>
  
  <p>The inept student, just like the alien, was initially in a position where little to no mistakes could be made (first year only uses simple examples, the alien only meets diplomatically minded people). The flaws of the student/alien are not big enough to fail a test/conversation.<br>
  But as the student/alien progresses through the ranks, it gets harder (harder examples, less diplomatic people). Eventually, there comes abreaking point where the mistakes of the student/alien are important enough that they <strong>do</strong> prevent a good outcome, and this is where the student/alien fails for the first time, <strong>even though they were making the same mistake all along</strong>.</p>
  
  <p>As a student, it's a curse to only be <em>somewhat</em> inept. If you're completely inept, then teachers will focus on you and will make sure that you do it right. But if you're stuck in the "not good but good enough" zone, then you may never receive that attention from your teacher (because they're focusing on students with bigger problems), and you'll never be told that what you're doing is wrong.  </p>
  
  <p>When no one tells you that what you are doing is wrong, then you can't know that what you're doing is wrong (or could be improved).</p>
  
  <hr>
  
  <blockquote>
    <p>Is there any evidence or reason to believe that there are students who genuinely can't learn to program?</p>
  </blockquote>
  
  <p>Yes and no.</p>
  
  <p>Everyone is <strong>capable</strong> of learning programming, but different people will have different levels of <strong>intuition</strong> and will <strong>learn things at a different pace</strong>.</p>
  
  <hr>
  
  <h2>Yes</h2>
  
  <p>In college, I studied Digital Arts and Entertainment. This course was unique in the world (at the time), because it was both a full-fledged course for artistic design (concept art, freehand drawing, 3D modeling) but also technical game development (programming, ranging into complex geometrical mathematics).</p>
  
  <p>There were two very clear groups in our class: the artists and the analysts (I was in the latter group). The artists passed the art classes without breaking a sweat, but needed to learn programming step by step and never seemed to really intuitively understand something (e.g. int division) without having it intricately explained time and time again.</p>
  
  <p>The analysts, on the other hand, were passing the programming classes with flying colors, but often couldn't manage to design or draw anything halfway decent, especially compared to the artists. They would have to redo freehand perspective drawings many times over, whereas the artists managed to get it right the first time and then had a lot of time left to improve their already succesful drawing (thus creating even more of a gap between the art that the artists and the analysts produced).</p>
  
  <p>This course irrefutably proved to me that some people are wired differently than others. It was so very obvious to see it happen for every class we took. The people who were outclassing me in art class would need my help in programming class, and vice versa.</p>
  
  <p>Out of the 300 students who started the course in my year (I'm already omitting those who gave up midway. 300 students took the final exams of the first year), <strong>8</strong> managed to pass all classes. Almost everyone else got caught up on either the art or the programming.</p>
  
  <p>This was my second time in college, and I have to admit that the % of driven students was much higher than in other courses. There were &lt;10% slackers, most people were spending their nights designing (either games or art, whichever held their fancy).</p>
  
  <p>Seeing less than 3% of students pass both art and programming classes proves the point.</p>
  
  <hr>
  
  <h2>No</h2>
  
  <p>But then again, 8 students managed to pass. </p>
  
  <p>I personally knew 3 of them. One had not programmed before the course, the other two had never been artistically inclined. So it's <em>possible</em> to learn a skill, even if it's almost completely orthogonal to your current skillset.</p>
  
  <p>I'm also a strong believer in the fact that if someone does not understand something; that it simply hasn't been explained to them in a way that makes sense to them (or they haven't been driven enough to find out for themselves).</p>
  
  <hr>
  
  <h2>You need to investigate the ignorance.</h2>
  
  <p>For your current example, this does mean that we should investigate what exactly she wasn't understanding.</p>
  
  <blockquote>
    <p>She couldn't identify the ending condition of the loop</p>
  </blockquote>
  
  <p>There's a "spectrum" of ignorance here. It's important to figure out which one applies to this student:</p>
  
  <ul>
  <li>Was she aware of what a <code>while</code> is used for in general? (regardless of why it was being used in this particular example)</li>
  <li>Was she aware that it is an ending condition? (regardless of what the specific condition itself was)</li>
  <li>Was she aware that this was a boolean evaluation? (regardless of what was being evaluated)</li>
  <li>Could she explain the evaluations (evaluating if a number is bigger than another number) but not the combined intention of both evaluations (evaluating that the number was between a lower and upper bound)</li>
  </ul>
  
  <p>Based on which of these describes her situation (or something I didn't list), you can work towards filling in the gaps in her knowledge.</p>
  
  <p>To use my college example, if she has an artist's mindset, she may never be able to <em>intuititively</em> understand code and read it like a second language, but given enough effort, she should be able to eventually identify what happens.</p>
  
  <hr>
  
  <p><strong>Without making this a personal attack on you</strong>, I think it's important to consider that when a teacher considers a student incapable of something, that this could also mean that the teacher is <em>incapable of teaching it</em>.<br>
  As the teacher, you can never be sure which one it is.</p>
  
  <p>This is a variation on the <a href="https://en.wikipedia.org/wiki/Dunning%E2%80%93Kruger_effect" rel="noreferrer">Dunning Kruger effect</a>. If you apply the principles of the effect, that means that it's possible that a teacher's evaluation of a student's incapability to learn something may simply be a misinterpretation. The teacher doesn't know how to teach this student effectively, and therefore considers the student flawed, instead of their own teaching ability. </p>
  
  <p><strong>This can be subconscious</strong> and is in no way malevolent on the teacher's part.</p>
  
  <hr>
  
  <p>From my experience with teaching programming (and being taught programming), the most effective way to gauge student skills and also teach them how to read code is to play the <strong>breakpoint guessing game</strong>.</p>
  
  <p>In essence, put some breakpoints in the code (this can be on every line if you want), start the program, and have the students try to <strong>predict</strong> what the next breakpoint will be.<br>
  <em>Note: this is very easily gamified. People love betting, so allowing them to bet on the outcome teaches them to figure out what the outcome is.</em></p>
  
  <p>For a student who is vastly underskilled and not getting it (as you suspect this student is), you'd expect an inability to make any reasonable prediction, or continuously stating that the next step cannot be predicted.</p>
  
  <p>Step through the whole program. Keep repeating the <strong>same</strong> code over and over again, until she makes accurate predictions (<strong>even if</strong> she's only reciting it from memory rather than understanding).  </p>
  
  <p>Once she is able to recite the steps, change <strong>one</strong> thing in the code (e.g. one of the numbers in the while condition). Repeat the breakpoint guessing game. </p>
  
  <p>If she actively <strong>disagrees</strong> 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.<br>
  Instead of correcting her, <strong>show</strong> 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.<br>
  As a software developer, I notice every day how often I spend <em>talking to myself</em> about how the code is going to flow. This is a <strong>quintessential</strong> 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.</p>
  
  <p>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).</p>
  
  <p>Everyone is <strong>capable</strong> of learning programming, but different people will have different levels of <strong>intuition</strong> and will <strong>learn things at a different pace</strong>.</p>
  
  <p>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 <strong>wants</strong> to understand it, she eventually will.</p>
  
  <hr>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-11-06T01:52:16.580Z
Answers.Text: I really like this answer, thank you for taking the time to write it. I hope to see you around the site more!
Answers.UserDisplayName: thesecretmaster
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-11-06T08:46:38.473Z
Answers.Text: @thesecretmaster: You're welcome :)
Answers.UserDisplayName: Flater
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-01-02T22:50:04.407Z
Answers.Text: Learning by prediction/observation gets my +1. A hugely transferrable skill
Answers.UserDisplayName: D. Ben Knoble
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-10-31T11:38:39.573Z
Answers.LastActivityDate: 2017-10-31T12:07:19.797Z
Answers.LastEditDate: 2017-10-31T12:07:19.797Z
Answers.UserDisplayName: Flater
Answers.Body: <p>Consider the posibility that this could be a problem with <em>Java</em>. </p>
  
  <p>If your first language is APL, and many fail... is a reflect of the students or APL?</p>
  
  <p>Read also:</p>
  
  <p><a href="http://lambda-the-ultimate.org/node/5481" rel="noreferrer">http://lambda-the-ultimate.org/node/5481</a></p>
  
  <blockquote>
    <p>Is Haskell the right language for teaching functional programming
    principles? No! (As Simon Thompson explains.)</p>
  </blockquote>
  
  <p>I have learn dozens of languages and have teach a little. Certainly some languages are more problematic when others are not.</p>
  
  <hr>
  
  <p>My pet theory? I think if we accept that most software is <em>poorly designed</em> including programming languages, then users are not only learning how use the program(ing language) but struggling to dechiper the (poor) design and what is the true design beneath.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-10-30T22:47:45.777Z
Answers.Text: Welcome to [cseducators.se]! I hope we hear more from you in the future.
Answers.UserDisplayName: Ben I.
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-10-31T21:38:45.390Z
Answers.Text: I agree that there are "wrong" languages for teaching programming.  However, if it were possible to develop a "right" language that would permit anybody to learn to program, I'd expect the past half-century of looking for it would have produced at least some hint of success.
Answers.UserDisplayName: Mark
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-11-01T02:31:25.047Z
Answers.Text: Sure it have not existed? What about pascal or python? Is to note that the choice of "language to teach" is driven by the idea of "must be a industry standard" and in some places have been replaced older languages used for years to get trendy. So I'm unsure if this is proven or not.
Answers.UserDisplayName: mamcx
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-11-01T12:01:01.003Z
Answers.Text: If the code snippet was using some obscure part of Java, then that could definitely be true.  However this is simple enough that anyone who understands a while statement should be able to answer it.  And inability to understand "keep running this code while the condition here is true" means they truly haven't grasped how code works.
Answers.UserDisplayName: Graham
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-11-01T17:55:08.360Z
Answers.Text: @Mark Pascal was designed for the specific purpose of teaching programming concepts and good practice -- or at least, good practices as they were understood at the time.  And it was great at teaching, but not that great for large-scale maintenance.  Unfortunately, tools designed to teach and tools designed to be used in large-scale deployment don't always mean the same tools.  And these days we demand that fresh graduates be immediately employable and productive, so they're taught "industry standard" tools instead of "useful for learning" tools like Pascal.
Answers.UserDisplayName: Ti Strga
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-11-01T19:02:22.687Z
Answers.Text: That is only true for the first version of Pascal. It to be only "usefull" for teach is wrong: http://pascal-central.com/ppl/chapter4.html#Myths. Anyway, the point is that some languages are better to be used for teach than anothers, and not mean are pointless for real work... like for example python (that is popular today).
Answers.UserDisplayName: mamcx
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-11-01T21:12:04.907Z
Answers.Text: @mamcx, Yes, Pascal was created as a teaching language.  So was Python.  So was Basic.  So was Logo.  AppleScript had "anyone can program" as a goal.  Wikipedia lists almost a hundred other languages for teaching people to program.  And yet, somehow, people still have difficulty.  Maybe it's not the language that's the problem?
Answers.UserDisplayName: Mark
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-11-01T21:14:58.793Z
Answers.Text: @Graham Well, it might be. But there's always the chance that the person not understanding doesn't know Java but knows Python. If you only know Python, there's a decent chance you have no idea what "||" means, since Python uses the more understandable "or" keyword. "&&" would make sense, probably. The "ln" on "println" may have gotten confusing, what the heck is a "myScanner", etc. With only 3-5 minutes looking at it there's also the chance that they misread >/< or something trivial like that too.
Answers.UserDisplayName: Delioth
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-11-02T10:55:01.883Z
Answers.Text: @Delioth By the time you get to the third set of lectures though, they should understand "||".  The OP isn't really looking at "println" and "myScanner" - he says she can't even explain "answer" needing an initial value, or what values of "answer" cause the loop to stop. For me, this either demonstrates that she copied answers for earlier classes and never did the work, or that tests for earlier classes weren't effective.  And really it shows that she generally does not understand structured logical reasoning like "if you do this then that happens", which is a concern for a student.
Answers.UserDisplayName: Graham
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-10-30T22:34:01.480Z
Answers.LastActivityDate: 2017-10-30T22:34:01.480Z
Answers.UserDisplayName: mamcx
Answers.Body: <p>I firmly believe that, barring actual mental handicap, anyone can learn to program.</p>
  
  <p>However, this is purely a belief; a matter taken on faith. It is informed in part by some knowledge of psychology and the process of learning, but in these things I am at best an amateur.</p>
  
  <p>The available evidence, unfortunately, does not demonstrate that anyone can learn to program. Even though the infamous “The Camel Has Two Humps” paper has been <a href="http://www.eis.mdx.ac.uk/staffpages/r_bornat/papers/camel_hump_retraction.pdf" rel="noreferrer">retracted</a>, the retraction itself isn’t massively encouraging: the underlying data, according to the retraction, is all still valid and real. The conclusions drawn from that data was too strong, and in particular the actual “Camel” web article that got passed around so much made far stronger statements than even that—but nonetheless, the data is still there. It suggests a problem, and the retraction only says that we don’t know what causes it—not that it doesn’t exist.</p>
  
  <p>Furthermore, the paper cites numerous others in its claims of widespread low academic achievement in computer science: it does not stand alone in <em>that</em> claim.</p>
  
  <p>Thus, my conclusion is basically this: it may be, and I dearly hope it to be, that all students can learn to program. However, the available evidence suggests that, if nothing else, <em>we have not yet learned how to <strong>teach</strong> all students to learn to program.</em> Whether that is because it can be done and we just haven’t figured it out yet, or because it truly cannot be done, seems to remain an open question.</p>
  
  <p>So I would recommend all computer science educators to try to keep an eye on the state of the art here, and be willing to try new things. The status quo does not appear to be sufficient. It certainly isn’t settled science that there is a population who <em>cannot</em> learn programming, so even though that may be true, it is too early to give up on those who are failing right now.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-05-10T18:55:57.700Z
Answers.Text: In this paper "Evidence That Computer Science Grades Are Not Bimodal", Patistas et al. seem to prove that the grades are indeed not bimodal...
Answers.UserDisplayName: Nuno Gil Fonseca
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-05-10T19:04:57.930Z
Answers.Text: @NunoGilFonseca Excellent, glad to hear it. I am not a CS educator, so I have not taken as much time as I might recommend following this topic, but that is a promising sign. I hope there are more studies and more papers that confirm that result.
Answers.UserDisplayName: KRyan
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-10-31T10:03:15.330Z
Answers.Text: You may be an amateur in this realm, but that it a perfectly sound analysis. Welcome to [cseducators.se]!
Answers.UserDisplayName: Ben I.
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-11-07T05:39:14.983Z
Answers.Text: +1. Very sad to see the only answer that tries to bring actual data to CS Educators so low. I wouldn't have thought this to be such a faith based community. Shameful :(
Answers.UserDisplayName: Shane
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-12-27T17:25:23.240Z
Answers.Text: The problem with "barring actual mental handicap" is that it makes the argument effectively circular: "Except for those people who cannot learn to program, everyone can learn to program."
Answers.UserDisplayName: Daniel R. Collins
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-12-27T17:26:47.183Z
Answers.Text: @DanielR.Collins The word “actual” was meant to pin things down to handicaps that are widely recognized as a medical diagnosis, which would prevent a “no true Scotsman” issue like you describe.
Answers.UserDisplayName: KRyan
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-12-28T03:58:08.727Z
Answers.Text: @KRyan: That's well phrased and anticipated, but I don't think that avoids the problem. People with medically-diagnosed handicaps are students (just to reference the OP's exact question phrasing), too.
Answers.UserDisplayName: Daniel R. Collins
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-10-31T04:12:12.083Z
Answers.LastActivityDate: 2017-10-31T04:12:12.083Z
Answers.UserDisplayName: KRyan
Body: <p>A few days ago, I had a high school sophomore (who is now in her third CS class, having passed the prior two) look at this Java code for a solid 3-5 minutes, and was unable to figure out what it did:</p>
  <pre class="lang-java prettyprint-override"><code>int answer = -1;
  while (answer &lt; 1 || answer &gt; 5) {
      System.out.println(&quot;Please enter a number from 1 to 5.&quot;);
      answer = myScanner.nextInt();
  }
  </code></pre>
  <p>She couldn't identify the ending condition of the loop, and didn't understand why <code>answer</code> was initially set to a number outside of the 1-5 range.  The understandings that she would need to comprehend this code was covered in a prior class by a different teacher, and it was covered a second time from first principles in mine.</p>
  <p><em>I don't particularly need help with this student.</em>  I will tutor her and give her extra worksheets.  She will almost certainly skirt by and do okay, but if the past is a good indicator, she might never be able to quite put it all together, and larger projects will be impossible for her without some outside help (which I will make sure that she receives).</p>
  <p>However, every year, I find a small number of students who just don't seem to get it.  They muddle through, but the CS major program becomes harder and harder for them as their four years go by.  <em>Must it be this way?</em></p>
  <p><strong>Is there any evidence or reason to believe that there are students who genuinely can't learn to program?</strong>  Or, flipping the question around, <strong>is there any evidence or reason to believe that every student really can learn to program?</strong></p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2018-03-05T19:30:09.523Z
Comments.Text: With coding, it's possible to coast through some courses by memorizing some bits here and there, without *really* learning it. Believe it or not, the code snippet you have there involves a concept that *isn't* common sense, that is, not something she would have learned outside of a programming class. She might not understand starting conditions, or order of execution. She might assume that there's a reason for -1 instead of any other invalid number.
Comments.UserDisplayName: Gorchestopher H
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-10-30T21:43:42.007Z
Comments.Text: A noteworthy perspective is [Joel Spolsky's opinion on pointers and "getting it"](https://www.joelonsoftware.com/2006/10/25/the-guerrilla-guide-to-interviewing-version-30/): *I’ve come to realize that understanding pointers in C is not a skill, it’s an aptitude.*
Comments.UserDisplayName: chrylis -cautiouslyoptimistic-
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-10-30T23:23:58.800Z
Comments.Text: I will have to dig up the answer, but a question like this was asked previously.  The comments and answers pointed towards a study where one professor created a "test" to determine whether you will ever "get it" or not.  He showed evidence that it was a good test.  Many years later, he came back and said "I'm sorry.  I claimed the test worked.  It, in fact, did not."
Comments.UserDisplayName: Cort Ammon
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-10-30T23:26:06.913Z
Comments.Text: @CortAmmon Perhaps you are referring to the infamous [The Camel has Two Humps](http://www.eis.mdx.ac.uk/research/PhDArea/saeed/paper1.pdf), and its [partial retraction](http://retractionwatch.com/2014/07/18/the-camel-doesnt-have-two-humps-programming-aptitude-test-canned-for-overzealous-conclusion/)?
Comments.UserDisplayName: Ben I.
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-10-31T00:15:54.533Z
Comments.Text: @BenI. That's it.  Looks like you've seen it before.
Comments.UserDisplayName: Cort Ammon
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-10-31T01:16:21.593Z
Comments.Text: “Must it be this way?” Yes. As with maths, playing piano, anything. Every person has a different kind of intelligence. Some are maths oriented, some aren't.
Comments.UserDisplayName: Andrea Lazzarotto
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-10-31T02:05:49.533Z
Comments.Text: Why is this code so hard to understand? Because it doesn't use the natural do loop.
Comments.UserDisplayName: Joshua
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-10-31T06:56:08.187Z
Comments.Text: In a proper University, the professors would *completely* ignore your UI and would rather focus your implementation of an ADT or your implementation of an algorithm. As that is what they ask you for the assignments, is it not? Maybe a good idea is to separate a text-based UI library like you have above that you re-use every time you submit an assignment. Make sure your Professor is OK with that, though you most, most likely will not earn extra points for it. Then again cops aren't enrolled to Universities, huh?
Comments.UserDisplayName: Dehbop
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-10-31T08:22:46.807Z
Comments.Text: @Joshua My thought exactly.
Comments.UserDisplayName: JollyJoker
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-10-31T10:06:36.697Z
Comments.Text: Pedantic note : though the current code work, a `do while` would fit better.
Comments.UserDisplayName: Walfrat
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-10-31T13:42:13.173Z
Comments.Text: Since this has more to do with your example than your actual question, I am leaving it as a comment. Could your student understand the code rewritten in plain English? For example: *Suppose I was given the integer negative one. While any integers I am given are less than one and greater than five, I will state, "Please enter a number from one to five." and then I will request an integer.* If she could understand this, then there may be an element of the syntax that is confusing her.
Comments.UserDisplayName: called2voyage
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-10-31T17:09:19.450Z
Comments.Text: I want to chime in and agree that this is badly-written code (it makes the reader think unnecessarily hard), and thus I can’t help but empathize with the student. It could be rewritten into pseudocode that shows its intent more clearly: `int answer; repeat { … } until (answer ∊ [1..5])`. The confusing initial value of `answer` vanishes, and the postcondition of the loop is immediately clear. I might wager that the student *would* get this pseudocode — and in that case the student is hardly at fault, Java and/or the author of the code is.
Comments.UserDisplayName: lynn
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-10-31T17:17:17.903Z
Comments.Text: Of course, badly-written code occurs in the wild, and understanding it is a vital skill when programming in the “real world”. But it is hardly *essential* to understanding computer science, and such code should not play a role in the assessment of someone’s comprehension of the basics of CS.
Comments.UserDisplayName: lynn
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-10-31T17:34:20.247Z
Comments.Text: @Lynn I agree that the code could be clearer, but it's still not deeply complex. After how many course hours of study in Java would it still be reasonable for someone to be unable to follow this snippet code, imperfect though it may be? 20? 100? 500? 10,000?
Comments.UserDisplayName: Ben I.
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-11-01T17:06:22.083Z
Comments.Text: @BenI. 2-3? couple more at a stretch?  I'm not a Java programmer myself, but all the topics needed are covered by the 6th page of the language tutorial on cplusplus.com.  assuming that each CS class your student has done (class!=lesson, right?) does cover some programming, I would have thought this would be prior knowledge.  My degree course, intentionally avoiding a language that (m)any would have used (no coding requisite) reached this point in the first lecture. (I am aware that this isn't degree level)
Comments.UserDisplayName: Baldrickk
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-11-01T18:35:03.990Z
Comments.Text: Why the hell is that code so hard to understand? Here are some potential reasons: (1) "int"... what is "int"? That's not an English word. (2) "answer < 1 || answer > 5" wtf are those two bars? Oh, it means "or"? Then isn't that saying "if answer is less than 1 or itself or if it's greater than 5?" (3) "println" what the hell is printing? I don't even have a printer. Where would I be printing? And what's "ln"? natural log? (4) "myScanner" ...first my printer and now my scanner?? what even is a scanner?? I don't have a scanner! (5) if answer is -1 how can it also be nextInt? Isn't that wrong?
Comments.UserDisplayName: user541686
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-11-02T10:52:44.043Z
Comments.Text: @Joshua One of most important skills in CS is reading and comprehension of code (and when it comes to SE, it's *the* most important skill). And this includes bad code. You can't pretend bad code doesn't exist. Plus, while I agree that code could be better, if you think it's bad code, you clearly haven't seen really *bad* code.
Comments.UserDisplayName: el.pescado - нет войне
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-11-02T13:00:53.627Z
Comments.Text: @Mehrdad Note that OP specifically state that his student wasn't able to understand the condition for the loop to end. Note that he doesn't know the class Scanner. On the loop thing, we have basic comprehension of code, of the Scanner thing, it's about Java specific classes, which is not relevant here.
Comments.UserDisplayName: Walfrat
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-11-02T14:28:14.417Z
Comments.Text: @Mehrdad Apparently the student has already had all of that explained to them, so there's an expectation that they *shouldn't* be confused by any of those things. Maybe that expectation is wrong, though. Maybe they just pretended to understand it when it was explained in the past, maybe they thought they understood it - or even did understand it - at the time, but have now forgotten it all. Is the failure to comprehend an inability to understand some or all of the individual parts or an inability to put them together - despite understanding them individually - to figure out the overall intent?
Comments.UserDisplayName: Anthony Grist
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-11-02T20:33:51.087Z
Comments.Text: The obvious answer to this question is that **Java is Evil**, and students should learn on Right and Proper languages like Perl and bash...
Comments.UserDisplayName: RonJohn
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-11-02T22:44:26.767Z
Comments.Text: I'm a senior front end web developer and to be honest I don't really understand the example code. I wouldn't call myself a programmer though.
Comments.UserDisplayName: ESR
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-11-03T00:56:21.843Z
Comments.Text: This is an anti-pattern (bad design), but should be clear to anyone reading it.  It's typical beginner code. I have known many data modelers who squeaked by their programming degree and then avoided programming because they really didn't "get" it. They could follow and enforce rules and recipes, but could not wrap their heads around any degree of indirection.
Comments.UserDisplayName: pojo-guy
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-11-03T06:12:20.857Z
Comments.Text: This is a serious question, so no flame please. Based on your empirical evidence/experience, is there a gender bias for students who don't get it? If so, what is that bias? How statistically strong are your numbers? ie How many students have you taught and what percentage did you find don't get it?
Comments.UserDisplayName: Bohemian
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-11-03T16:06:05.743Z
Comments.Text: @Bohemian I have not kept numbers that could be easily organized like that, so I only have impressions. I have not noticed any gender divide (or any patterns, really). I have definitely had more males with serious problems than females, but I have also had many more males in my CS courses in general, so it doesn't add up to any information on a gendered comprehension gap. I believe that I have taught CS to between 400 and 500 students at this point.
Comments.UserDisplayName: Ben I.
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-11-03T18:31:39.547Z
Comments.Text: On the comment about it being specifically the condition that's confusing, my experience as a TA for an introductory course was that students new to programming were never taught about boolean values.  Only the magic structure of conditionals, that the `<` in `if (x < 1)` is part of the `if` and only `x` and `1` could be slotted in with values/variables.  The ability to do `bool is_lower = x < 1; if (is_lower)` was mind-warping when I explained it during office hours.
Comments.UserDisplayName: Izkata
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-11-03T18:42:05.897Z
Comments.Text: If you ask me, it's a clear sign that the student more than likely should have not passed the prior CS course(s). The student may have had someone else do their work, or would always "seek help" as in someone explaining how the write the code, while also telling them how to produce code at the same time. Therefore they would just regurgitate what was said, rather than actually learning. This piece of code is by no means complex, and should be able to be deciphered by someone exiting a beginner level programming course.
Comments.UserDisplayName: DrZoo
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-11-03T18:46:31.163Z
Comments.Text: For the record, I did get confused by some simple things when I learned to program. One day, some topic I would find confusing would just click. I now look back and think about my blunders and wonder how on Earth I was even confused to begin with. The answer? I didn't put in enough practice, lacked ambition, and didn't feel confident in my skill. I was able to overcome the challenges, and learned to really love programming :)
Comments.UserDisplayName: DrZoo
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-11-03T19:33:11.510Z
Comments.Text: I've found a real good analogy that I believe is amazingly accurate--think of programming as you do playing sports.  Your question can become, can every child learn to play basketball--pretty much.  Can every child become a basketball pro?  Probably not.  There are various obvious physical and mental issues that clearly prevent it (Although anyone who works at it hard enough can become extremely good).  There is just as much variance in programming ability--and just as few pro-level coders.  Most of us "Professionals" are just playing hoops outside our garages and will never meet a pro.
Comments.UserDisplayName: Bill K
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-11-03T22:21:22.590Z
Comments.Text: As someone learning programming, I had a huge trouble with creating classes in Java. It wasn't until I switched languages twice until VBA functions that I truly understood what classes actually did and were used for. Even now, I rarely use classes and instead find myself creating functions instead. Sometimes all it takes is a bit of time and a shift in perspective to turn a complete failure into an unqualified success.
Comments.UserDisplayName: Anoplexian
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-11-05T01:01:14.127Z
Comments.Text: @Anoplexian +1 good point. It was my third language before I was able to abstract the problem from the code.
Comments.UserDisplayName: pojo-guy
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-11-05T08:44:54.930Z
Comments.Text: There's one thing pretty much everyone seems to be missing here. The return value of `nextInt()` isn't obvious. Someone who isn't used to Java would have to check the docs to know what it returns when it can't find a number. I'm guessing from the way the code is written that it's `-1`, but I can only guess that because I'm an experienced programmer, I can't see a reason why a beginner would logically assume that.
Comments.UserDisplayName: Pharap
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-11-05T13:51:17.353Z
Comments.Text: Is there some meaningful percentage of teachers who can’t teach students to program?
Comments.UserDisplayName: MPW
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-11-06T19:47:36.727Z
Comments.Text: Sometimes, it is odd, but I think programming is one of those cases where it isn't that you *can't* learn something, but that it sometimes takes something else to make it click. It's been a while, but there were some concepts that didn't come right away, yet after taking a Digital Logic Circuits course, everything started to fall into place mentally. It may be that everyone is explaining it directly as it is (programming concepts) whereas something else may illuminate it. And once the basics are grasped, well, it makes it easier to grok things that follow the more direct way.
Comments.UserDisplayName: Robert
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-11-06T21:08:41.790Z
Comments.Text: @MPW I think most would (sadly) agree that there's a meaningful percentage of teachers who can't *teach*, let alone teach programming.
Comments.UserDisplayName: mbrig
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-11-06T21:24:35.610Z
Comments.Text: Is there any empirical evidence that shows some people can't learn to program? Yes. I've been working in and around programming since the 1980's, and I meet more and more of those people every year. They're usually working in Java or C# doing "web development." Just because your student doesn't understand anything about programming doesn't mean she won't be able to find work in the IT industry as a developer.
Comments.UserDisplayName: aghast
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-11-07T12:15:59.383Z
Comments.Text: Learning is a highly emotional and relationship based process. If you were standing over this student while they were reading the code, they may have been extremely nervous and they might have started off confused by why **answer** is assigned -1 instead of the simpler choice of 0. So they think they are being tricked and have been taught that it's better to say nothing than say the wrong thing. They panic and assume there is something basic they are missing and give up on trying to understand the code. It's not the student, it's the *situation*.
Comments.UserDisplayName: Todd Wilcox
Tags: <student-motivation><struggling-students>
Title: Is there some meaningful percentage of students who can't learn to program?
ThreadText: # Is there some meaningful percentage of students who can't learn to program?
  
  (Asked by: username_0 on 2017-10-30)
  
  A few days ago, I had a high school sophomore (who is now in her third CS class, having passed the prior two) look at this Java code for a solid 3-5 minutes, and was unable to figure out what it did:
  
  ```java
  int answer = -1;
  while (answer < 1 || answer > 5) {
      System.out.println("Please enter a number from 1 to 5.");
      answer = myScanner.nextInt();
  }
  
  ```
  
  She couldn't identify the ending condition of the loop, and didn't understand why `answer` was initially set to a number outside of the 1-5 range. The understandings that she would need to comprehend this code was covered in a prior class by a different teacher, and it was covered a second time from first principles in mine.
  
  *I don't particularly need help with this student.* I will tutor her and give her extra worksheets. She will almost certainly skirt by and do okay, but if the past is a good indicator, she might never be able to quite put it all together, and larger projects will be impossible for her without some outside help (which I will make sure that she receives).
  
  However, every year, I find a small number of students who just don't seem to get it. They muddle through, but the CS major program becomes harder and harder for them as their four years go by. *Must it be this way?*
  
  **Is there any evidence or reason to believe that there are students who genuinely can't learn to program?** Or, flipping the question around, **is there any evidence or reason to believe that every student really can learn to program?**
  
  **Tags:** student-motivation, struggling-students
  
  > **Comments:**
  > **username_2**: A noteworthy perspective is [Joel Spolsky's opinion on pointers and "getting it"](https://www.joelonsoftware.com/2006/10/25/the-guerrilla-guide-to-interviewing-version-30/): *I’ve come to realize that understanding pointers in C is not a skill, it’s an aptitude.*  
  > **username_3**: I will have to dig up the answer, but a question like this was asked previously.  The comments and answers pointed towards a study where one professor created a "test" to determine whether you will ever "get it" or not.  He showed evidence that it was a good test.  Many years later, he came back and said "I'm sorry.  I claimed the test worked.  It, in fact, did not."  
  > **username_0**: @username_3 Perhaps you are referring to the infamous [The Camel has Two Humps](http://www.eis.mdx.ac.uk/research/PhDArea/saeed/paper1.pdf), and its [partial retraction](http://retractionwatch.com/2014/07/18/the-camel-doesnt-have-two-humps-programming-aptitude-test-canned-for-overzealous-conclusion/)?  
  > **username_3**: @BenI. That's it.  Looks like you've seen it before.  
  > **username_4**: “Must it be this way?” Yes. As with maths, playing piano, anything. Every person has a different kind of intelligence. Some are maths oriented, some aren't.  
  > **username_5**: Why is this code so hard to understand? Because it doesn't use the natural do loop.  
  > **username_6**: In a proper University, the professors would *completely* ignore your UI and would rather focus your implementation of an ADT or your implementation of an algorithm. As that is what they ask you for the assignments, is it not? Maybe a good idea is to separate a text-based UI library like you have above that you re-use every time you submit an assignment. Make sure your Professor is OK with that, though you most, most likely will not earn extra points for it. Then again cops aren't enrolled to Universities, huh?  
  > **username_7**: @username_5 My thought exactly.  
  > **username_8**: Pedantic note : though the current code work, a `do while` would fit better.  
  > **username_9**: Since this has more to do with your example than your actual question, I am leaving it as a comment. Could your student understand the code rewritten in plain English? For example: *Suppose I was given the integer negative one. While any integers I am given are less than one and greater than five, I will state, "Please enter a number from one to five." and then I will request an integer.* If she could understand this, then there may be an element of the syntax that is confusing her.  
  > **username_10**: I want to chime in and agree that this is badly-written code (it makes the reader think unnecessarily hard), and thus I can’t help but empathize with the student. It could be rewritten into pseudocode that shows its intent more clearly: `int answer; repeat { … } until (answer ∊ [1..5])`. The confusing initial value of `answer` vanishes, and the postcondition of the loop is immediately clear. I might wager that the student *would* get this pseudocode — and in that case the student is hardly at fault, Java and/or the author of the code is.  
  > **username_10**: Of course, badly-written code occurs in the wild, and understanding it is a vital skill when programming in the “real world”. But it is hardly *essential* to understanding computer science, and such code should not play a role in the assessment of someone’s comprehension of the basics of CS.  
  > **username_0**: @username_10 I agree that the code could be clearer, but it's still not deeply complex. After how many course hours of study in Java would it still be reasonable for someone to be unable to follow this snippet code, imperfect though it may be? 20? 100? 500? 10,000?  
  > **username_11**: @BenI. 2-3? couple more at a stretch?  I'm not a Java programmer myself, but all the topics needed are covered by the 6th page of the language tutorial on cplusplus.com.  assuming that each CS class your student has done (class!=lesson, right?) does cover some programming, I would have thought this would be prior knowledge.  My degree course, intentionally avoiding a language that (m)any would have used (no coding requisite) reached this point in the first lecture. (I am aware that this isn't degree level)  
  > **username_12**: Why the hell is that code so hard to understand? Here are some potential reasons: (1) "int"... what is "int"? That's not an English word. (2) "answer < 1 || answer > 5" wtf are those two bars? Oh, it means "or"? Then isn't that saying "if answer is less than 1 or itself or if it's greater than 5?" (3) "println" what the hell is printing? I don't even have a printer. Where would I be printing? And what's "ln"? natural log? (4) "myScanner" ...first my printer and now my scanner?? what even is a scanner?? I don't have a scanner! (5) if answer is -1 how can it also be nextInt? Isn't that wrong?  
  > **username_13**: @username_5 One of most important skills in CS is reading and comprehension of code (and when it comes to SE, it's *the* most important skill). And this includes bad code. You can't pretend bad code doesn't exist. Plus, while I agree that code could be better, if you think it's bad code, you clearly haven't seen really *bad* code.  
  > **username_8**: @Mehrdad Note that OP specifically state that his student wasn't able to understand the condition for the loop to end. Note that he doesn't know the class Scanner. On the loop thing, we have basic comprehension of code, of the Scanner thing, it's about Java specific classes, which is not relevant here.  
  > **username_14**: @Mehrdad Apparently the student has already had all of that explained to them, so there's an expectation that they *shouldn't* be confused by any of those things. Maybe that expectation is wrong, though. Maybe they just pretended to understand it when it was explained in the past, maybe they thought they understood it - or even did understand it - at the time, but have now forgotten it all. Is the failure to comprehend an inability to understand some or all of the individual parts or an inability to put them together - despite understanding them individually - to figure out the overall intent?  
  > **username_15**: The obvious answer to this question is that **Java is Evil**, and students should learn on Right and Proper languages like Perl and bash...  
  > **username_16**: I'm a senior front end web developer and to be honest I don't really understand the example code. I wouldn't call myself a programmer though.  
  > **username_17**: This is an anti-pattern (bad design), but should be clear to anyone reading it.  It's typical beginner code. I have known many data modelers who squeaked by their programming degree and then avoided programming because they really didn't "get" it. They could follow and enforce rules and recipes, but could not wrap their heads around any degree of indirection.  
  > **username_18**: This is a serious question, so no flame please. Based on your empirical evidence/experience, is there a gender bias for students who don't get it? If so, what is that bias? How statistically strong are your numbers? ie How many students have you taught and what percentage did you find don't get it?  
  > **username_0**: @username_18 I have not kept numbers that could be easily organized like that, so I only have impressions. I have not noticed any gender divide (or any patterns, really). I have definitely had more males with serious problems than females, but I have also had many more males in my CS courses in general, so it doesn't add up to any information on a gendered comprehension gap. I believe that I have taught CS to between 400 and 500 students at this point.  
  > **username_19**: On the comment about it being specifically the condition that's confusing, my experience as a TA for an introductory course was that students new to programming were never taught about boolean values.  Only the magic structure of conditionals, that the `<` in `if (x < 1)` is part of the `if` and only `x` and `1` could be slotted in with values/variables.  The ability to do `bool is_lower = x < 1; if (is_lower)` was mind-warping when I explained it during office hours.  
  > **username_20**: If you ask me, it's a clear sign that the student more than likely should have not passed the prior CS course(s). The student may have had someone else do their work, or would always "seek help" as in someone explaining how the write the code, while also telling them how to produce code at the same time. Therefore they would just regurgitate what was said, rather than actually learning. This piece of code is by no means complex, and should be able to be deciphered by someone exiting a beginner level programming course.  
  > **username_20**: For the record, I did get confused by some simple things when I learned to program. One day, some topic I would find confusing would just click. I now look back and think about my blunders and wonder how on Earth I was even confused to begin with. The answer? I didn't put in enough practice, lacked ambition, and didn't feel confident in my skill. I was able to overcome the challenges, and learned to really love programming :)  
  > **username_21**: I've found a real good analogy that I believe is amazingly accurate--think of programming as you do playing sports.  Your question can become, can every child learn to play basketball--pretty much.  Can every child become a basketball pro?  Probably not.  There are various obvious physical and mental issues that clearly prevent it (Although anyone who works at it hard enough can become extremely good).  There is just as much variance in programming ability--and just as few pro-level coders.  Most of us "Professionals" are just playing hoops outside our garages and will never meet a pro.  
  > **username_22**: As someone learning programming, I had a huge trouble with creating classes in Java. It wasn't until I switched languages twice until VBA functions that I truly understood what classes actually did and were used for. Even now, I rarely use classes and instead find myself creating functions instead. Sometimes all it takes is a bit of time and a shift in perspective to turn a complete failure into an unqualified success.  
  > **username_17**: @username_22 +1 good point. It was my third language before I was able to abstract the problem from the code.  
  > **username_23**: There's one thing pretty much everyone seems to be missing here. The return value of `nextInt()` isn't obvious. Someone who isn't used to Java would have to check the docs to know what it returns when it can't find a number. I'm guessing from the way the code is written that it's `-1`, but I can only guess that because I'm an experienced programmer, I can't see a reason why a beginner would logically assume that.  
  > **username_24**: Is there some meaningful percentage of teachers who can’t teach students to program?  
  > **username_25**: Sometimes, it is odd, but I think programming is one of those cases where it isn't that you *can't* learn something, but that it sometimes takes something else to make it click. It's been a while, but there were some concepts that didn't come right away, yet after taking a Digital Logic Circuits course, everything started to fall into place mentally. It may be that everyone is explaining it directly as it is (programming concepts) whereas something else may illuminate it. And once the basics are grasped, well, it makes it easier to grok things that follow the more direct way.  
  > **username_26**: @username_24 I think most would (sadly) agree that there's a meaningful percentage of teachers who can't *teach*, let alone teach programming.  
  > **username_27**: Is there any empirical evidence that shows some people can't learn to program? Yes. I've been working in and around programming since the 1980's, and I meet more and more of those people every year. They're usually working in Java or C# doing "web development." Just because your student doesn't understand anything about programming doesn't mean she won't be able to find work in the IT industry as a developer.  
  > **username_28**: Learning is a highly emotional and relationship based process. If you were standing over this student while they were reading the code, they may have been extremely nervous and they might have started off confused by why **answer** is assigned -1 instead of the simpler choice of 0. So they think they are being tricked and have been taught that it's better to say nothing than say the wrong thing. They panic and assume there is something basic they are missing and give up on trying to understand the code. It's not the student, it's the *situation*.  
  > **username_1**: With coding, it's possible to coast through some courses by memorizing some bits here and there, without *really* learning it. Believe it or not, the code snippet you have there involves a concept that *isn't* common sense, that is, not something she would have learned outside of a programming class. She might not understand starting conditions, or order of execution. She might assume that there's a reason for -1 instead of any other invalid number.  
  
  ---
  
  ## 22 answers
  
  ### Answer by username_39 on 2017-10-30. Score: 75
  
  There are a number of reasons why students *don't* learn, but few non medical ones why they can't. Leaving aside the medical reasons, such as hormonal imbalance or other disorders, I think that students who don't learn either have little desire to learn or have had poor teaching in the past. Even students with some learning disorders can learn given desire and patient teaching, but it can take a lot of work and understanding of the student to enable it. Once common problem with students is extreme introversion. That can make it difficult for the student to seek help and ask questions. It is good if you can find ways to help students deal with that in a positive way. See [this question](https://cseducators.stackexchange.com/questions/3854/making-technical-presentations-safe-for-novices) for more on the idea here.
  
  ### Desire
  
  Some students don't learn what you are teaching because they have little desire to learn it and no incentive to put in the work required. They may be in your course for the wrong reasons and would rather be anywhere else if it were only possible. They put in the time, but nothing else. There is probably not a lot you can do for them as that desire needs to be internal. Some students develop desire after a period of indifference, but I don't think this is common. I've had undergraduates in CS who were only in the major because their family (father) would only support them if they stayed. Such students can be counseled to study something more interesting to them if possible, even if it requires doing that in addition to computing. Better, though, if you can counsel the parents to better support their child.
  
  Some classes are required, of course, and so interest for some will be higher and for some it will be lower. If you know something of the goals of the student you might be able to connect the current class to those goals, increasing interest and desire.
  
  ### Poor Teaching
  
  Many students do poorly in CS (as in mathematics) due to poor or indifferent teaching; especially the attitude among some teachers that it is OK to leave some students behind. Not every student takes the same amount of effort to teach and every student learns differently. My usual mantra in this situation is that "Your students are not like you." They learn differently than you did. Your presence in the classroom as a teach is proof enough that you are a special case.
  
  Some especially bright kids do poorly in school because they are simply bored and nothing is exciting enough *to them* to put in the effort. Some students find other subjects especially easy and don't really know what it is like to have to *work* to learn. Some students don't learn because no one ever taught them *how to learn*. Some think that hearing something once means they have learned it and are surprised later when they can't recall something, wondering why you never taught it to them. Some students have a fundamental misconception about some small thing that has snowballed into a big block. Some students have never had a positive learning experience (maybe generally and maybe just in some topic) and simply hate everything about the process. Some teacher say incredibly stupid things to students and even some institutions have incredibly stupid ways to deal with students, actively damaging them.
  
  I have examples in my learning and teaching background of each of these things.
  
  As a student I was a thought not very bright when I was a kid and was nearly "held back" to repeat an early grade. However, I was just *deadly* bored with school. No one ever bothered to tell me why I was there or why or how I should try to succeed. Being bored I was a bit of a troublemaker, leading to lack of support from teachers. Later on, I was given an IQ test and the results were reported back to me as "You probably have the skill to succeed in a Junior College, but probably would only be frustrated by a full undergraduate program." I later earned a PhD, of course, so the assessment was a bit "off". The first course in which I actually learned anything was in Plane Geometry in HS. I got entranced by the problems there. Prior to that, mathematics was, perhaps, my worst subject. The doctorate is in Mathematics, of course.
  
  In teaching, I once had a student with two problems. First he was dying of a chronic condition, but also he had been given misinformation about the precedence of operators by some early teacher that was reinforced when he used a too-simple pocket calculator. He couldn't seem to get it right in elementary programming and learned to hate it. He thought he was stupid that he didn't *get it* and he thought that all of his teachers also thought he was stupid. I think I managed to convince him otherwise before he died but we banged heads a bit before the reason for his difficulties became clear to me. It took a bit longer to convince him that I wasn't actively trying to deceive him.
  
  I once had a class of students who were almost all doing very poorly. Since my teaching style then was to face them, rather than lecture with my back to them, the diagnosis was pretty simple. No one had ever taught them how to learn in a classroom. They sat passively and listened and watched, taking no action themselves. I asked one why he didn't take notes and he pointed to his head and said "It's all here." Well, I had evidence otherwise, so had to interrupt the syllabus to actually teach them how to learn and to force them to actually do it. I've discussed part of the method in [another answer on this site](https://cseducators.stackexchange.com/a/1168/1293).
  
  ### Solutions
  
  If you want to [teach every student](https://cseducators.stackexchange.com/questions/1347/how-can-i-convince-my-fellow-cs-teachers-that-reaching-every-student-is-a-worthw), however, you need to *know every student*. If someone is doing poorly, you need to try to understand why that is and to tailor a solution to their needs. To do that you need to be dealing with a reasonable number of students, of course, so if you are a professor of 800 students, the individual care must be given by your army of helpers. But even wit 20 or so students you need help. This is why pairing and group work is so important and why you can't always let students choose their own groups. You need to get feedback from the members of the groups (peer evaluation) and you need to find ways to act on what you learn.
  
  The solution to teaching every student is not to individually tutor every student, but to find ways that every student can learn what they need to learn *on their own terms.* Not every student wants to earn first marks. They want to learn "just enough." They are *satisficing* rather than *optimizing*. You can make that work for them too, so that "not earning first marks" doesn't mean "failing."
  
  ## Success Story
  
  I once had two students (compiler course) who were repeating the course after failing it. The classmates of these two were generally among the best I've ever had in one group. But these two had, seemingly, never had a positive experience in CS. They seemed to be dull, requiring repeated explanations of the simplest ideas over and over. Fortunately the course was taught in an incremental way in which the students could accumulate points toward success rather than by demonstrating it on exams: a project course. I convinced them to come to my office hours and there was never a time thereafter that they weren't there. Fortunately the other students didn't require such high maintenance. I also had simple ways for students to ask questions when they were working on their own and so these two could get small helps whenever they needed it. It turned out that these two wound up (a) explaining things correctly to me by the end of the course (b) earning the highest grades that term, and (c) angering the other students who thought I'd put these two in the class to make themselves look bad. My last contact with them was to remind them of what they had done and that they could repeat that elsewhere if they were willing to put in the same amount of work. I think that teamwork also helped here and they supported one another throughout. Note that I didn't need to put additional time into the course for this to happen. The office hours were required and the mailing list for questions was a common feature of all my courses. Another question here seeks ways to make this [out-of-class communication](https://cseducators.stackexchange.com/questions/3811/answering-student-questions-as-they-work-outside-class) easy, though I think it needs better answers at this time.
  
  > **Comments:**
  > **username_50**: This is also lacking any kind of evidence. You may *think* “that students who don't learn either have little desire to learn or have had poor teaching in the past,” but can you actually back that statement up with some kind of evidence? I have read evidence contrary to that statement, and while it was far from ironclad proof of any kind, I think this question desperately needs more than generalities and possibly-wishful thinking.  
  > **username_50**: (Doing some due diligence here.) It seems that the paper I had read suggesting that they had evidence demonstrating that not everyone can learn to program has been retracted for overstating its conclusions. *However*, you can read the retraction [here](http://www.eis.mdx.ac.uk/staffpages/r_bornat/papers/camel_hump_retraction.pdf)—it still isn’t supremely encouraging. It shows that a lot of the data that went into the retracted paper is real, and if the suggested explanations for them lack sufficient evidence, we’re still left with problems we don’t know the causes to.  
  > **username_50**: In short, once again, I strongly recommend finding actual research and evidence for your claims that the answer to the title question is “no.” You kind of just assert that and then go into all your hypotheses for reasons why students fail despite the lack of a population destined to fail.  
  > **username_39**: Actually, having taught for about 45 years, my sample is >10K. Every student is an anecdote, of course, but there are a lot of them. Since I also taught at quite a variety of places, I'd guess I've seen most of the range of possibles.  
  > **username_51**: @username_39: I loved your response. I lecture now and my first TA job was 21 years ago. You did not say a single thing which is didn't recognize from personal experience or from listening to my father :)  
  > **username_52**: You may be onto something here. There was a girl like that in my CS classes back in the 80's. Her goal was just to get a degree so she could go into teaching. She was in CS because her dad was a prof in the Engineering department, so her classes in that department were free. CS was less math than ChemE, so there she was.  
  > **username_23**: I have to agree with this. One of the reasons I never bothered to futher my education was because I found the stuff we were doing in class to be far below what I was capable of doing at home ("make a simple asteroids game" vs "simulate rigidbody physics", "make a simple 1 operation calculator" vs "write a recursive descent parser").  
  > **username_53**: This post seems to be 80% about bad teachers. However programming is a *constant, never-ending learning process*. If you want to be successful, you must be able to study and learn new things by yourself without the assistance of a teacher. Having a good one can help, but a good programmer ought to have enough learning aptitude to learn to program from scratch, if need be.  
  > **username_54**: Sure, with tons and tons of work everyone can pass a course. *But if they need that much special attention next semester as well, they haven't learned how to program*. I have a colleague who googles his problem then pastes in whatever code he finds on stack overflow randomly into his code. He kinda gets things working most of the time. This isn't someone who has learned how to program. This is someone who spent a lot of time with his teachers who helped him pass courses. Getting your code to work or passing the course through the application of sheer brute force is not learning how to program.  
  > **username_38**: -1 "few non medical ones why they can't" this hand-waves away, without any evidence, at least two very large levels of reasons why people could not interface with programming. It sounds like you accept that some people clearly cannot learn to program (bounded from below by "hormonal imbalance or other disorders"). The honest question then is really: what is that percentage?  
  > **username_55**: I'm sitting here with 23 years of teaching experience, and yes username_39 is spot on.  
  > **username_56**: +1 for "No one had ever taught them how to learn in a classroom." COVID has really not helped with that one, at least in the UK  
  > **username_31**: Perhaps your two successful students had learned enough Formal Operations by the end to make a good go of it. Some learn FO before CS courses, some during, some later or mostly, never. We don't want the nevers in the workplace, at least not for anything crucial.  
  
  ---
  
  ### Answer by username_36 on 2017-10-31. Score: 57
  
  Maybe. It's hard to prove a negative.
  
  How does knowing that help educators in any way?
  
  If that knowledge helps somehow, how does that compare to all the ways that belief can be harmful?
  
  * Giving up on students who "just won't get it"
  * Not reflecting on how teaching can improve, since the ones who failed "just won't get it"
  * Noticing "patterns" in the students who "just don't get it"
  
  There have been students who privately I had serious doubts about. Repeated explanations went nowhere. Trace after trace was slow and labored. Then... later... eventually... they figured it out. Next year they passed the class.  
  Later, they got a job as a programmer.
  
  I realized that **I just can't know**. Students come back and get it together. If I had shared my judgments it would have completely derailed their success. I can only help each student the best I can. And that includes believing that each and every student is capable of learning programming.
  
  > **Comments:**
  > **username_0**: This is a surprisingly practical answer.  
  > **username_30**: This answer says that no matter how many wrong predictions (patterns or others) you try, you can't predict an observable quantity X. Like ever. So basically it says science can't work.  
  > **username_58**: @username_30 -- come on, don't be factious, the answer isn't saying "science doesn't work" or anything silly like that. Rather, this answer is saying that regardless of what the predicted value is, the best thing for the educator to do is to help all students to the best of their ability. So, since the predicted outcome doesn't (or at least shouldn't) influence how you teach, and since prediction is difficult, why expend effort worrying about it?  
  > **username_12**: I think you're being a little too naive here. If person A requires 10x as much work to "get" a topic X as person B in school, then there's a nontrivial chance that that's going to be just as true on the job as it was during school. Meaning that hiring them for that job might be bad both for them and for the employer. You don't expect see this when they're hired because they could (and should) have already spent the 10x time necessary to become as good as everyone else who is applying. But their recognizing this can be useful knowledge for them: they can try doing something they are better at.  
  > **username_12**: So if you're going to take this practical view, you should be asking yourself whether it's better to inform them of this when you think you recognize it, or better not to. Of course I can think of arguments both ways, and I'm not claiming that "do not tell them" is necessarily the worse option. But the point is, it's not about whether *you* will be able to teach them that particular topic or whether *you* should just "give up", but about whether it'd help them in choosing the right path (future career, etc.).  
  > **username_36**: @Mehrad I think you're assuming each person has an intrinsic learning rate for programming topics. I don't think learning science supports that.  
  > **username_8**: They might just have trouble to get the basis, since they finally got their degree without doubling all their year, it's seems that what you assume here is not enterely true. If we generalize (and exagerating a little) that, you're basically saying that anyone that made a year of class twice (excluding personal matters and keeping only learnin problem) should just have drop school from where that year. username_36 : I guess this is why it's always better to try to explain differently instead of just repeating.  
  > **username_59**: @username_36 I am no educator and have no knowledge of learning science; but my life experience seems to indicate that there are truly stupid people. (More generally, there is a wide spectrum of intelligence, but this discussion centers on the lower end.) Obviously a stimulating and supportive environment can improve intelligence even with young adults, but my layman's idea of the state of research is that there is a limit to environmental influence at that point. That would indicate that yes, there is an intrinsic leaning rate (ceiling). That fits with my personal experience. Do you disagree?  
  > **username_12**: @username_36: Oh, OK, please link me to said science? A priori, it would seem absolutely *shocking* for everyone to have the same learning rate for {any given topic} (even on average, if not uniformly). So if you have evidence to the contrary, I'm all ears (er, eyes).  
  > **username_36**: @Mehrdad and username_59 The key point is that prior knowledge greatly influences ability to learn. New knowledge is incorporated into existing knowledge structures, which may be more or less receptive to the addition (see: constructivism). Those with well-organized prior knowledge can see patterns others can't, and therefore learn better (see https://www.nap.edu/read/9853/chapter/5#32). I believe there may be differences in "intrinsic learning rate", but I think those are dwarfed by the effect of differences in prior knowledge. By building the right knowledge, we can accelerate learning.  
  > **username_12**: @username_36: Apply your logic to something more tangible and you'll see it makes no sense. It's like I'm claiming that one airplane can be intrinsically more fuel-efficient than another one, and you're trying to somehow counter it with *"No, the key point is that the number of passengers greatly influences the fuel usage, and those with fewer people use less fuel. [1] [2] [3] I believe there may be differences in "intrinsic fuel consumption", but I think those are dwarfed by the effects of differences in passenger count."* I mean, you can believe what you want, but your argument doesn't support it.  
  > **username_12**: @username_36: If we're going to go based on our own beliefs, I know I personally have had lots of trouble learning certain topics (e.g. analog circuits) despite pretty equal background to my peers' and putting in ridiculous amounts of effort as compared to other topics. At some point I figured people really do just have different strengths. Now of course that won't convince you and you'll instead just conclude "oh but you're just 1 sample" (no, I've seen others too) or "oh you were learning it *incorrectly*" (uhm, yeah, sure...) but I hope you realize your personal beliefs aren't any more convincing.  
  > **username_57**: @Mehrdad Your analogy makes no sense. Intrinsic fuel consumption happens to dwarf passenger count in airplanes but that isn't because of the fundamental logic of the situation, but because of the laws of physics. I think a better analogy would be to stocks: With companies founded at different times there is massive variance in profit growth in an absolute  sense, even if profit growth as a percentage of the previous years profit is the same across all companies.  
  > **username_57**: @Mehrdad To take the analogy to students, there could be an intrinsic learning rate as a percentage of prior knowledge but given varying backgrounds of students this would be only extremely loosely correlated to absolute growth in knowledge over a given term.  
  > **username_31**: If Formal Operations is necessary, and student doesn't have it yet, then BY learning programming they can start to gain it. But it will be harder than for someone who already has some FO. Like learning calculus while also learning English as a second language.  
  
  ---
  
  ### Answer by username_0 on 2017-10-30. Score: 30
  
  As I indicated in the question, it has been my experience that there are certain kids who never seem to come along. My data is drawn from a rather small group (definitely under 1000 kids learning CS over the course of my career), and @username_39's idea that these students are *satisfying* rather than *optimizing* may well be correct. However, I haven't seen convincing evidence of that. What evidence I do have, unscientific though it may be, is that there are, indeed, students whose brains are simply not wired for this field.
  
  It always appears to be the case that, with enormous effort, they can obtain some very basic competencies, but the material does not fit "naturally" into their way of thinking, in much the same way as not everyone can feel certain aspects of musicality. (See [beat deafness](https://www.washingtonpost.com/news/to-your-health/wp/2014/11/12/why-some-people-just-cant-dance-or-clap-to-the-beat/?utm_term=.8579364c9e82) and the 4% of humanity with [congenital amusia](http://www.abc.net.au/radionational/programs/allinthemind/definitely-tone-deaf/8307996).)
  
  It is important to note that I am *not* suggesting that people with such musical disabilities can learn nothing of music; rather, I am suggesting that **a very high level of musicality (such as that associated with the professional musician) may never be realistically attainable**. It is also worth noting that 4% is not a terribly low number; over the course of a teaching career, one would encounter many students with such handicaps to overcome.
  
  Programming requires substantial sequencing ability, a certain intuitive capability to informally understand (and guarantee) post-conditions, and the ability to simultaneously understand multiple layers of abstraction.
  
  Within the normal distributions of abilities, therefore, it stands to reason that there will be a (not insubstantial) subset of people who will have enormous difficulties with the topic. And, similar to music, it may not be that they are incapable of learning any particular aspect of programming, but they may never really be able to pull it all together with any sort of facility, no matter how hard they work.
  
  > **Comments:**
  > **username_39**: I'll admit that some have "enormous difficulties". But that isn't the same thing as "can't learn". Ask Stephen Hawking about difficulties. I'll also admit I have no ability in music. But I have no desire, either.  
  > **username_64**: My experience as a dev (mainly teaching interns/juniors, but also as a quest teacher at our local uni) is that you hit the nail right on the head. The comparison with musical ability is spot on in my view. I tend to give these students the same tough love my guitar teacher gave me: If you like it, by all means continue, but I would look elsewhere for a career if I where you. Maybe they will learn 'eventually'  and with 'enormous difficulties' but the student you described in your question will never get hired here, as we value 'learning speed' over actual knowledge.  
  > **username_65**: +1 for "wiring". I don't have so many data points (only ~20), but I once taught "Intro to Programming for non-CS Majors", easily the most challenging course I ever taught – not because the material was hard, but because so many students found it hard to grasp basic concepts. There were three groups in the class: the "naturals," who programmed with ease from Day 1; the "lost," who struggled with *Hello, World* and struggled even more mightily as the course progressed; and the "learners," who struggled at first but eventually turned a corner. (Only one of my students that term was a learner.)  
  > **username_66**: I can speak to the combination of desire to learn and inability to do so. I cannot hold a tune. In fact, at most, I can only tell that one note is higher or lower than another, no more than that. Yet I still played Clarinet for years. My only reference for whether the note was actually in tune is if someone else told me, I simply had no ability to tell myself. I tried so hard to learn, but I am seemingly fundamentally incapable of hearing if a note is in or out of tune and what the note is or isn't.  
  > **username_66**: I had all the mechanics of playing an instrument down, I just had no way of knowing if what I was playing was actually in the correct pitch. In a similar fashion, I can see a student who understands all the parts to a program but can't make sense of the program as a whole in their mind.  
  > **username_56**: Playing a musical instrument is the analogy I would make.  Programming is pretty natural to me, even without the need for regular practice.  I wish playing the guitar (well, baroque lute these days) were the same.  The hours I have put into practice and I am still useless!  I can play, but I will never play well (I used to say "I play with a guitar" rather than "I play guitar" ;o)  
  
  ---
  
  ### Answer by username_44 on 2017-10-31. Score: 29
  
  > However, every year, I find a small number of students who just don't seem to get it. They get through, but the CS major program becomes harder and harder for them as their four years go by. Must it be this way?
  
  Think of it this way:
  
  An alien lands on Earth. He sees a human, who encounters another human. The first human flips the second one off. In response, the second one flips the first one off.  
  The alien goes on to meet world leaders, scientists, philosophers, ... Every time he meets someone, he flips them off. After flipping them off, the alien's behavior is perfect, he makes no other mistakes. **No one corrects the alien**, because they understand that he's culturally unaware of its meaning and they understand that the alien is trying to say hello. Since the alien is capable of being friendly, no one is really incentivized to address that one mistake that the alien makes. It seems like nitpicking.
  
  After the alien has met with diplomats (and diplomatically minded people), he eventually ends up in situations where there is less goodwill towards the alien's cultural obliviousness. The alien starts noticing that people are reacting less friendly towards him, even though he's still trying to use human greetings.  
  As time goes on, the alien struggles more and more to keep interactions with humans on a friendly level. After several years, he finally fails and ends up in a fight with an angry human.
  
  The inept student, just like the alien, was initially in a position where little to no mistakes could be made (first year only uses simple examples, the alien only meets diplomatically minded people). The flaws of the student/alien are not big enough to fail a test/conversation.  
  But as the student/alien progresses through the ranks, it gets harder (harder examples, less diplomatic people). Eventually, there comes abreaking point where the mistakes of the student/alien are important enough that they **do** prevent a good outcome, and this is where the student/alien fails for the first time, **even though they were making the same mistake all along**.
  
  As a student, it's a curse to only be *somewhat* inept. If you're completely inept, then teachers will focus on you and will make sure that you do it right. But if you're stuck in the "not good but good enough" zone, then you may never receive that attention from your teacher (because they're focusing on students with bigger problems), and you'll never be told that what you're doing is wrong.
  
  When no one tells you that what you are doing is wrong, then you can't know that what you're doing is wrong (or could be improved).
  
  ---
  
  > Is there any evidence or reason to believe that there are students who genuinely can't learn to program?
  
  Yes and no.
  
  Everyone is **capable** of learning programming, but different people will have different levels of **intuition** and will **learn things at a different pace**.
  
  ---
  
  ## Yes
  
  In college, I studied Digital Arts and Entertainment. This course was unique in the world (at the time), because it was both a full-fledged course for artistic design (concept art, freehand drawing, 3D modeling) but also technical game development (programming, ranging into complex geometrical mathematics).
  
  There were two very clear groups in our class: the artists and the analysts (I was in the latter group). The artists passed the art classes without breaking a sweat, but needed to learn programming step by step and never seemed to really intuitively understand something (e.g. int division) without having it intricately explained time and time again.
  
  The analysts, on the other hand, were passing the programming classes with flying colors, but often couldn't manage to design or draw anything halfway decent, especially compared to the artists. They would have to redo freehand perspective drawings many times over, whereas the artists managed to get it right the first time and then had a lot of time left to improve their already succesful drawing (thus creating even more of a gap between the art that the artists and the analysts produced).
  
  This course irrefutably proved to me that some people are wired differently than others. It was so very obvious to see it happen for every class we took. The people who were outclassing me in art class would need my help in programming class, and vice versa.
  
  Out of the 300 students who started the course in my year (I'm already omitting those who gave up midway. 300 students took the final exams of the first year), **8** managed to pass all classes. Almost everyone else got caught up on either the art or the programming.
  
  This was my second time in college, and I have to admit that the % of driven students was much higher than in other courses. There were <10% slackers, most people were spending their nights designing (either games or art, whichever held their fancy).
  
  Seeing less than 3% of students pass both art and programming classes proves the point.
  
  ---
  
  ## No
  
  But then again, 8 students managed to pass.
  
  I personally knew 3 of them. One had not programmed before the course, the other two had never been artistically inclined. So it's *possible* to learn a skill, even if it's almost completely orthogonal to your current skillset.
  
  I'm also a strong believer in the fact that if someone does not understand something; that it simply hasn't been explained to them in a way that makes sense to them (or they haven't been driven enough to find out for themselves).
  
  ---
  
  ## You need to investigate the ignorance.
  
  For your current example, this does mean that we should investigate what exactly she wasn't understanding.
  
  > She couldn't identify the ending condition of the loop
  
  There's a "spectrum" of ignorance here. It's important to figure out which one applies to this student:
  
  * Was she aware of what a `while` is used for in general? (regardless of why it was being used in this particular example)
  * Was she aware that it is an ending condition? (regardless of what the specific condition itself was)
  * Was she aware that this was a boolean evaluation? (regardless of what was being evaluated)
  * Could she explain the evaluations (evaluating if a number is bigger than another number) but not the combined intention of both evaluations (evaluating that the number was between a lower and upper bound)
  
  Based on which of these describes her situation (or something I didn't list), you can work towards filling in the gaps in her knowledge.
  
  To use my college example, if she has an artist's mindset, she may never be able to *intuititively* understand code and read it like a second language, but given enough effort, she should be able to eventually identify what happens.
  
  ---
  
  **Without making this a personal attack on you**, I think it's important to consider that when a teacher considers a student incapable of something, that this could also mean that the teacher is *incapable of teaching it*.  
  As the teacher, you can never be sure which one it is.
  
  This is a variation on the [Dunning Kruger effect](https://en.wikipedia.org/wiki/Dunning%E2%80%93Kruger_effect). If you apply the principles of the effect, that means that it's possible that a teacher's evaluation of a student's incapability to learn something may simply be a misinterpretation. The teacher doesn't know how to teach this student effectively, and therefore considers the student flawed, instead of their own teaching ability.
  
  **This can be subconscious** and is in no way malevolent on the teacher's part.
  
  ---
  
  From my experience with teaching programming (and being taught programming), the most effective way to gauge student skills and also teach them how to read code is to play the **breakpoint guessing game**.
  
  In essence, put some breakpoints in the code (this can be on every line if you want), start the program, and have the students try to **predict** what the next breakpoint will be.  
  *Note: this is very easily gamified. People love betting, so allowing them to bet on the outcome teaches them to figure out what the outcome is.*
  
  For a student who is vastly underskilled and not getting it (as you suspect this student is), you'd expect an inability to make any reasonable prediction, or continuously stating that the next step cannot be predicted.
  
  Step through the whole program. Keep repeating the **same** code over and over again, until she makes accurate predictions (**even if** she's only reciting it from memory rather than understanding).
  
  Once she is able to recite the steps, change **one** thing in the code (e.g. 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.
  
  ---
  
  > **Comments:**
  > **username_67**: I really like this answer, thank you for taking the time to write it. I hope to see you around the site more!  
  > **username_44**: @username_67: You're welcome :)  
  > **username_68**: Learning by prediction/observation gets my +1. A hugely transferrable skill  
  
  ---
  
  ### Answer by username_69 on 2017-10-30. Score: 18
  
  Consider the posibility that this could be a problem with *Java*.
  
  If your first language is APL, and many fail... is a reflect of the students or APL?
  
  Read also:
  
  <http://lambda-the-ultimate.org/node/5481>
  
  > Is Haskell the right language for teaching functional programming
  > principles? No! (As Simon Thompson explains.)
  
  I have learn dozens of languages and have teach a little. Certainly some languages are more problematic when others are not.
  
  ---
  
  My pet theory? I think if we accept that most software is *poorly designed* including programming languages, then users are not only learning how use the program(ing language) but struggling to dechiper the (poor) design and what is the true design beneath.
  
  > **Comments:**
  > **username_0**: Welcome to [cseducators.se]! I hope we hear more from you in the future.  
  > **username_70**: I agree that there are "wrong" languages for teaching programming.  However, if it were possible to develop a "right" language that would permit anybody to learn to program, I'd expect the past half-century of looking for it would have produced at least some hint of success.  
  > **username_69**: Sure it have not existed? What about pascal or python? Is to note that the choice of "language to teach" is driven by the idea of "must be a industry standard" and in some places have been replaced older languages used for years to get trendy. So I'm unsure if this is proven or not.  
  > **username_71**: If the code snippet was using some obscure part of Java, then that could definitely be true.  However this is simple enough that anyone who understands a while statement should be able to answer it.  And inability to understand "keep running this code while the condition here is true" means they truly haven't grasped how code works.  
  > **username_72**: @username_70 Pascal was designed for the specific purpose of teaching programming concepts and good practice -- or at least, good practices as they were understood at the time.  And it was great at teaching, but not that great for large-scale maintenance.  Unfortunately, tools designed to teach and tools designed to be used in large-scale deployment don't always mean the same tools.  And these days we demand that fresh graduates be immediately employable and productive, so they're taught "industry standard" tools instead of "useful for learning" tools like Pascal.  
  > **username_69**: That is only true for the first version of Pascal. It to be only "usefull" for teach is wrong: http://pascal-central.com/ppl/chapter4.html#Myths. Anyway, the point is that some languages are better to be used for teach than anothers, and not mean are pointless for real work... like for example python (that is popular today).  
  > **username_70**: @username_69, Yes, Pascal was created as a teaching language.  So was Python.  So was Basic.  So was Logo.  AppleScript had "anyone can program" as a goal.  Wikipedia lists almost a hundred other languages for teaching people to program.  And yet, somehow, people still have difficulty.  Maybe it's not the language that's the problem?  
  > **username_73**: @username_71 Well, it might be. But there's always the chance that the person not understanding doesn't know Java but knows Python. If you only know Python, there's a decent chance you have no idea what "||" means, since Python uses the more understandable "or" keyword. "&&" would make sense, probably. The "ln" on "println" may have gotten confusing, what the heck is a "myScanner", etc. With only 3-5 minutes looking at it there's also the chance that they misread >/< or something trivial like that too.  
  > **username_71**: @username_73 By the time you get to the third set of lectures though, they should understand "||".  The OP isn't really looking at "println" and "myScanner" - he says she can't even explain "answer" needing an initial value, or what values of "answer" cause the loop to stop. For me, this either demonstrates that she copied answers for earlier classes and never did the work, or that tests for earlier classes weren't effective.  And really it shows that she generally does not understand structured logical reasoning like "if you do this then that happens", which is a concern for a student.  
  
  ---
  
  ### Answer by username_50 on 2017-10-31. Score: 17
  
  I firmly believe that, barring actual mental handicap, anyone can learn to program.
  
  However, this is purely a belief; a matter taken on faith. It is informed in part by some knowledge of psychology and the process of learning, but in these things I am at best an amateur.
  
  The available evidence, unfortunately, does not demonstrate that anyone can learn to program. Even though the infamous “The Camel Has Two Humps” paper has been [retracted](http://www.eis.mdx.ac.uk/staffpages/r_bornat/papers/camel_hump_retraction.pdf), the retraction itself isn’t massively encouraging: the underlying data, according to the retraction, is all still valid and real. The conclusions drawn from that data was too strong, and in particular the actual “Camel” web article that got passed around so much made far stronger statements than even that—but nonetheless, the data is still there. It suggests a problem, and the retraction only says that we don’t know what causes it—not that it doesn’t exist.
  
  Furthermore, the paper cites numerous others in its claims of widespread low academic achievement in computer science: it does not stand alone in *that* claim.
  
  Thus, my conclusion is basically this: it may be, and I dearly hope it to be, that all students can learn to program. However, the available evidence suggests that, if nothing else, *we have not yet learned how to **teach** all students to learn to program.* Whether that is because it can be done and we just haven’t figured it out yet, or because it truly cannot be done, seems to remain an open question.
  
  So I would recommend all computer science educators to try to keep an eye on the state of the art here, and be willing to try new things. The status quo does not appear to be sufficient. It certainly isn’t settled science that there is a population who *cannot* learn programming, so even though that may be true, it is too early to give up on those who are failing right now.
  
  > **Comments:**
  > **username_0**: You may be an amateur in this realm, but that it a perfectly sound analysis. Welcome to [cseducators.se]!  
  > **username_54**: +1. Very sad to see the only answer that tries to bring actual data to CS Educators so low. I wouldn't have thought this to be such a faith based community. Shameful :(  
  > **username_74**: In this paper "Evidence That Computer Science Grades Are Not Bimodal", Patistas et al. seem to prove that the grades are indeed not bimodal...  
  > **username_50**: @username_74 Excellent, glad to hear it. I am not a CS educator, so I have not taken as much time as I might recommend following this topic, but that is a promising sign. I hope there are more studies and more papers that confirm that result.  
  > **username_38**: The problem with "barring actual mental handicap" is that it makes the argument effectively circular: "Except for those people who cannot learn to program, everyone can learn to program."  
  > **username_50**: @username_38 The word “actual” was meant to pin things down to handicaps that are widely recognized as a medical diagnosis, which would prevent a “no true Scotsman” issue like you describe.  
  > **username_38**: @username_50: That's well phrased and anticipated, but I don't think that avoids the problem. People with medically-diagnosed handicaps are students (just to reference the OP's exact question phrasing), too.  
  
  ---
  
  ### Answer by username_60 on 2018-02-25. Score: 11
  
  This is all from my own personal experience, no research: I believe all students can learn to program, and can "get it", barring some mental handicap. But they have to have the desire, as many have stated - that's the kicker. And you, the educator, must have the patience to stick with them until they "get it".
  
  I have been a computer science educator for six years at the high school level. Prior to that I was in software development. I tell my students they are all climbing a mountain. I tell them some will reach the top and see into the promised land well before the others. But, I tell them, if they will work hard, and not give up, they will all eventually reach the peak of that mountain and see over.
  
  And I see that happen. Some of them reach the peak in Programming I (at my school that is Visual Basic). Some of them are still struggling toward the peak in Programming II (C#). And some of them give up before they reach the peak. They drop the course or don't take Programming II at all. But those who stay the course, pun intended, almost always develop a deep understanding and love for coding, and I see them in Programming III (AP Java), which is my goal.
  
  For what it's worth, here are some "tactics" that may be useful to others:  
  1) Allow students to turn work in "late". Yes, those programs were due yesterday, but you kept working and have them ready today? Good for you, for persevering! Of course I'll take them.
  
  2) Conversely, allow students who are always finished quickly to move ahead in the course or give them "challenge" exercises to complete. Or send them to a web site like HackerRank where they can practice their code and compete with others.
  
  3) Also allow students who are finished quickly to move around the room and help others, if they desire. But don't force them. And pay attention that they're not just "dictating code" to others. Instruct them that they must explain or give direction only. Some students are really good at this and enjoy it. (FYI my school is on the block schedule with 90 minute classes. We are in a lab and when I am not instructing my students are writing code.)
  
  4) Preach Carol Dweck's growth mindset. Effort == success.
  
  5) Seat students so that those who are struggling are next to someone who has only *slightly* better understanding than they do. They will naturally work together because they are both lost a lot, and the one who understands a little bit more will spend a lot of time explaining to the other, thereby gaining confidence. The one who has slightly less understanding will also gain confidence because they will realize they are not the only one who doesn't get it instantly.
  
  6) Make them write code on paper, both for practice and for tests. So many students become dependent on their "smart" IDE and don't know their syntax!
  
  7) As a corollary to the previous, emphasize the necessity of memorizing syntax. Whether you understand it or not, you can memorize the syntax of a for loop to iterate through an array.
  
  8) Remind them that they didn't learn something they are good at overnight, nor did they do it perfectly the first time. Programming takes practice, just like anything else. And sometimes they may have to move ahead without fully understanding what they just did. As they use it more, one day it will come to them.
  
  9) This is similar to someone else's idea about "predicting" in the debugger: make your students "read" their code to you. I make mine, periodically and individually, tell me, line by line, what a piece of code THAT THEY WROTE is doing. If they can't, I tell them to go home and study it and try again tomorrow.
  
  10) Structure programming assignments with "levels" of scaffolding. In your Word document, or web page, or however you give the assignment, give a high-level overview of what the program is supposed to do first. Students who have understanding will take it and run with it. Then, after the high-level description, for students who need more, provide a more detailed description with pseudo-code or code snippets. This will allow more students to be able to do the program and to feel successful.
  
  11) Celebrate small victories. When a student finally gets something, even something simple, get excited. Encourage them not to give up, and when they don't, when they persevere, and they have a breakthrough, no matter how small, praise them!
  
  12) Sometimes you have to have a frank but gentle conversation with a student - if you hate this, and don't want to put in the time necessary to really GET the topic, then why are you here? I would wager that the girl who didn't understand the while loop after several semesters of instruction was spending little time outside of class studying about what a while loop was, when and why you use it, and practicing coding with it. She was depending on an instructor to "teach it" to her, to feed her like a baby bird. She didn't want it badly enough.
  
  OK, I've said enough, I know a lot of this is anecdotal, but I hope some of it is helpful to someone.
  
  > **Comments:**
  > **username_39**: Welcome to CSEducators. You show a sophisticated view of teaching that I hope you will bring back here often.  
  > **username_0**: Agreed. Welcome to our community!  
  > **username_60**: Thank you, username_39 and Ben, I am excited to be here!  I hope to learn a lot!  
  > **username_61**: Now this is the kind of answers we need on this site. And six years of teaching might not qualify as "research" in you lexicon, but most research is based on experiential data, whether it's acknowledged or not. Along with username_39 and Ben, I'm glad to see another thoughtful voice in on our site. __Welcome__  
  
  ---
  
  ### Answer by username_62 on 2017-10-31. Score: 9
  
  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.
  
  > **Comments:**
  > **username_12**: 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.  
  > **username_63**: "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.  
  > **username_63**: From context, his grandmother would have been born Lady Frances Anna-Maria Elliot-Murray-Kynynmound, the second wife of Sir username_49 Russell, once British Prime Minister. They lived in Pembroke Lodge.  
  > **username_31**: Locks: walk to where there is a small stream with a little pond in it. Block the upper end, observe, unblock. Block the lower end, observe, unblock. Done. Teaching is about pointing the nose in the right direction and getting out of the way. Sometimes it just takes a bit more time and effort to get to the right place.  
  
  ---
  
  ### Answer by username_29 on 2017-10-31. Score: 6
  
  # 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. E.g. 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).
  
  > **Comments:**
  > **username_30**: [Affects](https://en.wiktionary.org/wiki/affect#Noun)? [Effects](https://en.wiktionary.org/wiki/effect#Noun)?  
  > **username_31**: When I first learned Lisp in college I could see why it worked and was so powerful (you can do essentially everything it is possible to do, you'll just have to build the universe yourself), but I thought it would be easier to tackle something more "domain specific" and less free-form, initially. There's a reason Fortran was so successful: it was designed to implement formulas, which is what the users normally did all day. Few people spend their days making new universes. When I learned C in college, I thought, ok, now I can finally learn: *how can such a thing as a computer possibly work?*  
  
  ---
  
  ### Answer by username_32 on 2017-11-02. Score: 5
  
  (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.
  
  > **Comments:**
  > **username_31**: It is an insight, a clue. Remapping has to do with treating things symbolically, not in a fixed way. If you see a world of as-if where everything just happens to be a certain way but could easily be different, then it will be easier to think and manipulate programs and data that way. As a snarky, jaded kid who thought everything was arbitrary, wrongly set up, unfair and inflexible, I saw copious opportunities to remap basically everything. Why is Joe so great? If he was 3 inches shorter, then everyone would like Tom better! See? It's one small step to manipulating joe and tom as variables.  
  
  ---
  
  ### Answer by username_33 on 2017-11-02. Score: 4
  
  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.**
  
  > **Comments:**
  > **username_31**: They used to force everyone through all these math classes, now it is programming. What is the objective? Formal Operational thought. You must get that if you are going to have more complex work. Get it somehow: be a team username_55, join the Army, just get it. Programming is easier to fit in to the classroom, and more fun than math. Math never made a web page.  
  
  ---
  
  ### Answer by username_37 on 2017-11-02. Score: 4
  
  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.
  
  > **Comments:**
  > **username_31**: Yeah, recursion is not an everyday thing in most people's lives. You've learned the forest and can walk around blindfolded but students keep smacking in to trees they can't recognize. What's *different* about programming? Symbolic manipulation. It's not the everyday way of approaching a problem, and some problems cannot be solved without it. Teach that. Math was the 'way' in the past but we need to move on.  
  
  ---
  
  ### Answer by username_38 on 2019-12-23. Score: 4
  
  I think the answer is "yes".
  
  It seems obvious that there is a segment of the population with severe intellectual disabilities, severe learning disabilities, brain damage, cognitive inability to read or do problem-solving, etc., who will be unable to do programming. The real, difficult, question is: What percentage of the population is that? (Or perhaps, as educational leaders with limited time and resources: For what sort of students is it profitable for us to invest resources into their programming education?)
  
  As partial evidence, it seems clear that on the continuum of subject matter, computer science is intellectually demanding in a special way. [Benneden/Caspersen start their 2007 article](https://dl.acm.org/citation.cfm?id=1272879) with the following:
  
  > It is generally accepted that it is very difficult to learn to
  > programming. For example Bergin and Reilly note that
  > *It is well known in the Computer Science Education (CSE) community that students have difficulty with programming courses and this can
  > result in high drop-out and failure rates.* (p. 293).
  
  Current data show that computer science has the highest dropout rate of any college major. E.g.: [10% of UK CS student drop out in the first year](https://www.computerweekly.com/news/252467745/Computer-science-undergraduates-most-likely-to-drop-out), with next-highest major at about 7%. (see [HESA data](https://www.hesa.ac.uk/news/07-03-2019/non-continuation-tables), 2017-2018, Table NC1). Similar discussions are seen in [Ireland](https://www.irishtimes.com/news/education/concern-over-drop-out-rates-in-computer-science-courses-1.2491751) and [Trinity College](http://trinitynews.ie/2016/02/why-are-computer-science-drop-out-rates-so-high/), etc. Borzovs et. al. in [Latvia 2015](http://journals.ru.lv/index.php/ETR/article/viewFile/175/680) share their motivation for a study this way:
  
  > In recent years the observed practically stable trend to lose from
  > one-third to half of students in the first year of computing studies
  > motivated us to explore, whether the world has not found indeed a
  > method, how to determine in advance such applicants that have no
  > chance to overcome the first study year. On the one hand, the dropout
  > students and the teaching staff have wasted their resources...
  
  Benneden/Caspersen show an overall worldwide dropout rate of about 33% from the programs that responded to their survey (about 12%). Interestingly, it's almost impossible to find hard data from U.S. 2-year programs, but I think the following estimate is accurate:
  
  > A colleague from the ACM Education Council mentioned an internal
  > report of community colleges (two-year schools) in the US who were in
  > a coalition to improve their retention rates in CS. One school
  > reported an average failure rate, over a ten year period, of 90%!
  
  Related, on SE Mathematics Educators, we have the question: [What fraction of the population is incapable of learning algebra?](https://matheducators.stackexchange.com/questions/11396/what-fraction-of-the-population-is-incapable-of-learning-algebra/) Ben Crowell, looking at demographic and standardized-test scores, has an answer where he estimates around 50%. Separately, I found an overview of research into Piaget's theory of learning stages (Mary Carol Day, ["Thinking at Piaget's Stage of Formal Operations"](http://www.ascd.org/ASCD/pdf/journals/ed_lead/el_198110_day.pdf), *Educational Leadership*, October 1981), which found that among those tested, only a similar 50% could ever perform at the terminal "formal operational stage", which would seem highly related to performance in math and computing:
  
  > Piaget's position has often been used to predict that one who can
  > think in a formal operational manner will always do so. However, only
  > about 50 percent of those over 12 years of age who are presented with
  > tests of formal operations perform in what would be considered a
  > formal operational manner. This is true of college-educated adults as
  > well as adolescents. In addition, even people who use formal
  > operational skills on one task may not use them on another.
  
  Anecdotally, when I started teaching CS courses at a community college about 20 years ago, my starting assumption was a passionately-held "no, of course anyone can learn programming!". That particular ship broke and sank on the first day, when I sat with a student after class for an extra 3 hours trying to get him to understand the first lab, until he said, "I just can't get this", and walked off. Now I'm going to believe what that student told me, as I've seen it many, many times in this context. In fact, in some cases I think it's cruel and dispiriting and immoral to continue encouraging some people to pursue CS programs, e.g., after they've failed to pass CS1 for several semesters in a row. My instinct would be to politely challenge those who think otherwise to try and teach CS at a U.S. open-admissions community college for a semester.
  
  I will hold forth that there's a fairly large segment of the population that can never understand the concept of a *variable* no matter how much or long or how many strategies they use to try. This is similar to the observation by Joel Spolsky, one of the founders of the Stack Exchange network, [who wrote](https://www.joelonsoftware.com/2006/10/25/the-guerrilla-guide-to-interviewing-version-30/):
  
  > I’ve come to realize that understanding pointers in C is not a skill,
  > it’s an aptitude... *For some reason most people seem to be born
  > without the part of the brain that understands pointers*.
  
  > **Comments:**
  > **username_39**: Sorry, but "can't learn" and "difficult to learn" are completely different.  
  > **username_38**: @username_39: Re: "can't" vs. "difficult" -- they're not the same, but one is evidence for the other. Especially in the overall context of the rest of my answer.  
  > **username_39**: Actually no. People drop out for a lot of reasons. They fail to learn for a lot of reasons. One is poor teaching. Another is no real desire to learn. Sometimes when a field is advertised in the popular press as having good employment prospects (CS often) people flock to it with no idea about what it is and then drop out when they learn it is hard work. But, desire is the key, not any innate ability or lack of it.  
  > **username_39**: Hmmm. You down vote my answer for lack of evidence, I see. But I happen to know (and have worked with) some of the people you mention here and they don't come to the same conclusion you do, so your "evidence" is misleading..  
  > **username_38**: @username_39: I would be skeptical of that. If you could link to the counter-conclusions by some of those people I think that would be very valuable for all of us.  
  > **username_39**: They have a public presence. You could ask yourself.  
  > **username_38**: @username_39: You've made positive claims and the burden of proof for them is on you. You haven't even told us which of the people referenced in my answer you're talking about.  
  > **username_31**: Ok, I think the Formal Operations part has to be crucial to the 'answer' . Also Executive Functioning (focus, persistence, winnowing options) and, yeah, desire. All Of The Above. But without Formal Ops, boy, it's going to be tough sledding. We have to teach that *before* college, it's almost too late by then. Thus the "can't learn this" aspect. If you're not a gymnast by age 10, you probably never will be. Programming is kind of like watching yourself think and then manipulating *that*. Few people tend to do it. But enough about me.  
  
  ---
  
  ### Answer by username_40 on 2017-11-01. Score: 4
  
  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.
  
  > **Comments:**
  > **username_31**: But, but... Formal Operations too.  
  
  ---
  
  ### Answer by username_34 on 2017-11-07. Score: 3
  
  I was a CS student for several years and therefore a programming student for several years. In many different classes/groups that I was in there were always the ones who could program and the ones who just didn't get it. I believe that some people have a knack for some things and some people don't.
  
  Things like music or drawing or math or programming logic/algorithms, etc. I tried to teach some people and no matter what I did they couldn't do even the most basic programs. Of course you can eventually teach people things, some one with a lot of learning and practice can get good at drawing but it's unlikely they'll do it as good as someone who already has a natural knack for it.
  
  It is weird when you can see it all clearly in your head, the loop, the values that $i takes, the calculations, how the array is formed and the other person doesn't get it even when you write it down and show it to them. But this is normal, it's the way we are. Sure this person can make the effort, learn but they will never "get it". They'll always need extra time, resources and testing or they can study CS and focus on other things like I don't know networking, modules, database design, etc.
  
  
  ---
  
  ### Answer by username_35 on 2017-10-30. Score: 3
  
  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.
  
  <https://blog.codinghorror.com/separating-programming-sheep-from-non-programming-goats/>
  
  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](https://web.archive.org/web/20090401003425/http://www.cs.mdx.ac.uk/research/PhDArea/saeed/) ) 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.
  
  > **Comments:**
  > **username_0**: Welcome to [cseducators.se]!  It might be worth noting that the study he is citing was partially retracted, as I described in my answer [here](https://cseducators.stackexchange.com/a/784/27).  
  > **username_36**: I really wish Jeff Atwood would post an update / disclaimer on that blog post  
  > **username_37**: 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.  
  > **username_30**: The paper sourced in this answer and on CodingHorror blog [was retracted by its author](http://retractionwatch.com/2014/07/18/the-camel-doesnt-have-two-humps-programming-aptitude-test-canned-for-overzealous-conclusion/).  
  
  ---
  
  ### Answer by username_41 on 2018-02-23. Score: 2
  
  Many of the existing questions are excellent, but I'll throw my two cents in:
  
  > Is there some meaningful percentage of students who can't learn to program?
  
  **What is programming?**
  
  The problem is that **programming** can mean many different things. I remember a discussion on this site where somebody suggested using Excel spreadsheets as an introduction to programming. I would have failed that class, and I would have realized that I just wasn't cut out for programming.
  
  Programming with a focus on command line interfaces is a step up from Excel spreadsheets, but it's still alienating and disengaging for many students.
  
  *"But command line programming is the simplest form of programming!"* Command line programming can seem straightforward to more experienced users, and we can see it as the simplest form of programming. But that's not true for people who haven't worked with a command line in their daily lives. *"I use websites and apps every day, and I'd love to learn more about creating that stuff, but if programming is just staring at a command line all day then maybe this isn't for me!"*
  
  **Frame Things Differently**
  
  So although this student had trouble wrapping their brain around command line programming, maybe they'd have better luck with other types of programming: maybe they'd be able to better reason about robotics, or code that outputs a physical drawing, or more creative coding? Maybe if the output was a webpage instead of in a terminal, they'd have to spend less time remembering how the terminal works.
  
  In other words, it's not that students can't learn programming. It's that they have trouble reasoning about a particular type of programming. The answer is not that they can't program, the answer is that they need to be introduced to programming using topics that engage them.
  
  **Line by Line**
  
  Similarly, maybe the student has trouble explaining their thinking to a teacher. *"Okay they asked me a question. Oh god. They want to know why the number is initialized outside the loop. How should I know, I didn't write the code! Oh no I'm not saying anything, this is awkward. Maybe if I stay silent they'll give me a hint. Wait what was I supposed to be answering again?"*
  
  The answer to this is to encourage students to [break things down into smaller pieces](http://happycoding.io/tutorials/how-to/program). Don't ask the student why the variable is created outside the loop. Ask them what the first line of code does. Then ask them what the second line does. Have them work through it line-by-line, and then have them combine that into a bigger picture. This is a very hard thing to teach, and I think many students get stuck trying to understand entire pieces of code instead of just focusing on one line at a time.
  
  *"I must not be cut out for programming, because I can't look at 10 lines of code and tell you what they do."* Neither can I, and I've been programming for my entire adult life. I look at one line at a time.
  
  **Gym Class**
  
  When I was in school, I hated gym class. I hated basketball, and I hated running the mile. I'm sure if you would have asked my gym teachers, they would have told you that I'm part of the certain percentage of students who simply can't learn to be physically active. That lasted pretty far into my adult life. *"Maybe I'm just lazy."*
  
  But the thing is, I love hiking. I love just walking around a city. I love riding my bike, and I love running, as long as I can do it with headphones in and at my own pace. I wish I could go back in time and introduce younger me to this stuff. What would gym class have looked like if it had included these types of activities?
  
  Sorry for going off-topic, but I think about that whenever I hear people say that "some people can't learn programming". I don't think it's that some people can't learn programming, I think it's that we often have an overly restrictive definition of what programming is, or how we frame programming.
  
  Programming doesn't take some magic brain part that only certain people have. Whenever I hear the argument that some people can't program (especially when that argument comes from established successful folks), I cringe pretty hard. It always comes off as discouraging (especially to people from under-represented groups) and gate-keeper-y to me. We can do better.
  
  Just like every other creative endeavor, learning how to program requires engagement, and breaking things down into smaller pieces, and tons of practice. Maybe it takes a little more of those things than other subjects (probably as a result of most students not seeing programming until high school or college), but I honestly think anybody can learn how to program. It's "just" a matter of finding out which type of programming they're interested in. But that's a whole other question.
  
  
  ---
  
  ### Answer by username_42 on 2017-12-07. Score: 2
  
  I'm going to be quite honest.
  
  **Why the heck do you care?**
  
  Even if there was such a thing, you could never know if that student was truly in that category of unable, or if it just hadn't clicked for them yet. You could never know if you were biased, if the student had never learned how to learn, if something else was going on you didn't know about, if a previous teacher had mistaught them, if, if, if.
  
  Even if there was such a thing, it shouldn't impact your judgement.
  
  ---
  
  If a student is struggling, there's a couple of important things:
  
  1. Do they understand any prerequisites necessary?
  2. Do they know how to learn?
  3. Do they remember what they've learned in the past?
  4. Do they understand what they've learned in the past?
  5. Do they know how to build up on what they've learned in the past?
  
  By prerequisites I mean primarily math skills. There are plenty of kids in my grade who struggle with basic math facts like 5\*9, or order of operations. That inability also damages coding ability. Further, a lot of the logic taught in math comes over to CS/coding. Math practice may be necessary to help give them more confidence.
  
  A lot of students don't know how to learn. Maybe they've had it easy in school. Maybe it's been hard for them all along and they've just checked out. Maybe they've been struggling but don't really know how to do it other than cram for a test.
  
  Teach them how to learn - taking notes, understanding conceptually, understanding practically.
  
  A lot of students, especially in countries where there's a summer break, forget a whole lot over the summer, over the months, etc. Do they even remember what they've learned? I sure as heck couldn't tell you what we talked about a year or two ago. Do they remember what a variable is? Do they remember how loops work?
  
  Even if they remember the concepts, it's even harder to actually understand them, and be able to apply them themselves in their own thinking. Explore what they mean beyond just definitions and coding, but what they mean intuitively.
  
  Lastly, perhaps they know and understand concepts, but they don't know how to build on them. That requires practice and patient teaching, and then a little waiting for that aha! moment when it all clicks and settles into the framework of what they've learned. Help them make connections to other topics.
  
  ---
  
  I said earlier in this, "even if there was such a thing". I don't believe there is such a thing. I don't exactly have evidence to back it up. I just have two reasons.
  
  1. People are amazing. I could tell anecdote after anecdote about someone who would have looked, to teachers, below average - but as a friend I could see that they were way more intelligent than the teachers thought.
  2. I can't believe that as a matter of principle. If other people might be limited at learning, I might be too. I don't want to think that. I want to believe that with enough hard work, I can learn what I wish to learn. Sure, others might, probably will be, better at it than me. But I believe I can learn it, whatever it may be.
  
  > **Comments:**
  > **username_0**: You are making a huge assumption that this would be used to evaluate students instead of to self-evaluate as a teacher. I would never give up on a student, really for all of the reasons that you just outlined. But part of the emotional life of a teacher is that you *really want* to do a good job. It matters to you. So, when I look at my own numbers, I also need a way to contextualize them. Am I doing a reasonable job, or do I need to go back and rebuild everything from the ground up?  
  > **username_39**: I guess I didn't read it the same way @BenI. did. I think the advice is good, and yes, you _can_ be doing a "reasonable" or even excellent job and _still_ need to at least reevaluate everything. Hmmm, what could I have done to reach the three that failed the course??? Maybe nothing, but you need to think about it.  
  > **username_42**: @BenI. I missed that interpretation ;) I guess I would say that, confronted with a student who was struggling, checking that they know how to learn, know basic math facts, etc, etc, would be an important first step to knowing whether it's your teaching or whether what they learned in the past.  
  
  ---
  
  ### Answer by username_43 on 2017-10-31. Score: 1
  
  > 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.
  >
  > Albert Einstein
  
  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
  
  > **Comments:**
  > **username_44**: 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.  
  > **username_43**: True, that's why i used the word suggest, it's different than saying "you suck"  
  > **username_44**: 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.  
  > **username_45**: 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.  
  
  ---
  
  ### Answer by username_45 on 2017-11-01. Score: -1
  
  Yes, absolutely. I'm not an educator myself but I've been a programmer for a long time.
  
  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?
  
  > **Comments:**
  > **username_46**: Welcome to [cseducators.se]! This answer could be much better if you expand and add explanations to it.  
  
  ---
  
  ### Answer by username_47 on 2017-11-01. Score: -1
  
  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.
  
  > **Comments:**
  > **username_46**: Welcome to [cseducators.se]! This answer could be much better if you expand and add explanations to it.  
  
  ---
  
  ### Answer by username_48 on 2017-11-01. Score: -2
  
  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.
  
  > **Comments:**
  > **username_49**: "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.  
  
  ---
  
  