VSCodeではAIサポートとしてClaude,Gemini,GPTの選択ができるようになっている。
比較的簡単なコード生成をClaude、GPT、Geminiのアシストにて実施してみる。
コード生成依頼:『USART to TCP Conversion on Standard C』
コード生成の結果を比較すると構造はそれぞれほぼ同様のコードとなっているが、ClaudeおよびGPTに比較してGeminiのコード生成が最もエラー処理の最適化がされている。コード生成のコメントにも以下のように記載がある。
- Error Handling: Includes comprehensive error checking for open, tcgetattr, tcsetattr, socket, connect, read, and send. Uses perror to print informative error messages to stderr. This is crucial for robust applications.