Xojo code in Claude 4 vs chatGPT 4.1?

while doing some boring shores, i listened to a podcast saying that all LLM are targeting code generation these days.
it’s iunderstandable since coding hours are expensive

i’ don’t have much time for coding these days, i just tried html/css and sql comparaison beetween chat gpt.4.1 subscrition and claude 4 regular

claude SQL was much better, the html page was nicier too from same prompts

claude have been better at coding i guess

did anyone tried it with xojo code comparaison ?
these days, it’s going freakingly fast ! :slight_smile:

Both tools are producing xojo controls and logic via code, which the IDE cannot import as given.
For example, for a small application I am trying to build, chatGPT gave me this:

' Main window class
  Class MainWindow Inherits WebPage
  ' UI Controls
  Private FormContainer As WebRectangle
  Private Toolbar As WebRectangle
  Private NameButton As WebButton
  Private SaveTemplateButton As WebButton
  Private LoadTemplateButton As WebButton
  Private ViewDataButton As WebButton
  Private ExportButton As WebButton
...etc.
  Sub Constructor()
    Super.Constructor
    
    ' Set window properties
    Self.Title = "Form App1"
    Self.Width = 800
    Self.Height = 600
    
    ' Initialize components
    InitializeStyles()
    InitializeToolbar()
    InitializeFormContainer()
    
    ' Render initial form state
    RenderForm()
  End Sub

..etc.


It told me I would have to add each control via the IDE and stick the code in manually.
To save time I asked chatGPT to convert this code to a xojo_xml_project file which it did, but then the IDE was unable to open it because it is in a much older format.

I was told that xojo was looking into AI adoption, but for now cutting and pasting might be the way to go.

Hate to say it but I blame this on Xojo. If they’d make the documentation available as PDF or another format that the LLMs could injest, we’d be getting a LOT better code help. Perhaps they plan to release an update with AI supported documentation themselves. If so it’s time to hurry while there is still an audience. The days of developers picking through docs in web sites is over. I love using Xojo so I hope we’ll get the AI support we need before folks jump ship to other platforms.

6 Likes

Both are very good. Although the free Claude 4 version seems to prefer API1 code.
I would love to know how the payed version of Claude 4 is dealing with this.

Regarding importing code from Claude:
Just create a new project add the controls you think are needed and then save the project as XML.
Send the Window1 file into Claude and just write what it supposes to do.
It will do the changes/add code, including properties, methodes, classes,…in the Window1 text which you then can copy to the saved project.
Works in most cases.

I find claude better than chatgpt, even the o4 paid I can access
but claude seems very limited, you get stopped after 4-5 iterations in the free version, I don’t know with the pro version I’m afraid it will not get you very far in a conversation with the IA …

I use Claude and pay for Pro - I find it better than GPT for everything I use it for. It’s gotten much better at Xojo over the past year but I don’t use it to write code all that much.

1 Like

Does it uses API2?

Sometimes it uses API3, with convenient features Xojo doesn’t even have yet :smiley:

Yes, I think it uses API2, but I’ve never used it for any controls or windows so I don’t know if it uses the “Desktop”-prefixed stuff - I’ve only used it for algorithms and functions.

5 Likes

I used the claude 4 free recently to code some arduino stuff
I have some 800 lines of arduino code, and claude stops responding after 2-3 questions
I want to add more stuff in this code and claude says the conversation is too long as soon as I ask a question !
but the code it outputs is very nice and pertinent.

That’s why I pay for Pro. To me it’s worth every penny.

1 Like

Agree, Claude 4 writes excellent code for me in Xojo, C or python. I recently asked it to write a parallelized version of a fillPolygon function for the Mac Studio GPU using Apple’s metal shader framework in Xcode, something I would not have clue how to do.
It’s well worth the Pro subscription, and improving all the time (these LLMs used to make up non-existent function calls 6 months ago, now they are bang on most of the time).
Total game changer for me. At times it is scary to see how it reasons its way through a problem.

2 Likes

+1

Also it creates very structural and understandable code . Easy to maintain and expand later.

I have to admit, it does make me a lazy coder. :slightly_smiling_face:

Gemini:

I asked name, address, phone, internet for a multi-location “shop” in a large geographic area. Some does not have phone, etc. and I found these info with a simple google querry with the name of the “shop” and the street address.

It returns me some, and I knew more than that, so tell and it adds some more…

Do not ask things that appears in the last month (or so / except if you’re lucky).

Mixed feelings, but I will continue to use it.

I asked it the “last month of Taylor Swift in the news”, and the lates (gain control on hid-s disco back) was here, so it depends on the peope’s interest… !

Today I wanted to push things a bit. I gave Claude all the project files of an old small Xojo project I made (Scoop!) and asked it to convert to a Xcode swift project.
And behold .. after some tweaks (read: gave Claude feedback on controls that were not correct, and some correction of the GUI). Everything else just worked. I got it compiled in Xcode and it it works just as fine as the original.

BTW I am going to add some new features (proposed by Claude) and will use this new version on the AppStore soon.

This is so amazing! Just love it.

BTW I am planning to convert a Xcode Swift project I wrote and convert it to Xojo (just for fun and see if that works too).

@Julia: The Pro version is highly recommended! The difference between the free and Pro version is huge. If Claude would be a woman .. well .. :heart_eyes:

2 Likes

Interesting, could you share a link to this old app?

You can download the Xojo version of the app on the AppStore (Scoop!)
When the Swift version is available, I will drop a message here.

Note: You still need to know your way in Xcode. Most certainly the Xcode projects files and what they do. But it is fantastic that it can be done.
For very large project I don’t think it is the way to go. Well, unless Claude gets a boost again in what it can achieve. :slight_smile:

what kind of “more conversation” can one hope between the free and pro claude ?

I did not bounced on limits yet (read: stops because there were too many lines). One file had more than 4000 lines and it still did not say it was too long/too many lines.

Most important, it creates better code in general for Xojo (and for all other languages too, I guess).
And 9 out 10 it creates compilable Xojo code (read: no errors).
With the free version it sometimes does create non-Xojo code which you need to tell Claude to correct it.

I think if Xojo Inc considers to add AI implementation, it should definitely look at Claude!

2 Likes

With Pro you get “priority” access in times of high usage, although it may still sometimes revert to more terse replies. You also don’t get conversation length limits AFAIK.

2 Likes

true, but it helps here too: i get quickly lost in the 100s of settings available for an XCode project. I sent it a screenshot of the settings and asked it to guide me on what to set and how. It “read” the screenshot, and guided me to a solution.
BTW I use perplexity.ai which has options for a variety of backends (Gemini, chatGPT, Claude, Grok, etc) so you can choose. I find Claude 4 to be the best code generator but things are chaning fast. and yes, Pro is very different from the free.

3 Likes