|
 |
Just some clarifications and (hopefully) helpful notes about AI-generated code.
Without direction, AI will just spit out anything it "thinks" works.
But we all know that SDL is "special".
At least with GPT-5, I can tell it to remember my coding style, and give it
certain rules to follow.
If you see code with lowercase identifiers, then it's probably from before I
puzzled all of that out.
I've tried to have it generate code with capitalized identifiers, and prepending
all of the ID's with the type: S_ for scalar, V_ for vector, Arr_ for array,
etc.
It also sometimes drops * for multiplication and just concatenates two ID's
together - just insert that * and that line of code should work.
It tries to do c++ style "functions", both by writing multi-line code with
#declares or #locals, and also by naming the output value and providing that as
part of the input parameters.
Just change
#macro MacroName (ID1, ID2, ID3)
#end
to
#macro MacroName (ID1, ID2)
ID3
#end
and then in the macro call, change:
MacroName (ID1, ID2, ID3)
to
#declare ID3 = MacroName (ID1, ID2);
- BE
Post a reply to this message
|
 |
|
 |
"Bald Eagle" <cre### [at] netscape net> wrote:
> Just some clarifications and (hopefully) helpful notes about AI-generated code.
>
> Without direction, AI will just spit out anything it "thinks" works.
>
True! It does spits out a lot of stuff, like vomit. And like vomit there are
things there that could be useful, but You don't want to touch it.
> But we all know that SDL is "special".
>
> At least with GPT-5, I can tell it to remember my coding style, and give it
> certain rules to follow.
>
> If you see code with lowercase identifiers, then it's probably from before I
> puzzled all of that out.
>
> I've tried to have it generate code with capitalized identifiers, and prepending
> all of the ID's with the type: S_ for scalar, V_ for vector, Arr_ for array,
> etc.
>
> It also sometimes drops * for multiplication and just concatenates two ID's
> together - just insert that * and that line of code should work.
>
> It tries to do c++ style "functions", both by writing multi-line code with
> #declares or #locals, and also by naming the output value and providing that as
> - BE
It did write a function that was really a macro.
LLMs (large language model) don't really understand anything.
Have fun!
Post a reply to this message
|
 |