Is Coding Dead? – Teaching Python in a ChatGPT Age

Teaching Python Podcast – Episode 130: Coding is Dead? is basically about the impact on teaching Python of LLMs / Generative AI / ChatGPT / Copilot / Gemini (I’ll use ChatGPT for short). The video is a conversation between four people, and, although it includes a lot of great content,  it can be a little diffuse. I strongly recommend speeding the video up a lot.

Here are some notes and reflections:

  • Programming more accessible?: ChatGPT makes programming more accessible to more people. They might be able to build things by asking repeated questions to the ChatGPT until it seems to work. The example was given of a clever non-programmer who built the website his business needed.
  • Programming more economic?: ChatGPT makes programming available to solve problems where it wouldn’t have been economic before. The alternative to ChatGPT code (with human guidance) might be no solution at all in many cases.
  • Motivating for young students?: ChatGPT will be very useful teaching Python to kids – they can experience the motivation from making something actually rewarding to make (e.g. a Fortnite tracker) using ChatGPT. You can then teach on top of that e.g. what a file is (so they can actually find the output statistics on the file system)
  • Correctness even more of a concern?: The big question we need to move front and centre – “Is it correct?” This is now the big question people need to be able to assess. We need to emphasise it to our students. Sometimes ChatGPT can fix broken code but it doesn’t know what you are actually wanting (or should be wanting) the code to do. See https://xkcd.com/568/ (“You’ll never find a programming language that frees you from the burden of clarifying your ideas” [“But I know what I mean!”])
  • Loss of human-readable code?: As with modern HTML, we may be sacrificing the ability for humans to read and write Python in return for letting ChatGPT do most of the work writing the code. And if we are going to have lots of mysterious code, why should it even be Python? Why not binary? [One possibility – code in the wild splits into better-than-ever code (ChatGPT assists good coders with documentation and simple, starter tests) and impenetrable code that is not written for human readers. Perhaps we are about to enter both the best of times and the worst of times**]
  • Embrace the change?: Analogy of calculators and mental arithmetic – maybe we need to embrace the change, at least when teaching young people. BTW this doesn’t mean people won’t need to learn how to read Python and understand it – but maybe not everyone will need that. And the others will still learn something practical about making things using code. Our main lesson for the latter might be how to avoid the worst hazards of this approach.
  • Allow ChatGPT in interviews?: Job applicants – get them to explain their code carefully. Care less about how they wrote it and more about whether they can understand it, maintain it etc. Insisting on no-ChatGPT interviews etc is like asking people to write sorting algorithms. Misguided and a bad test of candidate ability and value.
  • Allow ChatGPT in assessment?: Focus on how people can explain what they did and what they actually achieved using all the available tools.

Of course, this revolution is still playing out (sometimes participants in the conversation learned something important from the others) and we’re just starting to learn how best to relate to it.

And I haven’t answered the question “Is Coding Dead?”. Old-style coding is, but coding itself as a skill and activity will be alive and well. Who would code now without access to Google and Stack Overflow?

TechNoon – A New Community Technical Education Initiative

Along with Ben Denham, I’m co-founder of TechNoon. The elevator pitch: “TechNoons are brief, free, industry-led, in-person training courses run at lunchtimes for people in technical jobs wanting to improve their skills.” TechNoon courses will usually have four sessions of 2-3 hours each (including homework). We think there is a major gap in technical education for people already in employment.

Why TechNoon is needed

  • Tertiary degrees and diplomas are not a good answer for people already in jobs. Even boot-camps are a significant challenge for most people with job commitments. Courses also tend to be too general with hit-and-miss content for people in specific roles.
  • On-line courses and individual articles and documentation can’t provide the individualised support and the motivation that an in-person course can.
  • Internal corporate training can’t achieve the economies of scale and specialisation of an industry-wide training ecosystem.
  • Vendor training doesn’t cover the range of skills required and is not focused primarily on what is good for industry.

What Next?

  • Have other people delivering pre-prepared TechNoon training content
  • Have courses run outside of Auckland
  • Extend the range of technical skills covered
  • Consolidate industry support in the form of trainers and venues
  • Set up a community organisation to underpin TechNoon and to provide train-the-trainers courses

Why SuperHELP for Python?

I created SuperHELP to make it easier for people to write good Python code. You can find the project at https://pypi.org/project/superhelp/

SuperHELP logo

To summarise the rationale for SuperHELP I have thought of a few taglines:

SuperHELP – Python help that really helps!

SuperHELP – Help for Humans!

and even

SuperHELP – Make Python Pythonic!

Some context might help explain:

Python has secured its position in the top tier of programming languages and more people than ever are learning to write Python. But, let’s be honest, a lot of Python code being written is not what it could be. Even an elegant language like Python can be written badly or in a way that is hard to read or maintain.

To make it easier for people to write good Python we are already well-served by IDEs from IDLE upwards. People have easy access to style linters and IDEs clearly signal syntax errors and basic mistakes like unused variables. But wouldn’t it be great if people could check their code to see if there are better, more Pythonic ways of doing things? Or to learn more about basic language features and Python data structures than the standard help can offer?

That’s where SuperHELP can play a role.

So what exactly is SuperHELP? Basically it is an advice engine. SuperHELP reads a snippet of Python and provides advice, warnings, and basic information based on what it finds. For example, it might notice a function docstring is missing and show a template for adding one. Or identify the use of a named tuple and explain how to add docstrings to individual fields or the named tuple as a whole.

The intention is to make sure that everyone, from beginners upwards, learns something useful. Even an advanced Python programmer might not appreciate the benefits of using functools.wraps when creating their own decorator. Or an experienced Java programmer might not realise that Python properties are a much better option than getters and setters.

So how can people use SuperHELP? For most people, the easiest way will be to open a binder web notebook and enter their code there.

Binder

Of course, because SuperHELP is a pip package https://pypi.org/project/superhelp/ it can be installed alongside Python on a machine and used directly from the terminal e.g.

shelp --code "people = ['Tomas', 'Sal']" --output html --detail-level Main

If the output chosen is html (the default) output looks like:

And if –output cli (command line interface i.e. terminal or console) is selected, output looks like:

In all likelihood, there will be other ways of making SuperHELP advice more readily available – probably through integration with other platforms and processes.

SuperHELP needs your help:

  • If you have any ideas, or the ability to help in some way, please contact me at superhelp@p-s.co.nz.
  • Spread the word about SuperHELP through your social networks.