Users need generative AI tools for code to be configurable to write tests first, then implementation code, use existing tooling, and adhere to specific coding style guidelines. This would prevent "sloppy" AI-generated code and ensure better integration into existing development workflows.
Today’s generative AI pondering: If it were to be acceptable from an architectural standpoint, I wonder where AI would be welcomed sooner than later. Yesterday, upon reading some more of the “Testable Code” O’Reilly book, I came to learn that testable code means your code is easier to test, understand, and maintain. One problem I can appreciate from engineers and management is seeing genAI code everywhere, and having it be sloppy — hard to understand, no tests, hard to maintain — code that might be more easily rewritten than fixed if the need for changes were to surface. Currently, the most acceptable place I can imagine your typical generative AI being is in the middle: - if you’re demoing a visual in code - if you’ve generated some code before refining it for tests and production I think most people can agree that genAI has a spectrum of code quality, which might not always be the fault of the developer. As LLMs and their features improve, I’d be curious if user stories (similar to the category of “prompts”) could be used to create behavior-driven files and test-driven code, which could result in having more easily understandable, maintainable, usable code overall. The problem with that is the implication that LLMs are not currently commonly fine-tuned to deliver the desired, consistent results that the average ChatGPT-using developer might need for results that can get them hired (or not fired). I’m no AI/ML expert, so — just know that. With that said, I have learned in recent months that oftentimes what people want AI to do is actually better off just being automated. AI can make decisions, but take CSS for example. If you’re flying through a personal project using Tailwind, then prompt AI to design you a new feature based off a description and a screenshot, it’s entirely possible that unless you specify, your AI of choice will default to something you were not using prior - vanilla CSS, for example. Even if the production time decreases dramatically, if you’re using a combination of Tailwind, vanilla CSS, BEM classes, CSS modules and CSS-in-JS, what’s the point in upfront speed if your code is neither tested, easy to read, or maintain? I am of the opinion that if the top 20-skilled senior engineers who complain about genAI usage got together and wrote a book/did a podcast/made a YouTube tutorial about what they wouldn’t accept or consider fireable and why, your average developer could just learn from that feedback and improve their core skills, as to write better code that aligns with that (regardless if they are using AI). I currently like using AI like Google. “Did you read the docs” is a fair question from your team and management. I can read docs, summarize or Q&A with ChatGPT, and bug my team members less with a high-volume of tiny questions. I can use it to whip up a demo to quickly communicate with non-technical people on the fly. I think AI can be used in many places, but is often best used in the “middle” of things.