AI auto prompt

this

really amazes me… but it’s only for vscode (and python or java…)
would be so nice to have it in the xojo ide…

edit: except for the horrible accent of the speaker !

The reason it works for other languages is the plethora of available free sample code on the internet. Xojo has a fraction of a percent of the exposure by comparison.

2 Likes

it would be helpful if users can input code snippets in online documentation.
see here: Example

ms vs 2022 have some nice code suggestions.
generally i advise that we using our brain.
the root of trouble is the framework documentation.

Personally I think that the root of the problem is the lack of GitHub projects converted to API2.

If you think about the history of the product, over the past 25 years it has been many things.

  1. REALBasic with REALBasic as the language
  2. REAL Studio with REALBasic as the language
  3. Xojo with the language also named Xojo, but having the same syntax as REALbasic
  4. Xojo with the namespaced syntax that was introduced with iOS.
  5. Xojo with API 2

that is an issue, so much source code fragments in web without knowing the language and or version. also missing dependencies, or they are not in context what we need in the project.

i guess ms build his own knowledge base for c# ai assistance in visual studio ide.

if I ask an AI (here gemini but it’s the same with almost any “coder” AI)

write me code in xojo to display fibonacci numbers

it can answer quickly

Sure, here is the code in Xojo to display Fibonacci numbers:

Function Fibonacci(n As Integer) As Integer
If n = 0 Then
Return 0
ElseIf n = 1 Then
Return 1
Else
Return Fibonacci(n - 1) + Fibonacci(n - 2)
End If
End Function
End Declare

Sub Window1_Open()
Dim n As Integer

For n = 0 To 10
Print(Fibonacci(n))
Next
End Sub

so there are enough example out there for the AI to answer ?

So code that won’t compile and really inefficient. Also, please use </> when posting code, rather than “quote”

That question yes. My point is that I can ask an AI to write an application in go-lang to interface with the dropbox api and get back a reasonable starting point… but go-lang has only been around a fraction of the time that Xojo has with a significantly larger user base and as such, substantially more sample code to pull from.

Im not saying impossible… just less likely that you’ll get perfect working code. The sample you provided has an extra illegal line for example

End Declare

there was a “declare” at the beginning of the quote that I did remove, and not the one at the end …
AI answers will never (at least not in 10 or 20 years from now) be perfect.
it is only to have a starting point when you have no idea how to program something.