Musings on AI and Development
I was doing a little work on a personal project over the weekend, tidying up some code.
I should note that I am not a developer. I just write things for fun and to scratch my own personal itches.
As a result my code often works, but is basically an overgrown script that has pretensions of being a program.
One of the things I was doing this weekend was tidying up an old project by moving some database operations into their own class. As a result they’d be easier to manage in the future.
I was working in PyCharm, which has plenty of good ways of doing this.
I’d take a line like this:
cursor.execute('update Files set FileRun = ? where FileId = ?', (file_run, db_file_key))And turn it into a method in a class like this:
def update_file_run(self, file_path, file_run):
db_cursor = self.db_conn.cursor()
try:
db_cursor.execute(
'update Files set FileRun = ? where FileName = ?', (file_run, file_path)
)
self.db_conn.commit()
return True
except:
print(f"Error updating {file_path} in database.")
return False(Yes, I know that the except: clause is overly broad, and there are probably other issues, but that can be improved in future iterations.)
As I did this it occurred to me that this is the kind of thing that an LLM would be excellent at.
So I gave it a shot, and it did it pretty well for the example database action I’d chosen. There was very little difference between the code above and its output - just variable names and the error handling.
I was impressed.
And then I did the work manually anyway.
I haven’t done this kind of thing often enough. I made a few educational mistakes - for example, I refined my understanding of Python’s class variables vs instance variables.
Sure, the AI assistant would have done the development of the software faster, but it would have denied me my own opportunity to develop. Sometimes when you’re staring at the code, it develops you, not the other way around.
I’m not a magnificently better coder than I was before doing this. There were no revelations. Just a little honing of a skill I don’t have much of, and don’t use often.
What I was doing was the kind of thing a senior developer has done hundreds if not thousands of times before. So for them to save time by using an AI would be a perfectly understandable choice.
Before AI I suspect they’d have wanted to bounce it down to a junior developer, so that they could get the practice. As I’m doing this for myself, I can choose to develop my skills rather than have to prioritise delivery times.
But in commercial environments people will usually have to prioritise delivery. And when that’s the case, how does the next generation get experience? Not just for the craft, but also in the code base they’re working on?
We risk having a few years during which not only do we not train the next generation of people that would maintain code, but the current generation of programmers loses their understanding of the code being produced.
I can’t believe that this only affects software development. Surely AI risks affecting the personal and career development of people in many other fields?
And is anyone planning for how to handle the effects of that loss of development?