First off, who came up with the term Vibe Coding. It's stupid. You will accomplish nothing if you are going on a "vibe". I feel like Inigo Montoya - I don't think that word means what you think it means. But I digress.
I have been experimenting with AI assisted coding for a while. More like playing around with it. Needless to say, I have found it lacking. I checked in with some professional coders that I know and, to my surprise, found that many of them were using AI tools, but mostly to do simple stuff or give them ideas of how to solve a problem. So, while I still think it would be literally insane to create a mission critical application using so-called vibe coding, I figured I'd give a chance for something less dramatic.
Previous experiments didn't quite work out, but given some recommendations from folks I respect, I thought it worth another go.
The Project
To be fair to AI tools, I wanted to pick a project that it has a reasonable chance of accomplishing. I set down the following criteria for such as project as:
- Must be simple enough that a moderately experienced programmer could accomplish it.
- Should be a well-known and, hence, easy to define problem. I was not looking for creativity or magic.
- Needed to be short. A subset of "simple", a relatively short program would be unlikely to have too much complexity and would be easy to debug.
- Should do something useful. Why bother with something esoteric when you might get something out of it.
I decided I wanted to port the Linux BASH script screenfetch to Powershell in Windows. Powershell is very useful for accessing Windows system information and screenfetch is a useful Linux tool for extracting system information. A Windows screenfetch would not be overly complex, would be useful, likely short, and has a relatively narrow and well-known problem domain. There was also a direct example to work from, thereby giving the AI tools a leg up.
The First Pass
Having used Microsoft Copilot and ChatGPT for coding projects before, I did not have a lot of confidence in either. I tried a different AI agent that I had heard good things about called Qwen. I initially wanted to try out Claude Code but had to have a subscription for that and I'm cheap about these things. I told the Qwen AI app that I wanted to recreate screenfetch for powershell and Windows and that it needed to be as close as possible to the original. Obviously, I said it better than that.
Qwen wrote the script which I downloaded and ran. It puked. Sigh.
Fixing the AI
I then created a project in Github, added a Readme with some basic placeholder text, and accessed it all in VS Code. Some quick debugging found that the Qwen code had used deprecated functions and, worse yet, functions that did not exist at all in Powershell. In other words, it made up things such as system calls and environment variables. That was a big miss, but predictable.
The best I can tell is that Qwen couldn't discern between code with errors and good code that it had ingested. I suspect it spit out someone's mistake. It was easy enough to find out where the errors were, use Powershell documentation to find the actual commands to call, and fix it so that it ran. Problem one solved.
Incidentally, when I asked Copilot to fix the code, it came up empty. I don't think it was just a Qwen problem so much as a general AI ingesting problem. AI has no good way to know good code from bad when it ingests it and hence will spew bad solutions as well as good. This was ironic because Copilot and Powershell are both Microsoft products.
That said, the structure of the script was good, and it worked with my fixes. Qwen got me off to a good start and hence accelerated development. This suggests, as my developer friends said, that AI tools helped with simple tasks, but could not be relied upon to write code that was correct and reliable. AI provides a head start but is not trustworthy.
Documentation
The next task I gave AI was to write documentation. Documentation is something I'm very good at and am able to judge well. I asked Copilot to do the following:
write documentation for the Screenfetch.ps1 script that includes a description, proper usage, explanation of functionality, and limitations.
It did a pretty good job. Good, mind you, not great. The text it created was accurate, though not complete. Copilot didn't seem to understand where to put more explanation or emphasis. Unlike a human, it also couldn't think beyond the basic parameters of the prompt.
For example, Copilot correctly showed how to run the script... in one way. The better way was to add the location of the script to your PATH command so that it could be run like a system command. That's how the original screenfetch works. I added that part. Copilot also didn't predict other ways, other than from within the powershell shell, that this might be run. I added instructions on how to run the script from the old-fashioned command line shell, cmd.
The most useful part of the documentation was the limitations section. It correctly listed several limitations of the script which, in turn, suggested useful changes to the code. This is a powerful feature. If AI can analyze limitations of code, it is much easier for a human to identify changes that may not yet be tied to a requirement. Anticipating future requirements is very useful indeed.
Evolving Code using AI
With those limitations in mind, I decided to make some changes to the code. There were three areas to focus on. First, the original code didn't exactly replicate what was in the Linux version. It left out GPU and Packages entries. Second, as pointed out by Copilot, it didn't report on multiple disk drives, only the first fixed disk. Third, the graphic that Qwen had created was nonsensical. It was a weird ASCII blob that bore no relation to anything representing a Windows OS icon.
I tried the last task first. I used Qwen, OpenGPT, and Copilot to create an ASCII representation of the current Windows logo. They came up with garbage. Just random ASCII characters. I ended up coding this by hand which is exactly the type of drudgery that AI is supposed to save us from. It seemed an easy enough task, but alas, nothing seemed to get it close, let along correct.
Next, I asked Copilot, from within VS Code, to add the GPU detection and account for multiple fixed disks. It actually did this without trouble. Copilot plugged in the code, VS Code showed both the original and changed code and let me decide if I wanted it or not. I was able to run the new code before accepting it. Definitely a win for Copilot and AI.
Next, I asked it to add the number of applications to the script. It did so without error. Interestingly, it still labeled it as Packages, as it is int he Linux version. Linux Packages and Windows Applications are not the same. Packages not only includes applications but also system and other shared libraries. Applications are a subset of packages. For Windows, packages are not important compared to applications. I left it in that way, however, so that it looked like the original screenfetch. I admit I'm on the fence on this one though since you would have to read the (human updated) documentation to know the difference.
Evaluation
Damn! For something simple like this, AI tools had a big effect. I would say that I was able to create this script in less than half the time it would have taken me otherwise. Given the initial and subsequent output, the narrow problem domain and existence of a known model were critical to its success.
Therein lies the AI Achilles Heel. It needs an existing model to work from. If I was porting code, AI would be a lot of help. If I was doing something creative from scratch, it would have been a little help, perhaps as I was adding features later, but not nearly as much. Adding snippets of code seems to be easier than either wholesale creation or overhaul.
The other problem is that a developer has to have enough experience debugging the equivalent of someone else's code. It's much easier to understand code you wrote than code someone else wrote, or in this case, something else. If you can't trust the code, this is a serious problem.
AI tools for coding are improving. You still need an expert behind the wheel, need to keep things simple, and the problem domain narrow. AI is a tool not a replacement for human coding. Use it as such.
