Dim convertedSpeed As String
convertedSpeed = PaceToSpeed(pace) ' Result: "7.1 mph"
Dim convertedPace As String
convertedPace = SpeedToPace(speed) ' Result: "08:34 per mile"
After playing with it pretty extensively over the last few days, it’s clear that it’s not ideal for Xojo, as it lacks the training in the language specifics, especially Api 2.0.
While it may get some of the mechanics of Xojo wrong, for the most part the logic is sound and gives you exactly what you asked for, leaving you just to fix the particulars of the Xojo syntax. In the instances where I got undesirable results in the logic, it was because my instructions were ambiguous or otherwise needed more specificity.
I recall a particular video of a dad asking his kids for instructions to make a peanut butter and jelly sandwich, and that’s basically where ChatGPT is now.
I’ve had far more success getting code that was just copy-and-paste in other languages like VB, C# and Python, simply because there’s not enough training on Xojo, but I bet someone with enough time could train a custom GPT4 model and get pretty good Xojo code out of it.
This is all still in it’s very early days but it’s clear to me that other than in the most complicated projects, our roles will largely migrate away from being code-monkeys and more towards being project managers while AI handles much of the code generation.
We thought that Grammar and Orthographe correctors would make people incapable to write correctly, but it seems not. People who care use corrector and learn when they do mistake (or correct the corrector), but people who don’t care make a lot of errors and don’t try to correct themselves.
I use calculator but I do mental calcul too, and I care about the result is just. People who cannot make easy mental calcul cannot make complex calcul with a calculator.
I hope, and I think, it will be the same with AI code development. Programmers will use it as a tool to write submethod of complex software. Non programmers will us it to make easy little software for their own use.
I think Perry hits the nail on the head: how much time do I spend on low level coding after having a cool new idea? It’s not so bad if i know a language well like xojo, but i struggle and get frustrated with languages i’m not so familiar with like python. Hopefully chat et al will allow us to focus on higher level concepts.
So far my experience with chat has been dismal: 1) I asked it a scientific Q related to my research and it came back with a great summary complete with references from the literature…that do not exist. 2) I asked it to generate some code in xojo and it came back with a very elegant code snippet…using functions that do not exist in xojo. so i moved on. but maybe 4.0 is better?
It definitely requires precision questioning, but as others have pointed out in some of the other recent threads about GPT, you can go back to the thread and provide context or corrections and it will adapt. Sometimes incorrectly, but I think the idea is to keep the scope of what you’re asking for really narrow, and be as specific as possible in asking the questions.
my Q was very specific, and chat basically made up a bunch of stuff making the response sound very authoritative (like some of my students have a habit of doing…). When I called him (her?) on it, chat apologized profusely and said it was still learning. Quite charming but the problem is that if you cannot trust the answers without knowing or suspecting (or checking) that they are wrong or fabricated, what’s the point?
Goes back to the importance of keeping the human in the loop as has been alluded to in this thread.
At least for now, the quality of the response seems to depend on what you’re asking about. I’ve done a few tests with OpenCV, and it seems pretty proficient in that (which, depending on how you look at things, could be pretty troubling…).
But I mean, some things it’s just going to know better than others. Xojo is a less frequently used language, and has seen some significant changes that it simply doesn’t seem to know about. but given a bit of time, I can’t see how this won’t just get better from the point of view of automating code. It seems pretty good with C though – which makes sense since it’s been around forever and is much more widely used. But it’s lost when I ask it to write something using OpenCV-C, an open source C wrapper for OpenCV 4.5 my company commissioned so we could use it in Xojo. It just hasn’t got that in its repertoire yet.
I haven’t used it for Regex, but I’m kind of excited to try. While I know how powerful it is I absolutely hate regex and generally avoid it – or I look to see if someone else has already posted what I need. I don’t have the mental bandwidth to do the contortions necessary to get to where I need to be with that, so I’d be happy to let someone (something) else do it and then test the hell out of it to make sure it works.
Agree. and i have no problem with someone (or something) not knowing the answer. The first thing i teach my students is, if you don’t know, say so. Don’t BS. the only thing worse than no information is incorrect information. I was astounded at chat’s propensity to BS its way to a seemingly reasonable answer, rather than saying, “sorry, i don’t know”. So when can you ever trust what an AI will come back with? (same goes for some humans BTW).
RegEx hasn’t changed much in the last 30+ years (probably closer to 50+). It is ubiquitous and well documented. So it makes sense that AI would produce good results.
Before 1992 there were lots of variations, in 1997 (26 years ago, and after the first tentative of a standard written in 1992) the PCRE lib was created, and a real standard was spread. Few changes after that.
When I heard of this new automotive feature called, “Cruise Control”, I thought it would make people less safe; they would stop paying attention to the road. Once I tried it, I saw I was less tired on long (300+ miles) trips and thus could pay MORE attention to the road. Because I was on cruise control, I was more alert and ready to respond.
When spell checkers came out, I thought it would worsen my already poor spelling. But by pointing out the misspelled words, I got near-instant feedback when I made a mistake and became more aware of the words I commonly misspelled.
Sometimes what you think will happen and what does happen are different.
Function SpeedToPace(speed As String) As String
Dim mph As Double = Val(speed)
Dim paceInSeconds As Double = (60 * 60) / mph
Dim minutes As Integer = Int(paceInSeconds / 60)
Dim seconds As Integer = Wildcard(paceInSeconds Mod 60)
Return Format(minutes, "00") + ":" + Format(seconds, "00") + " per mile"
End Function
Blockquote
It replied in seconds instead of Wildcard you should use Mod