Read our blogs, tips and tutorials
Try our exercises or test your skills
Watch our tutorial videos or shorts
Take a self-paced course
Read our recent newsletters
License our courseware
Book expert consultancy
Buy our publications
Get help in using our site
547 attributed reviews in the last 3 years
Refreshingly small course sizes
Outstandingly good courseware
Whizzy online classrooms
Wise Owl trainers 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
Search our website
We also send out useful tips in a monthly email newsletter ...
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).
|
In this blog
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.
Some other pages relevant to the above blogs include:
Kingsmoor House
Railway Street
GLOSSOP
SK13 2AA
Landmark Offices
99 Bishopsgate
LONDON
EC2M 3XD
Holiday Inn
25 Aytoun Street
MANCHESTER
M1 3AE
© Wise Owl Business Solutions Ltd 2024. All Rights Reserved.