564 attributed reviews in the last 3 years
Refreshingly small course sizes
Outstandingly good courseware
Whizzy online classrooms
Wise Owls only (no freelancers)
Almost no cancellations
We have genuine integrity
We invoice after training
Review 30+ years of Wise Owl
View our top 100 clients
Coding in SQL, Python, VBA, JQuery and OfficeScript using AI tools
Part five of an eight-part series of blogs
One of the immediate and obvious ways to use AI tools is to boost your productivity as a programmer. This blog shows how you can use ChatGPT 4 and Google's Bard to write programs in SQL, Python, VBA, JQuery and Office Script (probably the 5 languages Wise Owl use most).
For my C# challenge I thought I'd ask my AI friends to write a useful utility function:
"Write a C# function which takes in a comma-delimited string of numbers and returns a list of integers"
Here's what ChatGPT came up with:
This uses LINQ to parse the input numbers.
ChatGPT has taken the string in its entirety, and is trying to build a list of numbers to return from this. If any of the items in the string turn out not to be parsable as integers, the entire program will return an error.
Here's what Bard came up with:
The Bard version also includes a sample of the function's use.
The Bard version uses a much simpler concept: it just loops over the numbers, adding each valid one to a list (which it then returns).
I think ChatGPT is the narrow winner here: it uses an algorithm which will I suspect run much more quickly, and it's less misleading (if your list contains anomalies, I think you want to know this rather than just skip them). However people fairly new to C# programming will find the Bard version much easier to understand; not least because it includes an example of the function's use.
|Parts of this blog|
25 Aytoun Street