Anyone using AI to write code?

I’m starting to explore what AI tools are out there for developers… starting small by using CoPilot for syntax help here and there, but I can’t get it to write anything complicated that actually compiles in an Epicor Function/BPM (it comes close though!).

Anyone doing anything cool / useful yet? Very interested to hear your experiences!

2 Likes

Believe it or not, I use it all the time.

Mostly for snippets, but with careful “prompt engineering” and a watchful eye, you can use it as a good second hand.

3 Likes

Nice. Copilot? Or something else?

Paid ChatGPT.

2 Likes

ive used Copilot and paid chatgpt. GPT is better at sql.

2 Likes

I do have to argue with it a lot lol.

I usually win. It does seem to be getting incrementally better.

I used to hate it, now I find it a valuable tool.

Gotta watch it though.

I See You Reaction GIF by Pantaya

1 Like

I use it daily. Free ChatGPT
Just used it for a calculated variable on variance a created in a BAQ.


Also for talking smack with my sports friends.
ChatGPT, who is the best all time NBA starting 5 if you combine NBA and ABA statistics.

1 Like

Sample conversation I had with it just now for this thread.

ME->

  • I have some JSON, that I want to deserialize into an object with Newtonsoft.Json, I’d like to do this with deserailizeanonymoustype and a template object. If I post the json, could you generate me a c# template object as an anonymous type?

ChatGPT->

  • Yes! Please post the JSON, and I’ll generate a C# anonymous type template for deserialization using JsonConvert.DeserializeAnonymousType.

ME->

{
    "TestObject": {
        "Prop1": 0,
        "Prop2": "poop",
        "Prop3": 5.4
    }
}

ChatGPT->

  • Here’s how you can define a C# anonymous type template and use it with JsonConvert.DeserializeAnonymousType:
using System;
using Newtonsoft.Json;

class Program
{
    static void Main()
    {
        string json = @"{
            ""TestObject"": {
                ""Prop1"": 0,
                ""Prop2"": ""poop"",
                ""Prop3"": 5.4
            }
        }";

        var template = new 
        {
            TestObject = new 
            {
                Prop1 = 0,
                Prop2 = "",
                Prop3 = 0.0
            }
        };

        var result = JsonConvert.DeserializeAnonymousType(json, template);

        Console.WriteLine($"Prop1: {result.TestObject.Prop1}");
        Console.WriteLine($"Prop2: {result.TestObject.Prop2}");
        Console.WriteLine($"Prop3: {result.TestObject.Prop3}");
    }
}

Explanation:

  • The template object is an anonymous type that matches the JSON structure.
  • JsonConvert.DeserializeAnonymousType uses the template to infer types and deserialize the JSON.
  • The values are then printed to verify successful deserialization.

Let me know if you need modifications! :rocket:

4 Likes

I use CoPilot and ChatGPT to help me write M code for Excel power query, among many other things. But I really don’t know any M code. I can program in other languages. So it helps to know exactly what you want it to help you with. I use it for VBA in Excel macros, SQL expressions, C#, and even custom coding languages like Godot. The flexibility is great! It can convert from one language to another.

1 Like

So it begins…

1 Like

I use it all the time as an accelerator.

Puts on professor hat
The mistake I see way too often is folks letting these tools write the code—like full-on “Vive la CodeBot” style (or whatever we’re calling it this week).

These tools are incredible accelerators, no doubt, but having them write complex logic without fully understanding it? That’s a recipe for broken stuff, security nightmares, and leaked company data.

Be super careful using ChatGPT (or any of these models) with Epicor. It’s way too easy to accidentally share proprietary info. If you’re on Azure, look into enabling OpenAI through it—it’s a much safer route than the generic public models.

These tools make me and my team 10x more productive, especially when repeating patterns. But I just had to give my new Junior the “tough love” talk after he submitted code that didn’t work and didn’t make sense to him. Looked shiny—chatbot wrote it—but had no clue what it was doing.

Use it for snippets like @klincecum does, but don’t have it write whole apps this things don’t keep context very long and they “forget” what it is the were doing all the time. So you could start it writing an app and half way through it will have no idea what the initial project / goal was this can lead to some really insecure applications.

Please, for the love of all that is holy, never copy-paste anything from a chatbot, the internet, or even this forum if you don’t understand what it’s doing, why it’s doing it, and what it might break.

takes off hat

Oh and if you are using commercial ChatGPT make sure you turn this off. “Improve the model for everyone” is double speak for “use my data in your model training” and if you are using it for work I can all but guarantee you that would be breaking some pretty serious rules

8 Likes

I use a mix of both too for snips of code for BPMs/uBAQs. It really helps if you can be specific in your questions like @klincecum’s post above shows.

Or 10x less productive, in my case, trying to get the stupid thing to generate an image of a real animal. :rofl:

8 Likes

GPT 4o’s image generator enters chat.OpenAI’s new AI image generator is potent and bound to provoke - Ars Technica

2 Likes

Outstanding…

I want to feed it a dumpster fire meme and see what it does with it.
:rofl:

1 Like

I normally use it to help debug, but its a great resoruce if you solo coding and dont have anyone to talk it over with.

1 Like

Original

5 Likes

Hands GIF

2 Likes

10x??? I would be happy with 1.5x lol. I can kind of understand that for juniors struggling to get code to compile, but for a veteran like you I’d think there is less room for improvement…? What are some things it helps you accelerate?

2 Likes