Answers.Body: <p>I was thinking about this over the week.</p>
  <h1>First how will it affect programming outside of education.</h1>
  <p>We have in the past invented higher level languages, that replace lower level languages. So nothing new. However we will NEVER get to the point that we can just write in English. This is because English is a terrible programming language: too ambiguous.</p>
  <h1>So what will the AI be good at?</h1>
  <p>It will get good at solving standard very well specified problems, with little ambiguity. That is the sort of problem that one would see in an academic assessment.</p>
  <h1>So what does this mean?</h1>
  <p>It is little different in type to the problem of assigning students to write an assembler-language program, and they writing it in <code>C</code>, compiling it, and handing in the result, Using a calculator, or downloading an answer off of the web.</p>
  <h1>What to do about it</h1>
  <p>Adapt: I will leave this for others to consider how. But not we have done it before. There is nothing now here.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-05-01T12:51:26.423Z
Answers.Text: This isn't answering the question, which was how it will affect teaching programming.  "It is no different in type to the problem of assigning students to write an assembler-language program, and they writing it in C, compiling it, and handing in the result." this isn't actually true.  As I pointed out, it means that the students can produce code that they don't understand.  I have already observed this as a result of students being able to manually download code from the WWW, having a tool to do it for them makes that worse.
Answers.UserDisplayName: Dikran Marsupial
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-05-01T13:12:45.960Z
Answers.Text: BTW I don't think it is a good idea for undergraduate assignments to be very well specified with little ambiguity.  That causes the student not to think about the specifications, or question them.  I have a forum for students to ask questions about the specifications of the coursework (so all students can see the answers) and I encourage them to look for ambiguity or issues with the specifications.  It is part of software development.
Answers.UserDisplayName: Dikran Marsupial
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-05-01T21:13:07.393Z
Answers.Text: @DikranMarsupial I agree, and have read and agreed to many of your other comments. But I do think there are similarities to the past, but not exactly the same type. However, the conclusion "adapt", I think is probably correct. Sorry to not give any advice on how to do this.
Answers.UserDisplayName: ctrl-alt-delor
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-05-02T10:42:35.057Z
Answers.Text: @crtl-alt-delor a discussion of *how* it will affect teaching would also be of interest.  It is somewhat of a concern that these tools are being developed without any investigation of their effect advantages and disadvantages.
Answers.UserDisplayName: Dikran Marsupial
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-05-01T12:27:56.367Z
Answers.LastActivityDate: 2022-05-01T21:10:23.023Z
Answers.LastEditDate: 2022-05-01T21:10:23.023Z
Answers.UserDisplayName: ctrl-alt-delor
Answers.Body: <p>Isn't this the next step in the natural progress of computer sciences?</p>
  <p>New &quot;layers of abstractions&quot; were constantly introduced, over decades.</p>
  <p>CS moved on</p>
  <ul>
  <li><p>from machine instructions to assembly code</p>
  </li>
  <li><p>from assembly code to high-level languages like C</p>
  </li>
  <li><p>from high-level-languages to 4th level languages like SQL</p>
  </li>
  <li><p>from declarative languages to no-code/rapid-application developments
  environments,</p>
  </li>
  <li><p>and now the AI-powered tools like Copilot are here (based on language models and knowledge graphs)</p>
  </li>
  </ul>
  <p>They will just become part of the curriculum.</p>
  <p>None of these developments  have made any previous body of knowledge obsolete. Neither when they were new, nor when they matured over the years.</p>
  <p>Each time there were some people concerned that old-school skills will die out, or this will degrade students capabilities.</p>
  <p>(Students' average apperception might still go down, due to other reasons: computer hardware that cannot be tampered with; greater societal inequality; underfunding of teaching and education in general,... all of which are more serious threats that the rise of AI-based programming aids.)</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-05-01T17:54:14.407Z
Answers.Text: No, I doubt it.  The problem is that these AI tools don't understand the code they produce.  If the programmer doesn't either, that is hardly a recipe for reliable good quality software.  So how do we teach programmers to understand code if they don't write it (and as typical pedagogical tasks are likely in the training set the AI tools can answer the exercises we currently use to teach understanding).  They are basically a quick way to look up/launder code on the WWW.
Answers.UserDisplayName: Dikran Marsupial
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-05-01T18:02:02.260Z
Answers.Text: I don't think that these AI tools can be looked on as a level of abstraction as it isn't clear what they do or how they do it (or what they are going to do), and they don't necessarily produce good code.
Answers.UserDisplayName: Dikran Marsupial
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-05-01T18:10:11.607Z
Answers.Text: At each "step" there were always trade-offs between correctness, productivity enhancements/ convenience and performance-losses/inefficiencies/larger overhead (due to being farther away from the bare metal).
Answers.UserDisplayName: knb
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-05-01T19:05:39.040Z
Answers.Text: is there a correctness trade-off in compiler?
Answers.UserDisplayName: Dikran Marsupial
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-05-01T21:08:48.700Z
Answers.Text: Some compilers you can tell to be fuzzy,e.g. specify how Typescript 2.0's "null- and undefined-aware types" or how its "control flow based type analysis" should work in detail (for edge cases), Aggressive optimization in gcc compilers (`-O4, or -ffloat-store`) comes with trade-offs w.r.t thread-safety or numerical accuracy AFAIK. I'm not an expert in this matter.
Answers.UserDisplayName: knb
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-05-01T21:15:40.180Z
Answers.Text: the compiler is still conforming to a specification (even where it's behaviour are undefined, they are defined as undefined).  AI tools on the other hand have no guarantees that the code they produce will do what you ask it to.  I am not against the use of these tools by people that understand the code they produce.  My question is about how they will affect the production of programmers capable of using them safely.
Answers.UserDisplayName: Dikran Marsupial
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-05-01T17:40:32.540Z
Answers.LastActivityDate: 2022-05-01T18:02:48.773Z
Answers.LastEditDate: 2022-05-01T18:02:48.773Z
Answers.UserDisplayName: knb
Answers.Body: <p>There are two cases actually. One is programming education directed at the vocational market and the other is computer science education. The latter isn't really about programming.</p>
  <p>For the first case, if programming skills become obsolete then people will need to take up other things to get a job. They might not be computer related at all. Buggy makers still exist, but it is a niche market.</p>
  <p>For computer science education, on the other hand, the curriculum will change. It will still be necessary to produce programs in the early part of the curriculum, but different tools will be used, possibly AI tools. For the later part of the curriculum programming in some high level language will probably still be needed, just to drive the understanding of future academics. Algorithmic thinking will likely still be needed for a couple of generations minimum. Producing better AI tools will require deep understanding, some of it at least related to programming.</p>
  <p>There are relatively few places now where 360 assembly language is the first course taught as it was many years ago when that was the only available tool. Now we use higher level languages that permit a more abstract view of a program and we have compilers that translate the higher level constructs directly into machine code. An assembly language is probably taught somewhere, though, perhaps in an architecture course. The same will likely be true as we advance, with the lower level tools replaced by higher level ones, including AI.</p>
  <p>So, things will change, but not fundamentally for, I predict, quite a long time. I once met Joel Moses who predicted (around 1973 or so) that FULL AI was only about ten years away. And so it has remained ever since.</p>
  <p>All advances make the solution of harder problems more amenable to solution. As AI advances it should be the same.</p>
  <p>In truth, I find current AI to be a pretty restricted thing. One can solve certain sorts of problems, but the methods and results are pretty constrained, and often erroneous. It is difficult to trust a lot of AI, even things like neural networks if it can't give a verifiable explanation of how it arrives at its outputs. Too much of it fails that test. In particular, the driving data of a lot of AI is, itself, flawed and in ways we don't understand yet.</p>
  <p>A CS education is directed at more than practitioners. It is an exercise in changing the brain. Many bachelors graduates go into programming as a first task, but that isn't why the major exists. The same is true of most other undergraduate degrees.</p>
  <hr />
  <p>One test you could use to determine whether a program producing AI has &quot;arrived&quot; is whether it can produce itself. A <a href="https://en.wikipedia.org/wiki/Quine_(computing)" rel="noreferrer">Quine</a>.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-04-07T14:08:18.553Z
Answers.Text: I think my concern is more that it will be difficult for students to gain understanding and develop algorithmic thinking if they are using tools that do these things for them.  AI is quite a good example of this as there are an awful lot of practitioners that are using tools (such as SciKit learn) following recipies that they have seen on blogs to solve problems without having a fundamental understanding of the methods they are using (and likely finding pitfalls without knowing about them).
Answers.UserDisplayName: Dikran Marsupial
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-04-07T14:25:23.687Z
Answers.Text: I don't think programming skills actually will become obsolete (because the AI we have is not going to understand what it is doing), just jobs for junior programmers.  We will still need programmers that understand the program, it just isn't clear that an eduction with AI tools widely used will produce them.
Answers.UserDisplayName: Dikran Marsupial
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-04-07T21:33:21.403Z
Answers.Text: Eh? I think I trust you (or me!) to be intelligent, even though I'm sure you can't use your intelligence to produce a copy of your own intelligence; conversely, it's easy to write a quine in most languages, and those quines are not intelligent merely by virtue of being able to reproduce their own source, because that's all they can do. I think your answer would be improved by removing the parenthetical aside.
Answers.UserDisplayName: Patrick Stevens
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-04-07T21:41:33.713Z
Answers.Text: @PatrickStevens, actually, a Quine can contain arbitrary other code. Read Ken Thompson's Turing Award Lecture: [_Reflections on Trusting Trust_](https://users.ece.cmu.edu/~ganger/712.fall02/papers/p761-thompson.pdf) (PDF).
Answers.UserDisplayName: Buffy
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-04-07T21:42:39.870Z
Answers.Text: I do know that, and have read the paper. My point stands that "quine" is unrelated to "intelligent", and I don't see its relevance to your answer.
Answers.UserDisplayName: Patrick Stevens
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-04-07T21:45:35.060Z
Answers.Text: @PatrickStevens, you miss the point that even though a programmer can produce a Quine it might be interesting if an AI could do it. And note that in general at the moment and for the past 60 years, AI programs are not _intelligent_ in a real sense.
Answers.UserDisplayName: Buffy
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-04-07T21:47:05.510Z
Answers.Text: Well, Codex can almost certainly produce a quine, though not a quine which contains Codex. But I can't produce a quine which contains me, either, so that's an extremely unfair demand!
Answers.UserDisplayName: Patrick Stevens
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-04-08T07:01:16.883Z
Answers.Text: If copilot can "generate" a fast inverse square root function, I'm sure it can generate a quine provided there are some in the dataset it is trained on.  I don't think the current direction of "AI" is going to produce understanding any time soon.  But then again it is possible to do a fair bit of coding without understanding - codex and copilot are not doing anything that some students haven't done for decades, just faster.
Answers.UserDisplayName: Dikran Marsupial
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-04-08T23:17:07.890Z
Answers.Text: It is not very hard for a human to produce another human. Animals and plants reproduce themselves pretty well too. Even bacteria do it. It doesn't take intelligence to produce intelligence. This is why I keep saying that it will 'evolve' (literally, to give off) quite suddenly. We didn't try to duplicate bird muscles to make an airplane.
Answers.UserDisplayName: Scott Rowe
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-04-30T20:28:43.327Z
Answers.Text: I'm actually not sure I agree with the start of this answer - I'd call the counterpoint K-12 math education and the presence of Wolfram Alpha and similar programs. Hard to use them effectively and catch when you set it up wrong if you don't know the underlying principles to begin with.
Answers.UserDisplayName: auden
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-04-07T13:16:17.773Z
Answers.LastActivityDate: 2022-04-07T13:31:44.033Z
Answers.LastEditDate: 2022-04-07T13:31:44.033Z
Answers.UserDisplayName: Buffy
Answers.Body: <p>I don't think AI code is a serious game-changer for hiring or education in the short term, even giving it the benefit of the doubt in terms of its power, which is still limited. You mention the problem of students plagiarizing solutions available online, but hired humans are likely just as big of a contributor to cheating, and similar to AI in that the cheater need only state the specification to get the code.</p>
  <p>Sure, AI assistants are more accessible than tracking down (and potentially paying) a human to complete an assignment, but at the end of the day the outcome is more or less the same, assuming the cheating isn't caught: a student gets a good grade on an assignment, course or exam that they didn't deserve, or a prospective employee gets hired for a job they're unqualified for.</p>
  <p>The problem in both student and employee cases is that they've created an unsustainable situation in their immediate future. For the student, later assignments/exams/courses are going to get harder, and if they've never built a solid conceptual foundation, then they'll either have to come clean and work extra hard to fill in knowledge gaps, or they'll have to resort to further cheating to keep up appearances. Same for the employee: they're hired, but it'll likely be a huge struggle if they're unqualified, with disastrous consequences for them and the employer. And these are the &quot;lucky&quot; ones who weren't caught immediately.</p>
  <p>The techniques for catching cheaters don't seem significantly different between AI and existing cheating approaches. For example, you can ask students/candidates to explain their code verbally (written responses are easily hired out to a human) and/or watch the solution coded live. Of course, verbal isn't a perfect foil or terribly scalable (I've participated in MOOC classes of over 500 students to a teaching staff of about a dozen), complicated by remote hiring/learning.</p>
  <p>Additionally, it's fairly easy to programmatically compare submitted code against the output of the most popular AI tools using <a href="https://theory.stanford.edu/%7Eaiken/moss/" rel="nofollow noreferrer">Moss</a>. This suggests that human-hired plagiarism might be harder to detect than AI because it's more likely to be unique, unless the hired coder didn't bother to try to make it look unplagiarized or used an AI solution on behalf of the student/candidate.</p>
  <p>If, someday, real-world programming tasks can be completed purely with AI assistance and no understanding is needed, there'll likely be new technical problems. Exams and assignments will be less about whether or not a solution can be coded and understood line-by-line and more about whether the right problem is being solved, how the AI tool was guided, fine-tuning parameters, system-level design, and so forth. A lot of these new requirements smell a lot like much high-level data science, deep learning and ML. Higher levels of abstraction entail different problems rather than an elimination of problems altogether. The trouble is that high-level tools make it easy to solve low-level tasks, which is nothing new (for example, <a href="https://godbolt.org/" rel="nofollow noreferrer">godbolt</a> for completing assembly assignments).</p>
  <p>A lot of this makes me think of doping in biking, using data science to optimize shot locations in basketball, Stockfish in chess, auto-tune in music, etc. If everyone is cheating, is anyone cheating, or is that just the new rules of the game? Where do we draw the line between using an available powerful tool effectively versus a cheat? Technological innovation can create this turmoil, but unlike bike doping, it's still hard to cheat a whole CS degree, bootcamp or job with AI code. And if it gets to the point where you can, that'll be the time to reassess the game (or find stricter ways to cling to and enforce the old rules).</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-04-08T07:02:28.513Z
Answers.Text: I don't think code generated by such AI tools would be considered plagiarism, indeed one of the criticisms of these tools for use in industry is that they sanitise plagiarism from the code that was used to train them.  Hiring humans on the other hand would be a very serious offence if caused (likely to cause the students to be expelled).
Answers.UserDisplayName: Dikran Marsupial
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-04-08T07:08:51.953Z
Answers.Text: "A lot of these new requirements smell a lot like much high-level data science, deep learning and ML. "  I work in ML, the use of tools without understanding is a *big* problem there. It isn't true that you can safely use these tools without a fundamental understanding of the maths,
Answers.UserDisplayName: Dikran Marsupial
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-04-08T07:11:30.687Z
Answers.Text: This answer (+1) is also missing the question of how we are going to bridge the gap from where we are with programming to the point where AI can do the programming for us, which isn't going to happen any time soon (the current approach is not likely to produce an AI that understands the specifications or the code).
Answers.UserDisplayName: Dikran Marsupial
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-04-08T16:15:14.773Z
Answers.Text: "The use of tools without understanding..." -- yep, that's a big problem in all high-level domains I suspect, from databases to distributed systems to functional programming to networking... you can never really escape the low-level details popping up and ruining the party sooner or later, so it's best to know them. But my post is assuming that everything with AI code just works to the extent the hype promises. I'm giving it the benefit of the doubt and (hopefully) showing that it's still not (yet) a game-changer given the cheating that's already pretty much rampant.
Answers.UserDisplayName: ggorlen
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-04-08T16:18:43.400Z
Answers.Text: "everything with AI code just works to the extent the hype promises" I don't think it is promising more than just helping out with the boilerplate programming.  I've been doing a bit of reading and it seems that running code through CoPilot may be enough to protect the user against copyright/licence infringement prosecution, and it can generate multiple solutions, so I don't think it will be as easy to deal with CoPilot plagiarism as it is for code cut and pasted from the web.
Answers.UserDisplayName: Dikran Marsupial
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-04-08T16:20:57.853Z
Answers.Text: One solution to cheating is programming tests in exam conditions.  Give them the specifications beforehand, but the student then has to implement the solution in the lab with the WWW blocked (except for local copies of particular resources).  Unless they have a photographic memory, that would be a difficult test to pass without understanding.  Pretty stressful for the student though.
Answers.UserDisplayName: Dikran Marsupial
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-04-08T16:33:54.783Z
Answers.Text: I'm sure you're aware, but [searching for "will GPT 3 replace coders"](https://html.duckduckgo.com/html?q=will%20gpt%203%20replace%20coders) shows plenty of articles that are discussing repercussions of AI code beyond boilerplate generation. Yeah, the "lab conditions" approach you mention is another possible solution among others, but isn't scalable, especially in a remote-first, post-COVID world for education and hiring. Many other approaches are possible, like AI proctoring and monitoring, but none are a silver bullet, of course.
Answers.UserDisplayName: ggorlen
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-04-08T16:38:00.140Z
Answers.Text: "I don't think it will be as easy to deal with CoPilot plagiarism as it is for code cut and pasted from the web" -- yes, but as my post argues, the human-hire-based cheating is almost certainly harder to detect than either of those, and that's already endemic and has been around forever (and only become more appealing with remote learning/hiring).
Answers.UserDisplayName: ggorlen
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-04-09T05:24:35.523Z
Answers.Text: The point I was making is that the use of CoPilot may not be treated as plagiarism (or at least may not be enforcible).  That would mean it's use would not even be covert.  In my experience human hire cheating is not that difficult to spot - typically using more advanced techniques than taught and a lack of adherence to the requirements (and guidance given in lectures that the programmer hadn't seen).
Answers.UserDisplayName: Dikran Marsupial
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-04-07T20:17:39.567Z
Answers.LastActivityDate: 2022-04-07T21:25:16.647Z
Answers.LastEditDate: 2022-04-07T21:25:16.647Z
Answers.UserDisplayName: ggorlen
Answers.Body: <p>There's another aspect to the impact of these tools on teaching programming that is worth considering, as reported in the paper, 'The Robots Are Coming: Exploring the Implications of OpenAI Codex on Introductory Programming' given at the Australasian Computing Education Conference (ACE) in Feb 2022. That is the potential impact of student use of them to solve standard introductory programming problems.</p>
  <p>From the abstract, 'In this work, we explore how Codex performs on typical introductory programming problems. We report its performance on real questions taken from introductory programming exams and compare it to results from students who took these same exams under normal conditions, demonstrating that Codex outscores most students.'</p>
  <p>The paper is available as Open Access from the ACM Digital Library.</p>
  <p>DoI: <a href="https://doi.org/10.1145/3511861.3511863" rel="nofollow noreferrer">https://doi.org/10.1145/3511861.3511863</a></p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-04-08T15:46:20.360Z
Answers.Text: Yes, that is my primary concern, thanks for the reference!
Answers.UserDisplayName: Dikran Marsupial
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-04-08T15:38:09.910Z
Answers.LastActivityDate: 2022-04-08T15:38:09.910Z
Answers.UserDisplayName: kentdjb
Body: <p>New Artificial Intelligence (AI) programming tools like <a href="https://openai.com/blog/openai-codex/" rel="noreferrer">Codex</a> and <a href="https://copilot.github.com/" rel="noreferrer">CoPilot</a> can (to some extent) generate code in different programming languages from natural language descriptions.  Obviously at the moment these AI tools are based on text matching and don't actually have any understanding of the specifications or the code, but can help in producing programs by eliminating some of the &quot;boilerplate&quot; programming tasks.  I am concerned that these tools will make learning to program more difficult as they do not encourage students to understand what they are doing, because the can generate the code for the sort of simple pedagogical/andragogical tasks we often use when teaching programming (it is bad enough that there are already solutions for these problems available on-line).</p>
  <p>I also wonder if these tools are likely to change the job market in ways that will affect admissions.  If these tools take a lot of junior programming jobs, and the job market will be focussed on senior programmers or programmers with specialist skills (e.g. hardware/OS or mathematics), that may limit interest in CS.</p>
  <p>Are there any solutions to encouraging students to really understand what they are doing when they can get the computer to generate the code for them?</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-04-08T14:21:43.923Z
Comments.Text: Couldn't you ask the same question about languages with built-in functions for high-level operations like sorting? Yet educators still teach students about sorting algorithms.
Comments.UserDisplayName: Barmar
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-04-08T14:52:28.967Z
Comments.Text: The difference is that CoPilot is a general tool that will replace problem solving skills, at least for the types of programming task used to help students learn problem solving skills.  This is because the data on which they were trained will contain solutions to those problems.  Abstraction is an important tool in CS, but there are occasions where it is fine to use an abstraction without understanding how it works and times when it isn't.  Sorting is a good example if we have a lot of things that need sorting.
Comments.UserDisplayName: Dikran Marsupial
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-04-08T23:19:28.977Z
Comments.Text: We have to think about why we are teaching people stuff. What is the goal?
Comments.UserDisplayName: Scott Rowe
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-04-10T15:05:44.823Z
Comments.Text: Do you know how your compiler works?
Comments.UserDisplayName: Thorbjørn Ravn Andersen
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-04-10T16:03:40.747Z
Comments.Text: as an experiment, I gave a demo of assembler and what the compiler does in the first week of my programming module (making it clear that it wasn't examined, just thought it would be a good way to introduce sequence for the more practically minded students).  Ideally I want students to be able to be comfortable with programming both as an abstract activity, but also as a hardware-related activity, according to the needs of the job at hand (I am more at the hardware end).
Comments.UserDisplayName: Dikran Marsupial
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-04-10T16:48:13.457Z
Comments.Text: I think it is quite a good idea to have a reasonable idea of how your compiler works.  In most craft activities understanding and appreciating your tools is essential in doing good work.
Comments.UserDisplayName: Dikran Marsupial
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2024-04-02T23:33:35.907Z
Comments.Text: I've done a lot of SQL wrangling, and I have thought of database design and SQL as the most enduring and valuable knowledge I have from many years of programming. I keep thinking of teaching others that. But lately, I find myself suspecting that in only a few years, the entire idea of a designed database might fall off, become simply unnecessary. Then what? Lack of knowledge of that area would not matter. So much for knowledge and experience.
Comments.UserDisplayName: Scott Rowe
Tags: <programming><artificial-intelligence><programming-environment>
Title: What effect will AI tools like Codex and CoPilot have on teaching programming (and admissions)
ThreadText: # What effect will AI tools like Codex and CoPilot have on teaching programming (and admissions)
  
  (Asked by: username_0 on 2022-04-07)
  
  New Artificial Intelligence (AI) programming tools like [Codex](https://openai.com/blog/openai-codex/) and [CoPilot](https://copilot.github.com/) can (to some extent) generate code in different programming languages from natural language descriptions. Obviously at the moment these AI tools are based on text matching and don't actually have any understanding of the specifications or the code, but can help in producing programs by eliminating some of the "boilerplate" programming tasks. I am concerned that these tools will make learning to program more difficult as they do not encourage students to understand what they are doing, because the can generate the code for the sort of simple pedagogical/andragogical tasks we often use when teaching programming (it is bad enough that there are already solutions for these problems available on-line).
  
  I also wonder if these tools are likely to change the job market in ways that will affect admissions. If these tools take a lot of junior programming jobs, and the job market will be focussed on senior programmers or programmers with specialist skills (e.g. hardware/OS or mathematics), that may limit interest in CS.
  
  Are there any solutions to encouraging students to really understand what they are doing when they can get the computer to generate the code for them?
  
  **Tags:** programming, artificial-intelligence, programming-environment
  
  > **Comments:**
  > **username_1**: Couldn't you ask the same question about languages with built-in functions for high-level operations like sorting? Yet educators still teach students about sorting algorithms.  
  > **username_0**: The difference is that CoPilot is a general tool that will replace problem solving skills, at least for the types of programming task used to help students learn problem solving skills.  This is because the data on which they were trained will contain solutions to those problems.  Abstraction is an important tool in CS, but there are occasions where it is fine to use an abstraction without understanding how it works and times when it isn't.  Sorting is a good example if we have a lot of things that need sorting.  
  > **username_2**: We have to think about why we are teaching people stuff. What is the goal?  
  > **username_3**: Do you know how your compiler works?  
  > **username_0**: as an experiment, I gave a demo of assembler and what the compiler does in the first week of my programming module (making it clear that it wasn't examined, just thought it would be a good way to introduce sequence for the more practically minded students).  Ideally I want students to be able to be comfortable with programming both as an abstract activity, but also as a hardware-related activity, according to the needs of the job at hand (I am more at the hardware end).  
  > **username_0**: I think it is quite a good idea to have a reasonable idea of how your compiler works.  In most craft activities understanding and appreciating your tools is essential in doing good work.  
  > **username_2**: I've done a lot of SQL wrangling, and I have thought of database design and SQL as the most enduring and valuable knowledge I have from many years of programming. I keep thinking of teaching others that. But lately, I find myself suspecting that in only a few years, the entire idea of a designed database might fall off, become simply unnecessary. Then what? Lack of knowledge of that area would not matter. So much for knowledge and experience.  
  
  ---
  
  ## 5 answers
  
  ### Answer by username_6 on 2022-04-07. Score: 11
  
  There are two cases actually. One is programming education directed at the vocational market and the other is computer science education. The latter isn't really about programming.
  
  For the first case, if programming skills become obsolete then people will need to take up other things to get a job. They might not be computer related at all. Buggy makers still exist, but it is a niche market.
  
  For computer science education, on the other hand, the curriculum will change. It will still be necessary to produce programs in the early part of the curriculum, but different tools will be used, possibly AI tools. For the later part of the curriculum programming in some high level language will probably still be needed, just to drive the understanding of future academics. Algorithmic thinking will likely still be needed for a couple of generations minimum. Producing better AI tools will require deep understanding, some of it at least related to programming.
  
  There are relatively few places now where 360 assembly language is the first course taught as it was many years ago when that was the only available tool. Now we use higher level languages that permit a more abstract view of a program and we have compilers that translate the higher level constructs directly into machine code. An assembly language is probably taught somewhere, though, perhaps in an architecture course. The same will likely be true as we advance, with the lower level tools replaced by higher level ones, including AI.
  
  So, things will change, but not fundamentally for, I predict, quite a long time. I once met Joel Moses who predicted (around 1973 or so) that FULL AI was only about ten years away. And so it has remained ever since.
  
  All advances make the solution of harder problems more amenable to solution. As AI advances it should be the same.
  
  In truth, I find current AI to be a pretty restricted thing. One can solve certain sorts of problems, but the methods and results are pretty constrained, and often erroneous. It is difficult to trust a lot of AI, even things like neural networks if it can't give a verifiable explanation of how it arrives at its outputs. Too much of it fails that test. In particular, the driving data of a lot of AI is, itself, flawed and in ways we don't understand yet.
  
  A CS education is directed at more than practitioners. It is an exercise in changing the brain. Many bachelors graduates go into programming as a first task, but that isn't why the major exists. The same is true of most other undergraduate degrees.
  
  ---
  
  One test you could use to determine whether a program producing AI has "arrived" is whether it can produce itself. A [Quine](https://en.wikipedia.org/wiki/Quine_(computing)).
  
  > **Comments:**
  > **username_0**: I think my concern is more that it will be difficult for students to gain understanding and develop algorithmic thinking if they are using tools that do these things for them.  AI is quite a good example of this as there are an awful lot of practitioners that are using tools (such as SciKit learn) following recipies that they have seen on blogs to solve problems without having a fundamental understanding of the methods they are using (and likely finding pitfalls without knowing about them).  
  > **username_0**: I don't think programming skills actually will become obsolete (because the AI we have is not going to understand what it is doing), just jobs for junior programmers.  We will still need programmers that understand the program, it just isn't clear that an eduction with AI tools widely used will produce them.  
  > **username_7**: Eh? I think I trust you (or me!) to be intelligent, even though I'm sure you can't use your intelligence to produce a copy of your own intelligence; conversely, it's easy to write a quine in most languages, and those quines are not intelligent merely by virtue of being able to reproduce their own source, because that's all they can do. I think your answer would be improved by removing the parenthetical aside.  
  > **username_6**: @username_7, actually, a Quine can contain arbitrary other code. Read Ken Thompson's Turing Award Lecture: [_Reflections on Trusting Trust_](https://users.ece.cmu.edu/~ganger/712.fall02/papers/p761-thompson.pdf) (PDF).  
  > **username_7**: I do know that, and have read the paper. My point stands that "quine" is unrelated to "intelligent", and I don't see its relevance to your answer.  
  > **username_6**: @username_7, you miss the point that even though a programmer can produce a Quine it might be interesting if an AI could do it. And note that in general at the moment and for the past 60 years, AI programs are not _intelligent_ in a real sense.  
  > **username_7**: Well, Codex can almost certainly produce a quine, though not a quine which contains Codex. But I can't produce a quine which contains me, either, so that's an extremely unfair demand!  
  > **username_0**: If copilot can "generate" a fast inverse square root function, I'm sure it can generate a quine provided there are some in the dataset it is trained on.  I don't think the current direction of "AI" is going to produce understanding any time soon.  But then again it is possible to do a fair bit of coding without understanding - codex and copilot are not doing anything that some students haven't done for decades, just faster.  
  > **username_2**: It is not very hard for a human to produce another human. Animals and plants reproduce themselves pretty well too. Even bacteria do it. It doesn't take intelligence to produce intelligence. This is why I keep saying that it will 'evolve' (literally, to give off) quite suddenly. We didn't try to duplicate bird muscles to make an airplane.  
  > **username_8**: I'm actually not sure I agree with the start of this answer - I'd call the counterpoint K-12 math education and the presence of Wolfram Alpha and similar programs. Hard to use them effectively and catch when you set it up wrong if you don't know the underlying principles to begin with.  
  
  ---
  
  ### Answer by username_9 on 2022-04-07. Score: 5
  
  I don't think AI code is a serious game-changer for hiring or education in the short term, even giving it the benefit of the doubt in terms of its power, which is still limited. You mention the problem of students plagiarizing solutions available online, but hired humans are likely just as big of a contributor to cheating, and similar to AI in that the cheater need only state the specification to get the code.
  
  Sure, AI assistants are more accessible than tracking down (and potentially paying) a human to complete an assignment, but at the end of the day the outcome is more or less the same, assuming the cheating isn't caught: a student gets a good grade on an assignment, course or exam that they didn't deserve, or a prospective employee gets hired for a job they're unqualified for.
  
  The problem in both student and employee cases is that they've created an unsustainable situation in their immediate future. For the student, later assignments/exams/courses are going to get harder, and if they've never built a solid conceptual foundation, then they'll either have to come clean and work extra hard to fill in knowledge gaps, or they'll have to resort to further cheating to keep up appearances. Same for the employee: they're hired, but it'll likely be a huge struggle if they're unqualified, with disastrous consequences for them and the employer. And these are the "lucky" ones who weren't caught immediately.
  
  The techniques for catching cheaters don't seem significantly different between AI and existing cheating approaches. For example, you can ask students/candidates to explain their code verbally (written responses are easily hired out to a human) and/or watch the solution coded live. Of course, verbal isn't a perfect foil or terribly scalable (I've participated in MOOC classes of over 500 students to a teaching staff of about a dozen), complicated by remote hiring/learning.
  
  Additionally, it's fairly easy to programmatically compare submitted code against the output of the most popular AI tools using [Moss](https://theory.stanford.edu/%7Eaiken/moss/). This suggests that human-hired plagiarism might be harder to detect than AI because it's more likely to be unique, unless the hired coder didn't bother to try to make it look unplagiarized or used an AI solution on behalf of the student/candidate.
  
  If, someday, real-world programming tasks can be completed purely with AI assistance and no understanding is needed, there'll likely be new technical problems. Exams and assignments will be less about whether or not a solution can be coded and understood line-by-line and more about whether the right problem is being solved, how the AI tool was guided, fine-tuning parameters, system-level design, and so forth. A lot of these new requirements smell a lot like much high-level data science, deep learning and ML. Higher levels of abstraction entail different problems rather than an elimination of problems altogether. The trouble is that high-level tools make it easy to solve low-level tasks, which is nothing new (for example, [godbolt](https://godbolt.org/) for completing assembly assignments).
  
  A lot of this makes me think of doping in biking, using data science to optimize shot locations in basketball, Stockfish in chess, auto-tune in music, etc. If everyone is cheating, is anyone cheating, or is that just the new rules of the game? Where do we draw the line between using an available powerful tool effectively versus a cheat? Technological innovation can create this turmoil, but unlike bike doping, it's still hard to cheat a whole CS degree, bootcamp or job with AI code. And if it gets to the point where you can, that'll be the time to reassess the game (or find stricter ways to cling to and enforce the old rules).
  
  > **Comments:**
  > **username_0**: I don't think code generated by such AI tools would be considered plagiarism, indeed one of the criticisms of these tools for use in industry is that they sanitise plagiarism from the code that was used to train them.  Hiring humans on the other hand would be a very serious offence if caused (likely to cause the students to be expelled).  
  > **username_0**: "A lot of these new requirements smell a lot like much high-level data science, deep learning and ML. "  I work in ML, the use of tools without understanding is a *big* problem there. It isn't true that you can safely use these tools without a fundamental understanding of the maths,  
  > **username_0**: This answer (+1) is also missing the question of how we are going to bridge the gap from where we are with programming to the point where AI can do the programming for us, which isn't going to happen any time soon (the current approach is not likely to produce an AI that understands the specifications or the code).  
  > **username_9**: "The use of tools without understanding..." -- yep, that's a big problem in all high-level domains I suspect, from databases to distributed systems to functional programming to networking... you can never really escape the low-level details popping up and ruining the party sooner or later, so it's best to know them. But my post is assuming that everything with AI code just works to the extent the hype promises. I'm giving it the benefit of the doubt and (hopefully) showing that it's still not (yet) a game-changer given the cheating that's already pretty much rampant.  
  > **username_0**: "everything with AI code just works to the extent the hype promises" I don't think it is promising more than just helping out with the boilerplate programming.  I've been doing a bit of reading and it seems that running code through CoPilot may be enough to protect the user against copyright/licence infringement prosecution, and it can generate multiple solutions, so I don't think it will be as easy to deal with CoPilot plagiarism as it is for code cut and pasted from the web.  
  > **username_0**: One solution to cheating is programming tests in exam conditions.  Give them the specifications beforehand, but the student then has to implement the solution in the lab with the WWW blocked (except for local copies of particular resources).  Unless they have a photographic memory, that would be a difficult test to pass without understanding.  Pretty stressful for the student though.  
  > **username_9**: I'm sure you're aware, but [searching for "will GPT 3 replace coders"](https://html.duckduckgo.com/html?q=will%20gpt%203%20replace%20coders) shows plenty of articles that are discussing repercussions of AI code beyond boilerplate generation. Yeah, the "lab conditions" approach you mention is another possible solution among others, but isn't scalable, especially in a remote-first, post-COVID world for education and hiring. Many other approaches are possible, like AI proctoring and monitoring, but none are a silver bullet, of course.  
  > **username_9**: "I don't think it will be as easy to deal with CoPilot plagiarism as it is for code cut and pasted from the web" -- yes, but as my post argues, the human-hire-based cheating is almost certainly harder to detect than either of those, and that's already endemic and has been around forever (and only become more appealing with remote learning/hiring).  
  > **username_0**: The point I was making is that the use of CoPilot may not be treated as plagiarism (or at least may not be enforcible).  That would mean it's use would not even be covert.  In my experience human hire cheating is not that difficult to spot - typically using more advanced techniques than taught and a lack of adherence to the requirements (and guidance given in lectures that the programmer hadn't seen).  
  
  ---
  
  ### Answer by username_10 on 2022-04-08. Score: 4
  
  There's another aspect to the impact of these tools on teaching programming that is worth considering, as reported in the paper, 'The Robots Are Coming: Exploring the Implications of OpenAI Codex on Introductory Programming' given at the Australasian Computing Education Conference (ACE) in Feb 2022. That is the potential impact of student use of them to solve standard introductory programming problems.
  
  From the abstract, 'In this work, we explore how Codex performs on typical introductory programming problems. We report its performance on real questions taken from introductory programming exams and compare it to results from students who took these same exams under normal conditions, demonstrating that Codex outscores most students.'
  
  The paper is available as Open Access from the ACM Digital Library.
  
  DoI: <https://doi.org/10.1145/3511861.3511863>
  
  > **Comments:**
  > **username_0**: Yes, that is my primary concern, thanks for the reference!  
  
  ---
  
  ### Answer by username_4 on 2022-05-01. Score: 1
  
  I was thinking about this over the week.
  
  # First how will it affect programming outside of education.
  
  We have in the past invented higher level languages, that replace lower level languages. So nothing new. However we will NEVER get to the point that we can just write in English. This is because English is a terrible programming language: too ambiguous.
  
  # So what will the AI be good at?
  
  It will get good at solving standard very well specified problems, with little ambiguity. That is the sort of problem that one would see in an academic assessment.
  
  # So what does this mean?
  
  It is little different in type to the problem of assigning students to write an assembler-language program, and they writing it in `C`, compiling it, and handing in the result, Using a calculator, or downloading an answer off of the web.
  
  # What to do about it
  
  Adapt: I will leave this for others to consider how. But not we have done it before. There is nothing now here.
  
  > **Comments:**
  > **username_0**: This isn't answering the question, which was how it will affect teaching programming.  "It is no different in type to the problem of assigning students to write an assembler-language program, and they writing it in C, compiling it, and handing in the result." this isn't actually true.  As I pointed out, it means that the students can produce code that they don't understand.  I have already observed this as a result of students being able to manually download code from the WWW, having a tool to do it for them makes that worse.  
  > **username_0**: BTW I don't think it is a good idea for undergraduate assignments to be very well specified with little ambiguity.  That causes the student not to think about the specifications, or question them.  I have a forum for students to ask questions about the specifications of the coursework (so all students can see the answers) and I encourage them to look for ambiguity or issues with the specifications.  It is part of software development.  
  > **username_4**: @username_0 I agree, and have read and agreed to many of your other comments. But I do think there are similarities to the past, but not exactly the same type. However, the conclusion "adapt", I think is probably correct. Sorry to not give any advice on how to do this.  
  > **username_0**: @crtl-alt-delor a discussion of *how* it will affect teaching would also be of interest.  It is somewhat of a concern that these tools are being developed without any investigation of their effect advantages and disadvantages.  
  
  ---
  
  ### Answer by username_5 on 2022-05-01. Score: 1
  
  Isn't this the next step in the natural progress of computer sciences?
  
  New "layers of abstractions" were constantly introduced, over decades.
  
  CS moved on
  
  * from machine instructions to assembly code
  * from assembly code to high-level languages like C
  * from high-level-languages to 4th level languages like SQL
  * from declarative languages to no-code/rapid-application developments
    environments,
  * and now the AI-powered tools like Copilot are here (based on language models and knowledge graphs)
  
  They will just become part of the curriculum.
  
  None of these developments have made any previous body of knowledge obsolete. Neither when they were new, nor when they matured over the years.
  
  Each time there were some people concerned that old-school skills will die out, or this will degrade students capabilities.
  
  (Students' average apperception might still go down, due to other reasons: computer hardware that cannot be tampered with; greater societal inequality; underfunding of teaching and education in general,... all of which are more serious threats that the rise of AI-based programming aids.)
  
  > **Comments:**
  > **username_0**: No, I doubt it.  The problem is that these AI tools don't understand the code they produce.  If the programmer doesn't either, that is hardly a recipe for reliable good quality software.  So how do we teach programmers to understand code if they don't write it (and as typical pedagogical tasks are likely in the training set the AI tools can answer the exercises we currently use to teach understanding).  They are basically a quick way to look up/launder code on the WWW.  
  > **username_0**: I don't think that these AI tools can be looked on as a level of abstraction as it isn't clear what they do or how they do it (or what they are going to do), and they don't necessarily produce good code.  
  > **username_5**: At each "step" there were always trade-offs between correctness, productivity enhancements/ convenience and performance-losses/inefficiencies/larger overhead (due to being farther away from the bare metal).  
  > **username_0**: is there a correctness trade-off in compiler?  
  > **username_5**: Some compilers you can tell to be fuzzy,e.g. specify how Typescript 2.0's "null- and undefined-aware types" or how its "control flow based type analysis" should work in detail (for edge cases), Aggressive optimization in gcc compilers (`-O4, or -ffloat-store`) comes with trade-offs w.r.t thread-safety or numerical accuracy AFAIK. I'm not an expert in this matter.  
  > **username_0**: the compiler is still conforming to a specification (even where it's behaviour are undefined, they are defined as undefined).  AI tools on the other hand have no guarantees that the code they produce will do what you ask it to.  I am not against the use of these tools by people that understand the code they produce.  My question is about how they will affect the production of programmers capable of using them safely.  
  
  ---
  
  