Bing AI Chat is an amazing a programming coach. I can give it some code or info plus what I want to do with it and it will write new code for me. Python works really well.

Using Bing Chat

Here are some snippets of a Type Catalog generator tool that I developed for my Revit consulting work:

I worked step-by-step to make all of the parts of the app I wanted to write.

It will even improve its own code — here, I asked it to be more efficient

I can ask it to teach me stuff:

I can even misspell my questions.

Python inside Dynamo

This is a harder because there is not Python debugger per se in Dynamo. Bing also knows less about the subject. But it is certainly a help, combined with the Dynamo Forum.

Later, after going back and forth, looking in the Dynamo forum, and combining the clues…

Bing can help simplify the code:

I still have to convert it a little for Dynamo…

Fixing Its Own Bugs

Sometimes Bing chat writes incorrect code. I told it when something didn’t work and often it corrected itself and gave me better code after some interaction.

2023-03-28 17_33_32-outlook ignores email with just a number in the subject line - Search and 1 more.png
2023-03-28 17_51_45-Dynamo.png
2023-03-28 17_47_16-outlook ignores email with just a number in the subject line - Search and 1 more.png

How does Bing Chat know things?

It seems to combine Web search with its answers. Much better than just Google searching but that method of coding is still valid.

Comparing with Openai Chat

GPT-3 https://chat.openai.com/chat appears similar to Bing for writing code.

It doesn’t seem to combine the Web references in its answers like Bing does.

https://chat.openai.com/chat
Bing

But a query gets that info.

Bing Vs OpenAI Up-to-date-ness

It may not matter much with programming languages that have been around for a long time, but perhaps newer tech will be left-out by OpenAI’s answers. Bing doesn’t have OpenAI’s limitation of only having pre-2021 data. Example:

Bing
OpenAI

Bing may produce better links because of its search engine integration.

Correct and focused URLs
Lame URLs

Using an IDE

MS Code is a good IDE for Python. Code can be debugged; set a stop point and you can see what the variables contain.

Debugging in VS Code

I just copy/paste the code from the AI chat in Edge and it usually works.

I also use a helper called Pylance — good stuff!

Pylance tip

The Python can be run by itself or inside Dynamo for Revit after pasting in into a Python Node (or other methods).

Next step is to try Copilot for MS Code