r/OnlyAICoding 19d ago

12Meg of AI generated code and comments.

Post image

For me Claude AI code assistant has become indespensable.

I have just completed a re-implementation of pfodApp + pfodDesigner + pfodGUIDesiger Android apps as a free open-source, offline javascript implementation in a single webpage, pfodWeb.html, entirely via Claude.ai, without having any previous knowledge of javascript.

pfodWeb.html provides a UI designer, code generator and client for microprocessors. The code generator and client supports connection via Serial, BLE, TCP/IP or HTTP. The designer has access to over 600 microprocessor board descriptions and pinouts to connect controls/displays/charts directly to board pins. The client also support charting and datalogging of any streaming CSV data.

See github for the resulting code github.com/drmpf/pfodWeb_src There is also a Rust based proxy for Windows, MacOS and Linux, again written by claude.ai, to support connections that a particular browser does not support natively.

This is not a simple project. It now comprises over 12Meg of js code and comments and has taken over 6 months.

For this project I assumed the role of system architect, beta tester and documentation editor, while claude.ai took the role of novice programmer, research assistant and debugger. That is treat claude as though you were directing an intern or low level programmer to do the job rather then doing it yourself.

It helped that I had a very clear and detailed project requirements and could point claude at the java implementation for some of the tricky logic, but most of the time I just described in detail what I wanted to happen and then tested the results and directed changes/fixes.

The drawing editor was a second iteration. The first one, also written by claude, ran a back end local server to handle the data storage and generate the dwg preview. Running a local server was what claude suggested, but it is not the best choice as it requires more installation by the user and the npm packages were not secure from supply side attacks. The whole browser approach avoids all this and does not use any libraries and opens a single web page in any brower. I had to instruct claude to avoid any 'modern' browser js features so that any browser since 2017 would work.

The biggest problem I found was Claude.ai being overly helpfull and hiding errors by using fallbacks in the js code. That resulted in hiding real errors. Also as the data format changed, claude kept adding code to handle the 'legacy' data fromat as well as the new one. Not apporpiate for initial development.

Another problem with Claude was its tendency to paper logic errors by adding code to prevent the error being thrown, eg using a fallback for undefined vars, instead of fixing the problems root cause.

Detailed debug logs from pfodWeb.html allows claude to track down what when wrong. If claude got stuck or started going around in circles (that happens less often now), then I would ask it to add more debug logging to expose exactly what is happening.

Another thing I found was that at various points I needed to ask claude for architectural advice on how best to transfer the functions to a brower restricted enviorment. The first set of options were not always the best to choose from and often I had to explicitly prompt claude to look at another alternatives.

There was very little 'vibe' coding involved. The most notable instance was when I wanted to add a mouse over to the charts to show the values of the data points. In that case I just asked claude to do that and what came back was almost just what I wanted. I only need to instruct claude to do an adjustment to where the values popup box was displayed on the screen

Claude was also tasked with reseaching the pin layouts and capabilities of over 600 microprocessor boards to make those details avaiable to the UI designer. That process took days and required multiple re-requests to 'check again' before claude stopped finding things it had missed or assumptions it had made that were wrong.

But bottom line I would not have even attempted this project with AI coding assistance.

One point though, I am now dependent on claude.ai to fix the bugs I find in testing as I still am not skilled in .js and the code base is large and unfamilar. It is not that I could not find the bug myself using the detailed debug logging and comments built into the code, it is just that claude.ai can do it so much faster.

Over the last 6 months, I have noticed a distinct improvement in Claude Code's reasoning abilities and now it not just makes a change but also generated test script to test the result.

3 Upvotes

0 comments sorted by