-
Book Overview & Buying
-
Table Of Contents
Supercharged Coding with GenAI
By :
Large Language Models (LLMs) can supercharge our going-live processes, which refers to deploying code to production. But if prompted incorrectly, they can also degrade code quality. In this chapter, we will examine how, even when following the five S’s to prompt GenAI for logging, monitoring, and input validation, the resulting code can become cluttered, combining these elements with core functionality and violating the single responsibility principle. For instance, models sometimes suggest using print statements instead of proper logging, handling input validation within functions, or incrementing counters without reporting their values. This violates the single responsibility principle and reduces overall code quality.
To address this, we will apply the Chain-of-Thought (CoT) prompt engineering technique to GitHub Copilot to generate well-monitored code without interfering with the function’s core functionality...