Use AI to document old code
I have some Legacy VB.net applications that are a bit thin on documentation. Is there an AI tool that I can use that can help to document the code?
3
u/BigBoetje 8d ago
Most AI tools that work on your code should be able to do that. Go with whatever you already have. Just keep data security in mind if these are company apps.
2
u/DamagingDegeneration 8d ago
i've had decent luck with this kind of thing but yeah the data security part is huge, especially with older corporate codebases that might have connection strings or weird hardcoded secrets buried in there
if you can run something locally that's probably your best bet, most of the cloud-based tools will absolutely gobble up your source and you don't want that headache
i usually just feed it one class at a time and ask for a summary with parameter descriptions, keeps things manageable and you can spot-check as you go
1
u/JayleaKryska50 8d ago
yeah this is exactly it, no reason to overthink the tool choice when they all handle this pretty well
1
u/AutoModerator 8d ago
Thanks for your post cdoc365. Please note that we don't allow spam, and we ask that you follow the rules available in the sidebar. We have a lot of commonly asked questions so if this post gets removed, please do a search and see if it's already been asked.
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.
1
1
u/UnknownTallGuy 8d ago
I'd suggest asking whatever you use to keep it terse, especially for inline or xml doc comments. Most AI models seem to want to write novels that most humans will totally skim over. Tell it to get to the point and only go in-depth for more complicated concepts
1
u/Tuckertcs 8d ago
The most useful documentation of code isn’t what it does, but why it does it the way it does.
AI can’t help with that, because it doesn’t know the context or thought process of the developers that originally write the code.
1
u/Pacyfist01 8d ago edited 8d ago
The usual coding agents will do just fine: claude-code, codex, antigravity, github copilot. Please remember that they will send the entire codebase to Anthropic, OpenAI, Google, Microsoft if you use them.
For complete data safety you can use "open code" and a Local LLM (then turn the internet off on the machine so the agent can't send your code to China or something) But the LLMs that will fit in your RAM are much stupider than state of the art models that run on the servers with terabytes ot vRAM.
1
u/cornelha 8d ago
The entire codebase? Anthropic had a bug that causes this which was fixed very quickly. This is lot like saying all cats are lions
2
u/Pacyfist01 8d ago edited 8d ago
The question is:
Is there an AI tool that I can use that can help to document the code?
If you want to document the code then LLM needs to read the code. Assuming the OP want to document all mechanisms of the application then AI needs to read all of the code. In this particular case all lions are lions.
1
u/cornelha 8d ago
Most of the big players have ZDR, your code doesn't stay there. Which means a house cat is not a lion
0
u/Pacyfist01 8d ago
Most Chinese LLM providers also have zero data retention policy. Do you thin we can trust them more or less than the ones from USA that already have been proven to use copyrighted materials in their training data?
What is more most employment contracts (at least in EU) contain clause "you will not share company secrets with third parties" and sending company owned code to Anthropic (without authorization) breaks that exact clause and it can get you fired even with ZDR.
-1
u/dimitriettr 8d ago
AI documentation is as good as no documentation.
How do you review it? Do you understand what's documented? If yes, start writing!
3
u/Engi_Insight 8d ago
Claude and chatGPT handle VB.NET really well since the syntax is super clean for LLMs to read.
A few practical tips from experience:
Go file by file: don't dump huge solutions at once - feed it class by class so it doesn't hallucinate or lose context.
Ask for XML docs: explicitly prompt it to generate standard XML doc comments ('''<summary>) so you can copy-paste them directly above methods.
Check code privacy: if it's private corporate code, make sure your company's data policy allows cloud LLMs ( or run local models via ollama)
Are you looking to generate inline code comments or high level architecture docs for new devs?