Obviously the AI hype has been out there but I just didn’t find it all that useful until now. I had played with deobfuscating some decompiled binaries which it was able to do pretty good. However, it seemed like most tasks would lose the plot after a bit of back and forth. It would come up with methods/properties that don’t exist, mis-understand the request and/or just product non-functional code.
Today I had an issue when trying to migrate one of my applications to Wayland, it lost the ability to position the windows correctly and using GDK_BACKEND=x11 caused xwayland to leak memory which intern crashed the gnome shell and kicked it back to the login screen. While I was trying to fix the memory issue, I gave the task to ChatGPT and it suggested gnome window calls extension that uses dbus to get and set the position of windows. I did not have a dbus module and I didn’t want to wrap dbus with a shell, so I asked it to write up some declares.
It made a complete module that aside from it thinking it could use “SizeOf(Ptr)“ worked out of the box. I then gave it the page to the extension and ask it to implement that, it used the module it previously created and it worked how I expected, nice! It didn’t match the rest of my code style (case, naming, etc.) so I gave it some of my code and said match the style. It completely reformatted the coded in my style.
Next I was trying to debug some weird behaviour in the Xojo framework that has to do with threads but in GDB, they are all named the same as the executable. Again, gave it the task and what I wanted it to do. It was able to copy the Thread.DebugIdentifier to the underlying thread name using a declare in the style I had previously requested.
The AI was able to save me hours of going through documentation and days of debugging 30 threads with the same name. I am still on the fence of giving it my whole source code but I will be using it in the future for sure.
In the right hands, with a little experience and solid knowledge of the language used and the goal, these tools are already very powerful. Regardless of what some people think of them today, in the future, AI-assisted coding will be a completely normal process.
Sorry to derail the conversation a bit, but what I’m seeing is this is critically important. I run a service that allows users to develop their own JavaScript-based functionality, and the users who don’t actually know how to code or know the language, use AI and end up with some of the most absolute ******* code I’ve ever seen. Best case scenario, it’s as inefficient as the AI itself. Most of the results don’t work at all.
But when the user understands the basics of programming, but isn’t quite so familiar with JavaScript, their results are much more sane.
I haven’t personally ever wanted to reach for a code assistant, but I have much less disdain for them than seeing a model being used to try to generate all the functionality from scratch.
I totally agree! We asked a junior programmer in our company to do some commenting and formatting of a JavaScript lib we wrote. Next day he said he used A.I. to do it.
It may have looked nice and orderly and ran great he said. We were very sceptical and behold: when we did our unit testing, whole else branches were gone, SQL queries were modified giving wrong results etc.
The current so called A.I. hasn’t a clue what it is spewing out. May be somewhat useful for someone without a programming background who wants to write the millionth ‘keep notes’ app, but it will not touch our codebase again for quite some time…
Apologies for the rant and I’m happy it worked out well for the OP
I recently sent Chatgpt a very long Xojo method that was functional but clearly not optimized and difficult to maintain.
Asked chatgpt to refactor the code, enhance comments and make it easier to maintain.
If I remember correctly, there was only one error in the 7 new functions Chatgpt wrote, but the code was cleaner and 10x easier to maintain.
AI is useful for experienced developers because it helps write code faster. The code isn’t perfect but an experienced developer will know exactly what needs to be fixed.
When it comes to writing code for non developers, it is hit & miss… But a friend of mine (0 experience in development, limited html skills) recently had chatgpt write some python code that did the exact same thing as the app I had just written in Xojo. The code ran faster than my xojo code, was written in only two hours (versus 2 weeks in Xojo by me) and had less errors than my own code.
Chatgpt might not be a good Xojo development tool but it is excellent for Python.
Fully agree, it can produce high quality Python code. My issue is I don’t understand Python so the inference is that I need really solid test cases to ensure operation as specified or revert to fix but that’s a very small price to pay compared to my writing equivalent in non-Python.
You think? There’s a LOT of crappy JS out there. As a single example: FedEx’s online shipping tool was revamped last year with a shiny new UI and, frankly, no new functionality. Classic web redesign story. After a recent update to the update, the page now pegs a single CPU core at 100% for about a minute after loading the initial structure of the page. I have no idea what it is doing.
I kinda think there might be an optimal usage of a language where the userbase is large enough to share ideas and optimize their code but not so large that every yahoo with a homepage is using it to animate the user interface.