Hello friends,
I use ChatGPT as an AI coding assistant, and I’ve had very good results with one simple principle:
always define clear coding rules at the very beginning of the conversation.
The key is to write these rules explicitly, as bullet points, and in an imperative form—ideally as a separate block at the top of your prompt.
Example:
Coding rules (must be strictly followed):
- DBF field names: max. 10 characters
- All LOCAL/STATIC variables must be declared at the beginning of a function
- Before APPEND BLANK or SKIP, the correct workarea must be explicitly SELECTed
- Use SET DELETED ON, never SET EXCLUSIVE ON
- No implicit workarea assumptions
don’t hide constraints in prose—state them clearly and technically.
Why this works
A block like this is not treated as a “preference,” but as hard constraints, similar to:
- compiler constraints
- style-linter rules
- fixed project guidelines
If the AI violates them, it’s considered an error—not a stylistic choice.
The result is more consistent code, less cleanup afterward, and solutions that truly match your established coding style.
This approach is especially valuable when working with legacy environments (for example DBF, Harbour/FiveWin), where precision and discipline matter much more than creative freedom.
Best regards,
Otto