Skip to main content

Is canvas + ChatGPT a problem or an opportunity: Coding part 1


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

Popular posts from this blog

GenAI Productivity: Ideas to project proposal 1

One of the ways I use Generative AI with students is to take basic ideas for projects, usually a title, and get these tools to greater ideas and start of a project proposal. This is with all the usual caveats  Check the references (if any); It is going to be basic, so extend it. In this example I am going to use Co-pilot but the ChatGPT, etc can be used, employing a few basic prompt engineering basics: personas (who is the target audience?) and Templates (how do I want it to look?) to start this process. Example:  Project ideas for MSc Data Intelligence students (persona)  on a particular topic. The reply will include subheadings and relevant (hopefully) content for  TITLE, INTRODUCTION, PROBLEM STATEMENT. The prompt: " Taking the topic "Leveraging open-source tools to measure and present academics publications automatically from public domain data.". Give five innovative projects for a Master's level student dissertation in Data Intelligence. Each project example wi...

Analysis of Websites using Generative AI - compare poltical websites usability

Image created using DALL-E - love the bad spelling I want to explore using Generative AI to explore and compare websites. So I used using Google Gemini because of it its ability to work easily with websites.I choose UK three political party websites purely to compare like with like. Prompt 1: Analyse the following webpages website 1 https://www.conservatives.com/ , website 2 https://www.libdems.org.uk/  and website 3 https://labour.org.uk/ from a web user's perspective. For each website produce a report containing 2 tables. The first Table list issues with the site; for each issues provide at least three examples and then provide a list of potential solutions. Table 2 strengths of the site with each strength provide at least three examples. Add in any commentary Results It produced two tables per website and provided a summary comparing them at the end. Direct political statements were not produce. Now trying out personas and testing the website the politics side not filtered out ...

Creating a 'cartoon' with GenAI - using Google's Gemini

In a previous post  https://llmapplied.blogspot.com/2024/06/creating-cartoon-with-genai.html I played with using ChatGPT4o to produce a GIF based cartoon. In this post I will look at using Google's Gemini to go someway to do this. there will be differences though as Gemini can not - Produce images but can find them online -Can't combine them into a GIF so that would have to be done outside of this. So the prompt The language is British English. You are an experienced comic book designer and a witty writer. Create a guide to being a Computing student in Higher Education in the UK using a comic book narrative. You will use images you find on the web to do this. This should be educational and entertaining. .  The result A Guide to Computing Student Life Panel 1 Opens in a new window www.dreamstime.com student sitting at a computer, surrounded by books and coffee, looking overwhelmed Student: "So, you've chosen to study computing. Brave soul!" Panel 2 Opens in a ne...