Banner

Ultimate way to document and comment code with AI


Thu Sep 05 2024


If you are a developer, you know it well, you can’t just write code and relax. Your company will ask you to write comments and documentation for what you have built. But, to document and comment code is a time-consuming and productivity-killing process.

Do you love to write them? The fact you are reading this, I can bet you don’t. The good news is, you don’t need to spend hours to document your codebase and keeping them updated regularly. Docs are important to those who gonna read it. But considering the time it takes to write and to update it regularly, you, the writer of docs, will lose track soon enough, which eventually becomes a waste of time.

Let me introduce, Supacodes.

Supacodes is a simple tool that can help you obliterate the tiring process to document and comment code. By integrating nicely with Github, Supacodes can automatically generate and update documentation directly from your codebase. It organizes AI generated docs and keeps them up-to-date. The best part? It takes just 5 mins!

How should you write documentation or comments?

Documentation and commenting are essential practices in software development, ensuring code readability, maintainability, and collaboration. While there's no one-size-fits-all approach, certain conventions have emerged to promote clarity and consistency. These conventions include:

  • Clear and concise explanations: Comments should provide a brief but informative description of the code's purpose, without repeating what the code itself already conveys.
  • Consistency: Use a consistent style for commenting, such as using a specific character or symbol to indicate the start and end of a comment.
  • Relevance: Comments should be relevant to the surrounding code and avoid unnecessary or redundant information.
  • Completeness: Ensure that comments cover all essential aspects of the code, including its inputs, outputs, and potential side effects.
  • Regular updates: Keep comments up-to-date as the code evolves to avoid discrepancies and misunderstandings.

In general, your description should help any future reader to work on the codebase without reaching out to you. However, if you have proper code documentation, you can easily reduce the number of comments within your code files.

Why Documentation Sucks?

One of the most significant pain points in code documentation is the time-consuming nature of writing and maintaining comments manually. This can be especially challenging for large or complex projects, where the volume of code and the frequency of changes make it difficult to keep documentation up-to-date. Additionally, ensuring consistency and clarity in comments can be a challenge, particularly when working in teams with different coding styles and levels of experience. Another common pain point is the lack of motivation to document code, especially when developers are under pressure to deliver features quickly. This can lead to poorly documented code that is difficult to understand and maintain, ultimately hindering productivity and collaboration.

Automate Documentation in 5 mins

Supacodes works with Github which means, you already have most of the things ready. It uses AI technology to automate the full process of documentation.

homepage

Let’s begin!

1. Connect Supacodes to Your Github Account

Supacodes integrates seamlessly with Github. Simply visit https://supacodes.com and sign in using your Github account.

Once signed in, you will be taken to the Dashboard. Considering it's your first time, you will be asked to install the Supacodes Github app to allow permissions on your repository.

github setup

Just click on the button and it will take you to the installation window of Github. Set up your permissions and hit Done.

And, you are Done!

2. Select Your Repository

Now it’s time to actually begin the process of documentation. For now, our repositories list is empty. We need to configure one to fill this up.

Click on Add New from top right, or visit https://supacodes.com/connect

new project

It will take you to the connect page.

Copy and Paste your repository URL in the textbox.

Untitled

Then, click Connect.

It will take a few seconds and then you will be taken to the next page.

3. Choose Source

Not all your files need documentation. Supacodes allows you to specifically choose the directories or files you want to be processed.

From the list, select all the directories and files you want to be documented.

connect repo

Don’t worry about files within the directories, they will be automatically processed.

Finally, hit Generate.

Grab a mug of coffee and relax. It will take a few mins to go through all your files and generate documentation for them. Once it has pushed all the docs in your repository, you will be taken to the Dashboard again.

You are all done!

What about regular updates?

Supacodes keeps your documentation in sync with your code. Whenever you push changes to your Github repository, Supacodes automatically updates the existing documentation to reflect the latest codebase.

It all happens automatically so you don’t need to do anything.

If you want to regenerate documentation, you can visit Dashboard and regenerate in two clicks!

How does it help?

Integrating Supacodes can boost your productivity and make your workflow more efficient. This means:

  • Reduced Documentation Burden: Free yourself from the repetitive task of manually writing and updating docs using AI generated documentation.
  • Improved Efficiency: Focus on core development tasks while Supacodes handles the documentation part.
  • Enhanced Collaboration: Better team communication with clear and accessible documentation.
  • Smoother Hire On-boarding: New developers won’t need to go crazy over a huge undocumented codebase like before.

How much time does it save?

The time allocated for documentation can vary from team to team.

Let’s assume you are a team of 5 developers and your team needs to spend 2 hours in total every day for writing and updating docs.

For approximately 230 working days per year, that’s

230 * 2 = 460 hours

460 hours of tedious job saved by Supacodes annually.

and who forgot about the frustration from reading inconsistent docs?

Alternatives of Supacodes

There are few apps that can generate documentation files from your code or docstrings, but none of them will automate the full process to integrate ai code documentation in Github and to keep them up-to-date over time.

Check out possible alternatives to compare Supacodes with other services: https://www.g2.com/products/supacodes/reviews

Conclusion

That’s all folks.

I hope that helped you to get rid of boring docs hassles in your company. Share this with your fellow developers and DevOps engineers to let them crack the code to document and comment with AI!

Ciao!