@CyberGen I was just working on something today and noticed an efficiency gain I could make in my code. I've included a reduced example of it here.
// Version 1
const knbRand = Content.addKnob("Rand", 0, 0);
function onTimer()
{
local rand = knbRand.getValue();
Console.print(rand);
}
// Version 2
reg rand = 0;
const knbRand = Content.addKnob("Rand", 0, 0);
knbRand.setControlCallback(onknbRandControl);
inline function onknbRandControl(component, value)
{
rand = value;
}
function onTimer()
{
Console.print(rand);
}
Both version do exactly the same thing, and for a user there is no difference.
But for a developer the two options differ in efficiency and maintainability.
If the knob is going to be moved a lot and the timer is not going to run often, then version 1 is likely to be more efficient.
If the timer runs often or quickly and the knob isn't interacted with much, then version 2 is more efficient.
This is just an example so the efficiency difference in the real-world is negligible, it's just to illustrate a point. An LLM could choose either of these options, and in isolation either would be fine. But the larger architecture of the program could make it better to choose one over the other.
LLMs aren't very good at looking at the big picture (yet), this is why complex programs written by AI end up as spaghetti code if not managed well.