Learn how to add documentation to VSCode data science projects without cluttering the source code or reducing readability

Programmers using VSCode should add “docstrings” to their projects which generate the documentation for users of the code to read when they hover over it in VSCode or press Shift-Tab in Jupyter notebooks.

Programmers can also use extensions to auto-generate the docstring skeletons to save time, for instance, the excellent Python Docstring Generator which can be obtained here — https://marketplace.visualstudio.com/items?itemName=njpwerner.autodocstring.

However, the Docstrings take up a lot of vertical space and when you have added a few they can tend to make the actual code less readable and harder to understand.

Having experienced this myself I wanted the best of both worlds — to generate useful and descriptive documentation without reducing the readability but when I searched online it appeared that this could not be done — https://github.com/microsoft/vscode/issues/37052

Undaunted I looked for a way to resolve this based on the articles I had read and sure enough, it can be fixed quite easily and you can have your coding cake and eat it at the same time!

#vscode #programming #developer

3 Easy Steps to Folding Docstrings in VSCode
13.25 GEEK