Teaching Programming in the Age of ChatGPT
oreilly.com
oreilly.com
It is simply far, far easier for a newbie to see a computer generate 1 / 3 / 5 slightly-different attempts to solve a specific problem they have, and then to pattern match sufficiently to be able to solve the problem themselves, than it is to muddle around by yourself with it for hours and hours with no end in sight.
I thought she would have to ask me, someone who has been slinging Python in some form since 2008, a question at least once a week. In reality it's been about 3 times over the last 9 months.
ChatGPT doesn't do much for experienced SWEs, but it demolishes the difficulty curve for newbies. I wish I had this when I was learning.
Interesting, my impression was that ChatGPT helps experienced SWEs by filling out large amounts of boilerplate-ish code. It sounds like that's not your experience, though?
But the more exeperienced you are, more valuable your output is (in most cases). So the 10% of your productivity could be more valuable than a novice's 50%.
At the same time, I see my 9 year old girl using ChatGPT to create Minecraft extensions; she has no prerequisites for actually developing software, but she manages to make some small extensions and have them work either way.
Acknowledging that she doesn't actually learn much from this, I think one can assume that everything in between (e.g. using ChatGPT for pair learning) is definitely also possible.
But whatever AI is outputting, there's no way these qualified guesses can beat experience from a professional developer. I know that the output will never be better than the prompt, but sometimes the output - no matter how much effort you put into the prompt - is visibly just a qualified guess.
I would say with someone new to coding it can be bad and good, as a lot of times it glosses over things, or can be slightly incorrect as it makes assumptions (or more so just answers in a more general context, and when asked to elaborate, or challenged on specifics it will reformat/improve it's answer, but without knowing you need to do so, I could see it easily see it providing half-baked foundational knowledge. You can ask it "x" and it will give a answer, but then if you ask it I am trying to do "y" with "x" and isn't "z" an issue or area of concern with its answer it will reformulate the information provided as its original response was flawed, but if you don't know exactly what the "y" you want to do is, or the "z" being foundational knowledge to challenge it on, you can easily get a whole wall of text that is out of context with what you are actually trying to learn.
This is my hang up with LLMs … I don’t trust them.
Frankly it seems just as easy if not easier to just google keywords and read sites.
Google vs LLM is like asking random people on the internet (some are brilliant, some don’t know anything, some are nuts, … etc.) vs asking random people on the internet but all of them have a history of suffering from hallucinations and are routine liars with a compulsive need to answer confidently even when they know nothing.
Sounds like a description of narcissistic personality disorder or schizoaffective. Of course proto ai would have a personality disorder, go figure.
In the future, the job of an ai psychologist will be to certify the personality of ai products. Gotta make sure you’re not shipping a shrink wrapped psychopath.
It might change eventually as ide integrations improve, but for now it's a novelty for me.
A good craftsman crafts his own tools.
I call bullshit. Your task is to deliver a project that does what it's supposed to, all in a timely fashion. You do whatever it takes, including getting rid of old code and rewriting stuff if it makes you more productive overall.
Writing code that does what you want is much faster than taking someone else's code and twist it to do something it was not written to do. You should always be very careful about what dependencies you use, as most often you will have to deal with their limitations and bugs, and they could kill your project.
If you had 20 separate people who contributed to the same thing and left then you most likely have huge code debt. Managing that sort of thing is a daily task for any software engineer. Apparently your strategy is to just add debt onto the pile and put your head in the sand pretending it's not your problem. Instead you should plan tactical refactoring moves to make the codebase leaner and better able to adapt to the business needs, all without breaking any existing functionality and workflows.
You're asking "when". That's the wrong question. It's up to you to manage your time and invest it into tasks that help you save time later on. A software engineer is usually not paid by the hour either, so you just do the work until you're satisfied with the effort you've put in.
He does not make his own tools. He buys them, because there are already extremely talented tool-makers who are very good at their craft.
He also makes paddles, which are still expensive (I think the cheapest starts at about $1000), but some people actually use those.
Certainly a lot of youtube woodworkers do that, can't say I work wood myself.
But saws, blades, chisels… maybe he could make them, but why? Metalworking is its own subject of mastery.
AFAIK, he doesn’t often modify any tools of that sort. He spends time selecting the one he wants, yes.
Imagine, a vision of the future... A thousand million chatbots, all outputting 2018 JavaScript
I would like an AI to tell me if I’m reinventing the wheel or if something similar can be abstracted. Whether what I’m doing aligns with existing patterns in the codebase. How the application as a whole could be refactored to improve maintainability, performance, or both.
This can all already be done by a human with experience and context, so it must be possible with AI. This will be the biggest game changer for me.
Maybe it's good for some languages, or for code that's doing the exact stuff a hundred people have already written. Copilot X certainly looks cool, but who knows when that'll be ready.
I find it especially helpful with SQL queries, and with boilerplate type code. It’s also very helpful when I’d need to lookup the usage of various methods. I just start with the comments and most of the time it saves me the context switch to the browser to lookup the usage.
Not to mention...things like "cool want to learn python"..."wait - wtf..how do i setup a venv in python!!"
Of course you then have to compare this explanation against all others and see if it fits or if it’s not a valid explanation.
It’s also great for exploring topics which have polluted namespaces on search engines.
Overall though I think the majour benefit of ChatGPT is it just teaches people to clearly define problems as natural language questions. Developing this ability helps the subconscious mind solve problems when the user is away from screens.
One of the types of teaching video that I've found very helpful is where an expert, usually a professor explaining a concept (e.g zero knowledge proof) to five different audiences starting from school kids up to fellow researchers or professors. You can basically ask many different targeted levels of questions to ChatGPT for example, explain the concept as I am five years old, etc.
Yeah we've had them for a while, it was called the rubber duck, ;)
That's because it is easier. Multiple choice is easier than open questions.
It's also a good way to not really grasp anything deeply.
When we teach math to children we don’t start with algebraic structures and proofs. We give them simple recipes.
Later we show them problems that the recipes can’t solve and dig deeper. „By the way, the thing we did last year, it actually works like this…“
This is not mathematics, but arithmetic/calculating. When one starts teaching not-children-anymore mathematics (typically at the university), one indeed starts with something of the kind of algebraic structures and proofs.
She will certainly learn the deeper concepts in university, but catching up with coding quickly, even in a shallow manner, is super beneficial. I think it's a huge plus.
Well it’s right, but you can turn a student from one who doesn’t want to learn into one who does.
You can absolutely motivate unwilling or uncooperative students to learn. I have done it many times.
It has greatly accelerated the process of building prototypes in multiple languages and building various permutations of solutions.
Doing that has allowed me to study various problems both from the bottom up and the top down. I think that has been useful for understanding concepts.
I could have done the same things without AI, but it would have taken a lot longer.
I still think it’s better to learn without too much tooling of any kind, but that’s a topic for another day.
It may very well be a trivial and uninteresting part of mathematics compared to the rest, but it’s still mathematics nonetheless.
Depends. In my high school, math was tought not by telling us the proofs, but by asking us to provide them.
You teach programming by giving simple assignments, not by handing out “calculators”.
Having recently done a screenshare with a fresh CS grad as they developed a simple program and seen how much Copilot was doing for them, I was both impressed and appalled. Yes, it's able to do a ton of that simple stuff, but this new grad has no idea _why_ it's doing what it's doing. They are more concerned with getting it done quickly due to not working on the problem early enough (that's a whole other issue).
It genuinely concerns me for the next generation of CS grads and how well they are going to understand the systems they are building. They are already coming out of school unprepared for the professional development world, this is just going to highly exacerbate the problems.
This fresh grad happens to already be working for us and I was mentoring him.
Yes and no. It doesn't help me that much with technologies that I'm senior within, but it has allowed me to work with a wider tech-stack. For example, I can now confidently write any SQL querys I want (so far anyway) although my prior knowledge in SQL isn't that deep.
I'm having a harder and harder time justifying writing a lot of code myself when faster tools are right at my fingertips
Would love to hear how other SWE's who are using GPT feel about this
It's much slower at producing good code than I am but it's much faster for me to write a prompt than a program, so ultimately it allows me to do two things at once because 'prompt time' is so short I can fit it in between other things.
I don't think of programming as a grind unless I'm working in a shitty codebase, which does happen, certainly.
For my own course, I think several factors contributed to students not utilizing ChatGPT as much:
- The assignments are not in English, and performance of ChatGPT in languages other than English is subpar.
- The programming language that I'm teaching is C, I'd imagine Python/Javascript and other more popular languages might lead to different outcomes
- I did specifically design the assignments so that copy/pasting the assignment to ChatGPT does not lead to a usable answer (by restricting use of certain standard library functions, making the assignment more complicated)
- The course is not introductory, i.e. a previous course already taught the basic syntax of C and basics of programming, so I can make my assignments much more advanced
It's difficult to say if advancements in LLMs will make my job harder, where say copy/pasting my more complicated assignments can lead to correct results. But from what I can see right now, LLMs still have trouble solving novel problems, so it's probably always possible to come up with assignments that's difficult for them to solve.Have you been using 3.5 or 4?
I fed the problem into ChatGPT later and it was utterly unable to comprehend it, but confidently gave wrong answer after wrong answer.
In my own assignments however, I focus less on algorithmic stuff but more on adding and mixing several things together. E.g. instead of just sorting, do group & sort, and a combination of a bunch of other practical stuff like reading big-endian binary files.
Just for fun I asked ChatGPT 4 to calculate the RMSE between two vectors both in English and Portuguese (also translating RMSE to Portuguese) and it gave me the same code for both questions (asked in separate instances). It would be interesting to know what restrictions you applied.
I'd expect simple tasks like calculating RMSE to definitely be within the abilities of LLM, you might combine things like actually reading the vectors from a CSV file (or a custom format) and calculating RMSE then sorting them etc to see the limitations of LLMs. Most students have no issues with calculating RMSE, they have issues with trying to do all the other stuff that leads to it, and then the combination of sorting and other tasks.
Regarding the restrictions, most of them are just don't use itoa/strtod or strcpy or some other standard library functions.
I agree with you, in my experience, ChatGPT is a better search engine but it is not capable of composing the various parts of an application in a cogent manner. I also think that the current UI is not appropriate for software development and I am sure there are efforts going on to create something closer to Jupyter notebooks for programming. That may be a game changer for your students (and you).
I don't think Jupyter notebooks or like similar REPL interfaces will help too much for my course, at least in the current syllabus. I'm aiming to teach about pointers, memory management etc, the more fundamental parts of how to interact with computers instead of a high level language. Though I would agree that the current UI is suboptimal, some improvements in allowing students to visualize memory layouts and see how their code manipulates memory will help a lot.
I can't recall exactly but I think https://godbolt.org/ might do that for example?
Godbolt is a compiler explorer, it shows disassembly of a code but there's nothing to visualize each step in the process.
It’s generally a problem that solves itself, in my experience. Perhaps a benefit of these tools is that we stop the obsession over cheating, which inconveniences honest students in many ways. Cheating has always occurred, but now we can’t even pretend that it’s preventable.
Some students ignored his rants because they didn't find the subject interesting, did the past papers, and then got to the exam and did terribly, then complained about the fact that "it's all based on his rants".
Others found the ranting engaging because it was deep dives on obscure bits of computer security history. My year he spent ~4 weeks going on about Stuxnet, including deep dives into the wider political context. When I got to the paper, one of the few questions we could choose, for 50% of the paper, was just "What was Stuxnet". I wrote pages and pages. Figured out from marking that I got full marks on that one. I always did great in that lecturer's modules despite never taking notes and rarely doing any targeted reading.
To show the level of engagement, I once turned up to one of these lectures 10 mins late, with most of the class already there, and the lecturer said "oh I wondered where you guys were, I guess I'll start again". He knew we were the only ones who cared about the class.
As much as it sounded like the rantings of a tin-foil hat wearing madman, he was in fact quite accurate through a combination of having worked in government in computer security at a fairly high level for a while, and having deep technical knowledge about what was possible.
I miss his lectures, they were excellent, but I hear he's still going strong scaring freshers and running the on-campus teaching union, which is nice to hear.
The path of being interested enough in a field that the easy work is easy, and the hard work is at least interesting, actually turns out to be the path of least resistance.
Doesn't matter if people Google, Stackoverflow, use ChatGpt, ask their wizkid neighbor or what have you. You don't need to resist cheaters, especially not when we're talking about adults, it's their responsibility. Cheaters don't learn so when they're tested they sooner or later flunk out.
Disappointing. I cannot evaluate claims about GPT when people say ChatGPT instead of GPT4, if they actually mean the latter.
And if someone really is discussing the usefulness of AI while only having used ChatGPT (GPT3.5), then they’re missing out on a major improvement and their input is less valuable than those discussing GPT 4.
Of course GPT-4 has plenty of limitations but people just need to be clear that they’re familiar with the state of the art.
Also, statements to the effect of “it just predicts the next word” do not appreciate the major difference in capacity for learned abstractions between GPT 3.5 vs GPT 4. So to me it’s just not a useful way of thinking about LLMs. It may technically be true, but at some level that can also be said of human beings. In other news, an airplane “just” flies.
If I were 18 again, I am not sure what the answer is - would it even be a good idea to pursue this field of study if there aren't going to be many jobs post graduation...
I hope I am wrong...
Future LFMs (Large Foundation Models, since they will be multimodal) can help automate some or much work from specifications onward. Humans will need to validate and revise the results by working with an LFM-powered system (Ref: the spiral model in software engineering).
Yes and that's what code is: most concrete specifications :P
Figuring out what to code is much harder than coding it, like 99.99% of the time.
People worrying about ChatGPT taking away their job frankly do not understand this: my job is to think. I type very little code.
I dunno. I go back and forth on the effects these things will have on programming.
No, because that's not an expectation based in reality.
I think it's always going to be a bit shit, no matter how large they make them it's always going to be an obvious faker, always going to confabulate and lie etc.
As long as we are using a technology that merely fakes intelligence (using statistics to generate the most likely next token based on training data is not intelligence), it is going to be obvious that it's fake. This whole bubble is going to burst when people start realizing how overrated it is.
I've always said that if AI had to deal with some of the executives and product teams I have, with constant insane changes and shipping demands, the AI will more likely figure out how to eliminate people than deal with them.
ChatGPT is a game changer for this same process. It speeds up the googling that would normally take a few hours and gives me my information in a few queries.
There have been so many times where I’m reading a book and need to research a bunch of technical terms it throws at me; which then consists of wading through blog posts or documentation, with varying levels of difficulty and quality.
This process is sped up 100x because of chat GPT, because I can followup with questions and customize them to my specific application. Sometimes I need things explained like I’m five; others, a deep technical deep dive.
Point is, it allows for dynamic interaction with content; it helps when I’m struggling with a bug, documentation, a book I’m reading, or pieces of code myself or someone else has written. It’s been an absolute game changer.
Just as an example, try using ChatGPT to explain an article in a foreign language. Can even go as low as a letter-by-letter break down of each word. No private tutor will ever have the patience to teach people at this level.
Coding will become like the liturgical exercises of monks toiling in isolated monasteries while the rest of the world will move on.
I cant wait for a chatGPT decompiler. IDA, watch out!
Hopefully our bugs aren't evolving though.
A much more interesting consideration would be "Teaching Programming in the Age of Stack Overflow", which involves a well-established, gigantic resource for in-the-trenches programmers that generally provides functional, peer-reviewed and expansively commented solutions to the most common and sometimes most interesting problems.
What programming will be like in an age where LLM's can correctly code is something we won't have any idea about for some time yet (if ever).
I tried it on my/our project 600K LOC (C++), all open source and almost certainly in the training set. Not only could it not explain the questions I asked it correctly, its answers and generated code were absolute jibberish, the sort of thing that would lead to you likely firing the person who gave them to you.
Even if LLMs or some successor technology never ends up supplanting programmers entirely, it is guaranteed we will see a mixture of deskilling (certain skills no longer being required, like spelling in the age of autocorrect) and massive productivity gains (meaning n-m workers can now do the job of n). These tools aren't going away, and they're only going to improve.
Thus the market for programmers will shrink henceforth. There are no doubts about it. Maybe slowly, maybe quickly, but shrink it will, for the same reason that the market for radiologists is shrinking, or the reason that engineering firms no longer employ whole floors of draftsmen.
1 we could fire a person
2 we could handle 25% more tasks, features and bugs
So I think 2 will happen.
My latest example of LLM issues,| I asked ChatGPT and competition to convert a line of jQuery into native JS, they all got it wrong because jQuery has some selectors like ":header" that is native to JS but the LLM used it anyway though somewhere in it's big memory it has the information that his is not native and if you prompt it right it will fix the issue. So seems to me the LLM are focusing too much on the prompt and failing to use it's full memory on the problem, so it can fix small individual micro tasks but is a complete waste of time for something a bit more advanced , my conclusion you can't have a manager or an artist armed with ChatGPT and create a full project without actually learning to code, at best they will learn to code from the LLM but the hard way and probably using outdated code and inefficient ways.
Because this is what always happens when tools cause productivity gains. Budgets aren't infinite.
- Computerized avionics dramatically cut demand for flight crews. It used to require a dedicated "flight engineer" to literally run the engines (like a train engineer) in a WWII-era bomber, and a dedicated navigator. Now airliners barely need a co-pilot.
- As I mentioned previously, computerized medical imaging has caused demand for radiologists to go down, because one radiologist today can do the work of multiple radiologists of yesteryear.
- In software in particular, if engineering and development is more productive, companies can cut costs and still get the same amount of work done, or possibly more. It's not about firing people immediately, it's about the next company hiring fewer. And the one after that hiring even fewer. Generative coding is going to make software development labs leaner.
>my conclusion you can't have a manager or an artist armed with ChatGPT and create a full project without actually learning to code, at best they will learn to code from the LLM but the hard way and probably using outdated code and inefficient ways.
That's the current state of affairs. Why do you think the technology will not improve beyond where it is now?
And as I said in my reply, this isn't true.
Do you have anything useful to add to the discussion?
There's a non-zero chance that correcting your statement will influence somebody considering whether to specialise in this field, and replying to your repeating of the claim as well as to the original instance increases that chance. I don't consider it pedantry.
I don't see engineers not being part of the process for many years, even if most of the work is done for them. For most companies, if they had their engineers suddenly become 10x more productive, they'd want them to do 10x as much, not scale down to 10% of the staff. Not to say some companies wouldn't.
To replace a developer you would need a human level AI, that is impossible for now.
You can improve the tech to do simple jobs and help me like
- review this code I wrote for potential corner cases
- generate some unit tests for this functions
- find some code in this giant project that does X . I know I wrote it 3 years ago but I have no idea how I named the function or maybe it was a different project.
- rewrite this old IE6 JS/jQuery into modern JAvascript
But IMO a tool that can do this would use LLM but you need an actual valid code checker/interpretor to do a production ready code. I can't trust an LLM to update a giant piece of code without chainging something, I prefer a tool like Intellj refactoring that actual understand code.
I think you'd actually struggle to find an example in history where productivity gains have resulted in prolonged, and industry-wide unemployment for those trained in that area.
I completely agree that technology can make individuals redundant, as in your flight crew example. And yet we are seeing a global shortage of airline pilots, how do you explain that? If technology makes people unemployed (across an economy, over the medium-long term), why aren't there piles of pilots working at McDonald's?
Is not that as technology improves, industries which were once small/unprofitable can balloon into hugely lucrative industries?
On the contrary, it's expanding and there's a global shortage of them [1].
AI has been changing the role of radiologists but not replacing it [2] and radiologists are needed more than ever, but the industry has been struggling to communicate this to students worried by ill-informed claims the profession is under threat from AI [3].
[1] https://www.rsna.org/news/2022/may/global-radiologist-shorta...
[2] https://www.hcinnovationgroup.com/imaging/radiology/article/...
When steam drills were becoming the norm I'm sure some mining firms were struggling to hire human diggers too.
The "Radiologists are being replaced by technology" story has been repeated so many times by uninformed software developers that it has become popular wisdom, but the reality so far is that we need more radiologists than ever.
Ironically, radiology might be a decent proxy for what could happen with software engineering, but in the opposite way you intend.
[1] https://marvel-b1-cdn.bc0a.com/f00000000046012/info.vrad.com...
To think some new 'programming' tool will make it shrink is not at all warranted. Tools that make computer programming more accessible, more flexible and more powerful will increase demand for people who can reason about it, work on it, teach it, evaluate it etc etc.
I'm not even slightly worried about my job security. I tried Copilot and it sucked.
At the end of the day, LLMs are fakers. They do not possess real intelligence, they merely fake intelligence using statistics and training data. There comes a point where you can't fake it any more.
Maybe in the far future when we have programmed nearly everything there is to program... Until then companies will just produce n*(n/(n-m)) more output.
Actually, the reduction of the cost of programming output will logically lead to more demand as solutions that were previously deemed too expensive to produce will become viable.
Some redditors put together where the claim came from, it's a bad interpretation of Microsoft's Scott Guthrie, should be "40% of code checked in by users of github co-pilot" [1][2]
[0] https://youtu.be/ciX_iFGyS0M
[1] https://www.reddit.com/r/github/comments/14qwhem/how_does_gi...
[2] https://www.microsoft.com/en-us/Investor/events/FY-2023/Morg...
I wish AI could write more of my code but it really is much much faster if I just write it myself. The context and curiosity necessary to even know what questions to ask so you know what code to write is far beyond the scope of any AI I’ve seen.
This is great news if your job is to do the thinking. You will have more time for better thinking. Awful news if your job is hand-on-keyboard typing with others telling you what to do.
I struggle to think of a single instance where it's been helpful for me, and I keep trying, because I don't enjoy doing useless grunt work any more than the next guy, and I want to at least try to learn to ask it the "right" questions.
The other subject I give it high praise is shell one-liners. It can produce some hideously abstruse chains that, by and large, do precisely what I asked. It’s not as good with awk, I’ve noticed, but maybe that’s because awk is much more akin to an actual general purpose programming language than, say, sed.
I have seen no evidence of "most code [being] written by AI" and believe this to be completely false.
It is not. 90% of the Job a SW dev is doing is impossible to do for ChatGPT. Writing 15 line snippets from a CS101 course is useful to reduce boring repeated tasks, but nothing more.