Just by curiosity, is there Artificial Intelligence which write/create CFML programs/coding ? (Personaly, I do not see the need)
Sure:
I prompted it with:
Can you pls write some CFML code that actively demonstrates that you can, indeed, write CFML code (if you see what I mean, don’t just use a “hello world” example).
It did take clarification for it to understand I wanted it to talk about itself in the code.
// Display a message indicating that this code was written by ChatGPT
writeOutput("Hello, I'm ChatGPT, and I'm writing some CFML code!<br>");
// Define a function that takes a string as input and returns the reverse of that string
function reverseString(str) {
var reversed = "";
for (var i = len(str); i >= 1; i--) {
reversed &= mid(str, i, 1);
}
return reversed;
}
// Test the reverseString function
testString = "racecar";
reversedString = reverseString(testString);
writeOutput("The reverse of the string '"&testString&"' is '"&reversedString&"'.");
Other than that, in my experience Github Copilot is not great with CFML… it keeps writing JS instead. I do not find it helpful.
But I find it good when using PHP or Kotlin. My guess is that it’s got a larger body of work to base its learning on in other languages as CFMLers don’t tend to participate in their community much, sadly
Being more abstract about it, I was just able to ask ChatGPT this:
OK, changing topic. I need to write a tutorial about how to test abstract classes in PHPUnit. I’ve got the technical side covered, but I’m struggling to come up with a handy few classes to use to use in the demonstration. I wanna avoid the usual AbstractAnimal which Cat and Dog extend, if you see what I mean. I’m after something simple, but conceptually “real world” (animals and cats and dogs are not things one would have in a business app). Got any suggestions? I just need like the abstract class and two implementation classes. Maybe one implemented method in the abstract class, and one that requires implementing in the concrete classes? Sorry that’s a lot to digest, and I know I’m being lazy (this is for PHP btw, but pseudocode would be fine)
And it nailed it conceptually, and the code it wrote was tidy and correct (PHP though)
So even if not helping in the copilot sense of “help”, it is handy to get the ball rolling.
PS: asked it to translate the PHP into CFML and it messed a few things up.
I use GitHub Co-Pilot.
Naturally, the more I use it, the better it gets.
I use it mainly for short-cutting logic boilerplate.
That is : if I have a struct / array etc - and I want to loop through it…
Then co-pilot, sets up the code for the looping for me with the correct index / item and the “thing” that I am wanting to loop through.
OK, I understand, this is your own (or for a team) AI to be more and more efficient in your personal work. Is this applicable for CFML programming ? (I suppose all type of programming ?)
Thanks.
Now, a question of time to topple to new habits of working. Considering gain of time in future.
Any update on this topic? Have you found a good LLM to help with Lucee? I have been using ChatGPT 4.0 with Canvas. It is an excellent concept - the code is in a window on the right, and you chat in a box on the left… It helps a lot with things like CSS, HTML. SQL and bootstrap but kind of fails on lucee and even regular expressions…
I find it gets me close to what I want but still requires me to fix things manually.
We’re using co-pilot and I find it works quite well, now, with CFML.
Irrespective of the language, I will always review the code - before using it - but it certainly a lot better - in just the last few months.
The Co-pilot “Chat” in VS-Code is surprisingly good. I have tended not to use it (co-pilot), previously, because it did such a shitty job with CFML. But now I find myself using it more and more.
Asking it something like: “Using the script version of coldfusion can you create a b-tree sorting algorithm for me”
Provides me with a really solid function - that after review requires no changes at all.
I’m a big fan of Codeium, especially with their recently added Supercomplete feature. It doesn’t simply autocomplete your current line but also anticipates related changes to the rest of your code. I even decided that Codeium Pro is worth the $10/mth for for priority responses, etc.
Codeium also works well with Lucee and learns from your coding practices, with the usual caveats of AI in general.
I might some day try their Windsurf IDE, but not in a big hurry to jump the vscode ship so for now I’m only using their extension.
Actually I use the non-telemetry VSCodium aka Codium build of vscode which makes the Codeium name a tad confusing, but also pretty funny to say I use Codium with Codeium.