-
Book Overview & Buying
-
Table Of Contents
Supercharged Coding with GenAI
By :
Given the choices of GitHub Copilot, ChatGPT, and OpenAI API, we find that Copilot is the most convenient for writing docstrings. The convenience of pair programming in the integrated environment simply makes it easier to request documentation, rather than copying and pasting code to other places. Copilot chat can usually accurately locate stale comments by itself. One issue we have encountered is that the context of sending code to Copilot is not visible. If you copy code and ask if the comments are current, it may miss some methods that were not included in the context. This can be solved by copying and pasting the code in place to renew the context.
We recommend that the docstrings be created after writing the code for each method, or at least after the code for a method has stabilized, if not after each refactoring. We further suggest checking that the docstring accurately reflects the implementation. At the beginning of the chapter, we discussed that documentation...