Teaching ChatGPT how to write robust code (it is just another lazy developer)
1 comments
Can you really "teach" it anything though prompts? If you want robust code, you'd have to train it with codebases that exhibit robustness characteristics you're after.
me: write me a regex to check if a CSS color is transparent
ChatGPT: Here is a regex pattern to check if a CSS color value is transparent:
me: You forgot to check for rgba, hsla and all other colors formatting where alpha can be set to 0 (including hash)
ChatGPT: Here is a more comprehensive regex pattern to check if a CSS color value is transparent, including formats such as rgba, hsla, and hash colors with an alpha value of 0:
me: What about the other formats that also accept alpha (like HWB and LAB) plus the named color transparent itself from your first answer?
ChatGPT: Here's a regex pattern that matches all the CSS color values that can be transparent, including rgba, hsla, named color transparent, and the other color formats that can have an alpha value of 0:
me: There are other allowed color formats. You should read the full css specs
ChatGPT: An error occurred. If this issue persists please contact us through our help center at help . openai . com.