Free Republic
Browse · Search
General/Chat
Topics · Post Article

To: Lou L
I've been experimenting with some AI tools and techniques in a clinical supply chain organization. The results have been no less than stunning (and a little scary.)

I have used AI for code generation. The results are quite a bit less than stunning. But clients get really excited when you claim that you are using AI.

My best results have been with a query similar to this:

"Example [class/method] in the [specify programming language] that does [specify desired action]"

Follow up with additional queries to revise the desired action. This works with Co-Pilot and with Claude.

I can generate complete applications with variations of this technique but they are not suitable for production use. They usually will not compile, let alone run until they are modified in various ways. They are lacking error checks and often contain major logic flaws.

You cannot just cut-and-paste this stuff. You must have a good understanding of the application domain. Testing and debugging remains the huge time sink that it has always been.

I have gotten best results by limiting the scope of a query to class or method generation. The art is in phrasing the queries.

AI codes tend to evolve to incomprehensible gibberish containing inexplicable artifacts if they are refactored too many times. Early results are the best ones.

16 posted on 11/14/2025 6:44:30 AM PST by flamberge (The difference between wild conspiracy theory and proven fact is about two months.)
[ Post Reply | Private Reply | To 15 | View Replies ]


To: flamberge

My best results have been with a query similar to this:

"Example [class/method] in the [specify programming language] that does [specify desired action]"

That is basically my approach too. I ask the AI to generate code for simple, well-understood actions, e.g., "Create a code example written in JavaScript for Node that will send an SMS text message using the Twilio API"

This is a very common thing to do, with lots of examples online. The AI burped this out:

const twilio = require('twilio');

// Your Twilio account SID and auth token
const accountSid = 'YOUR_ACCOUNT_SID';
const authToken = 'YOUR_AUTH_TOKEN';

// Create a Twilio client
const client = new twilio(accountSid, authToken);

// Send the SMS
client.messages
  .create({
    body: 'Hello from Twilio!',
    from: 'YOUR_TWILIO_PHONE_NUMBER',
    to: 'RECIPIENT_PHONE_NUMBER'
  })
  .then(message => console.log(`Message sent. SID: ${message.sid}`))
  .catch(error => console.error(`Error sending message: ${error.message}`));

It was exactly what I needed: Short, simple, and easy to verify.

AI code generation works best with short code snippets.

17 posted on 11/14/2025 11:46:16 AM PST by Gideon7
[ Post Reply | Private Reply | To 16 | View Replies ]

Free Republic
Browse · Search
General/Chat
Topics · Post Article


FreeRepublic, LLC, PO BOX 9771, FRESNO, CA 93794
FreeRepublic.com is powered by software copyright 2000-2008 John Robinson