The Curator’s Code: Navigating the AI Response Labyrinth for Optimal Results

Although we as Curators get an easier task when we develop code or write tasks, there is an even bigger task ahead of us: To validate the result that our AI gives us.

In the extremely simple example below, I will iterate through a list of 10 strings and print them to the console. By asking ChatGPT: “Give example of a loop in Swift code interating 10 strings” 

At first I get this result which is the simple for loop:

let stringsArray = ["Apple", "Banana", "Cherry", "Date", "Fig", "Grape", "Hazelnut", "Iris", "Jasmine", "Kumquat"]
for item in stringsArray {
  print(item)
}
If I ask it repeatedly, it keeps spitting out different results, all valid, but different, as shown here:
2nd query:

for index in 0..<stringsArray.count {
  print(stringsArray[index])
}

3rd inquiry:

for (index, item) in stringsArray.enumerated() {
  print("Element \(index): \(item)")
}

4th inquiry:

stringsArray.forEach { item in
  print(item)
}

5th inquiry:

var index = 0
while index < stringsArray.count {
  print(stringsArray[index])
  index += 1
}

6th inquiry

var index = 0
repeat {
  print(stringsArray[index])
  index += 1
} while index < stringsArray.count

and the 7th inquiry

_ = stringsArray.map { item in
  print(item)
}

So as the Curator, the role of selecting between different results is crucial for multiple reasons. Making the right choice can lead to better understanding, more efficient code, and improved outcomes. Here are some important factors to consider when choosing between different results – of course with more complex results than what I have used as an example above:

  1. Clarity & readability:  Ensure easy understanding for other developers, saving time during maintenance and debugging.
  2.  Performance:  Optimize code efficiency without sacrificing readability.
  3. Idiomatic code: Adhere to best practices and common patterns for easier understanding and maintenance.
  4. Reusability: Select modular, reusable solutions to improve long-term efficiency and reduce duplication.
  5. Adaptability: Choose flexible solutions that can accommodate future changes.
  6. Testability: Ensure easy testing and verification for correctness and maintainability.
  7. Maintainability: Pick solutions that are easy to maintain, update, and refactor for long-term success.

In summary, as a Curator, it is important to consider various factors, including readability, performance, idiomatic style, reusability, adaptability, testability, and maintainability, when choosing between different results. Balancing these aspects can lead to a better overall solution that benefits both developers and end-users. 

What we learned in elementary school about “Source criticism” has become even more important with AI. That we ourselves validate the results given to us based on a solid base of knowledge and education.