And… here we are

This week what we have all been fearing has happened to me: GitHub Copilot generated code for me which seems to meet all the requirements but which I don’t understand very much at all.

To date GitHub Copilot for me has just been mostly a useful auto-complete tool and it hasn’t given me any code which I didn’t understand. But with this code (to control two different hardware timers/counters on my Arduino) I don’t really understand it at all. I have passing familiarity with some of the registers used because I saw them named in the datasheet (which I have only skimmed so far) but basically I don’t understand how this works.

It is tempting to ignore the fact that I don’t fully understand and move on, but there’s a part of me which wants to return to the datasheet so I can understand what every assignment GitHub Copilot offered actually does and what every value it calculated implies. Is that the best use of my time?

11 thoughts on “And… here we are

  1. Like basically all “should” questions, there is no inherent right answer.

    On the one hand, you could say, “This is the same thing as if Craig sent me some code that I don’t understand.” And you could either just use it, trusting Craig knows what he’s doing (said trust based on past interactions), or try to understand it, maybe asking him questions about it.

    On the other hand, you could say that by using it you’re contributing to the downfall of your own profession. :) (Smiley indicates I don’t necessarily hold this view.)

  2. What a time we live in! And, yes, it’s complicated, and kinda fun to think about. I think in this case though, it’s colored by the fact that I am only doing this project for pedagogical purposes; that is, I am doing this project so I can learn more about how the electronics and the programming work. So if I fob off the details to AI, I am only cheating myself. On the other hand, if this were a commercial synthesizer I were developing, perhaps the best use of the client’s money would be to allocate my time on issues other than deeply understanding the timer/counter configuration code.

    • If you were doing it for a customer, I would REALLY hesitate to use generated code. The IP situation there is entirely untested. At work, we are not allowed to use AI-generated code, and I think that’s wise.

        • So does not having the CEOs of our competition murdered. :) Just because something leaves us at a disadvantage in that strict sense doesn’t make it a good idea. There are other factors to consider.

        • That’s rather a leading question. It’s a risk calculation, certainly. It’s a fact that the legal situation around AI generated code is pretty murky, and the exposure is therefore nonzero.

          How much faster/better/easier something lets you work is only one component of whether it is an appropriate tool. And of course it depends on what you’re making. We have a lot of “secret sauce”, in that our competitors have a giant hill to climb to do what we’ve done. A consulting company that charges only for labor does not have the same type of value – theirs lies in the productivity of their workers less than the thing they’ve produced – so they could rationally reach a different conclusion on the risk calculus.

          For us, given the current state of affairs around AI generation, it’s the right call IMO.

          • Yes, I agree that this is an issue best seen through the lens of risk analysis, and it’s quite reasonable that given our different contexts we arrive at different conclusions.

  3. On a related note, from the other end of the spectrum, last week I downloaded the code for Entity Framework Core https://github.com/dotnet/efcore because I had a passing interest in it (I have never used it), but it turned out it is comprised of more than one million lines of code. And that’s just one library! Way beyond my capacity to understand, even if I wanted to.

Leave a Reply