Xojo code in Claude 4 vs chatGPT 4.1?

Last week i spent most of the evening trying to track down a bug in my python code without success (we’ve all been there). Out of exasperation I pasted all 16,000 lines into the perplexity prompt box, pointed it to the method where I thought the bug was and pasted the python error log verbatim, thinking there is no way. I told it to trace the execution flow starting from main() and correct the error. In 10 seconds, the bug was fixed. And it provides explanations of what I did wrong and how to improve. So I learn a tremendous amount on how to write better code along the way. Like I said, scary, and these AIs are just getting warmed up…

1 Like

And yet Xojo Inc is ignoring it (so it seems looking at the roadmap). Figures.

1 Like

Can’t seem to find it.
Can you please share a direct link?

1 Like

for news you should use Perplexity, many people use it in tech industry for news, i use it daily, i’m a news junky, you you have sources, now chat gpt copiied sources too, and there is desktop app, you can read in french

i 'm suscribed too, i asked to generate json files from internet searches, did good

you mean more productive ? :wink:
it reminds me of this quote from bill gates, saying he hired lazy people because they found ways to do work in less time :wink:

2 Likes

You do get conversation length limits when you run out of tokens, but it requires a bit more complex project to get there. I currently have about 16.000 lines of code in one project and that would take about 80% of the project knowledge space, the remaining left for prompts and external sources (e.g. links to Xojo and MBS reference)

I’ve found using Claude works best as pair programming, meaning you’ll start by discussing how to structure your projects and what sort of design patterns should be followed. It’s quite good on applying Factories and Interfaces in Xojo project. When the principles are set, then can move on by implementing method by method, supported with config and logging frameworks.

In my current desktop project, I’m aiming to create all the UI controls programmatically following the Material Design as a design system. It’s very good on doing repetitive tasks like implementing error handling on all the HTTP codes and not just the three typical ones.

2 Likes

so you say that until 16000 lines of code there is no problem of conversation length with claude pro ?
that should be enough for me and my 800 lines of arduino code…even if I want to make it 2-3x more
thanks.

It’s not very easy math to convert the lines of code to usage limits… Shouldn’t have much of problems with 800 lines of code though. There’s another cap on the number of messages within a 5 hour time window so that might be met sooner than the token space. The documentation says that Pro plan covers around 45 messages per 5 hours and that it would be 5x more than in free plan. It depends on the length of messages and conversations of course.

the 800 lines of code seems to be the limit for claude free.
if I paste these lines, I have one question at max and it says limit reached…
sometimes even the only question is not answered !

with perplexity pro i’ve never run into any limits and AFAIK there are no tokens to use up (I don’t like this model because i’m so frugal that it would dissuade me from posting queries, which i do extensively from coding to protein misfolding questions to pathology of multiple sclerosis for my research work). I think 800 lines should keep you under any limits for a very long time with pro!

Did you try by attaching the code as file or just pasting the lines?

with claude if you paste a large amount of lines, claude transforms it into an attached file

well well I bought claude pro yesterday… and my code is now 1500+ lines working fine
one nice evening chatting with claude, enhancing the code nicely, no stopped conversation !
I did not expect to see such tools in my living time !

1 Like

Some more fun ..

I asked Claude to optimize a project fully to the bottom (just provided all project files and let it do it magic).
The code it generated was .. well .. more or less unreadable (I would almost say machine code-like unreadable) but the final code worked the same but way faster (both GUI and speed in general). It was even faster than using the aggressive compile option in Xojo.
In the end I did not go with this because as mentioned, it is about unreadable. But if you need high optimized code, it can be an option.

Anyhow, it is incredible what Claude can do to help to lift your skills to unseen heights, for sure!

1 Like

Sure, I’m not pro-AI, but even for those that are, doesn’t this sound a bit troubling?

How is this kind of unreadable AI output (especially it if appears to work) any different than downloading source-code from some random public repo that you later discover may have malware embedded in it?

In other words, can you really trust what you’re getting?

1 Like

You know, as a former machine code coder, I must say that comments exists for this reason.

Note: by default AI generates very readable/understandable/structured code. It was just me asking to optimize it to the fullest, just for fun.

Anyhow, I understand there are developers don’t trust/like AI for coding. I use it a lot and it makes things much better, in less time and in the earn more money in less time spend. Nuff said… :wink:

2 Likes

well I tried something bigger today, an html source to embed in a htmlviewer with claude
around 1500 lines
claude struggle … destroy parts of the code, modify parts I told him not to…
got a blank screen sometimes too…
less fun that the arduino code from yesterday !

As someone paid to fix AI errors, I extreme advise that everybody should not trust AI, even if some code “runs”. Check all the code, you MAY or may not, have some bomb ticking there that may explode on the user face and YOU will need to fix it later in a hurry with no clue about where the bug is.

That said, I’m not against AI, AI is a technology that reached a point of no return. If you read my posts, will see that I advised Xojo to work in a future version able to compile code written using any text editor, and loaded into the Xojo IDE just for rendering, some drag and drop adjustments and other fast editions, code analysis and fixing things as mistypes and etc. AI will only evolve and some day, not today, it will be almost perfect, but won’t be tomorrow too.
I’ve saw a guy producing a code with zero comments, asked the AI to explain what that code did, AI confirmed to know, and the guy asked it to comment that cryptic code, and the AI commented it so the human reviewer would not have a hard time watching a lazy intern like code without comments.