OpenAI has just announced canvas (https://openai.com/index/introducing-canvas/ ) with ChatGPT as a beta in ChatGPT Plus. Canvas is an extra interface along with the standard prompt interface which we have got used to. In an earlier post, I started discussing using Canvas for reports, but what about coding? People have been using generative AIs for coding, including code generation from prompts, but what does it do when we use canvas.
So let's play. The new interface for canvas does support coding (as does ChatGPT) - could it be a programmer's friend/assistant?
In the example below ChatGPT was asked via an initial prompt to produce a pseudo-code for the start of a murder-mystery style game, but to also use canvas.
What it produces is a form pseudo-code in the style of Python; not a great surprise there, as ChatGPT is not bad at generating Python code.
So, can it convert the pseudo-code to something other than Python? The two examples below show conversion to C and JavaScript
You can edit in the canvas window, and just as in the report-generating application (see reports ); also, inside the window, you can highlight and get a prompt request. In the javascript version a few lines are highlighted, now let us get canvas to add more locations and characters by using ask ChatGPT that comes up when the text is highighted.
It has added two of each to the code.Converting it to Python, and asking it for features to add to createCharacters()
The suggestions have been shown of the canvas screen and comes with apply button. The figure below shows the addition of the new features.
A feature I like about ChatGPT and coding is getting it to add in extra comments for a persona for example "now add in extra comments to explain the code for a beginner to python"
It feels more like a programmer's assistant than standard ChatGPT.
In part 2 I want to explore its ability to:
- review code
- bug fixing
All opinions in this blog are the Author's and should not in any way be seen as reflecting the views of any organisation the Author has any association with. Twitter @scottturneruon
Comments
Post a Comment