DEV Community

Discussion on: How do you document new "coding patterns" for your team?

Collapse
 
tmr232 profile image
Tamir Bahar

Do you link to it from the code as well?

Collapse
 
ben profile image
Ben Halpern

I think we do in some places but not as a rule. Worth considering.

Thread Thread
 
tmr232 profile image
Tamir Bahar

I am somewhat worried about having dead-links in the code later. Documenting in same repo comes to mind, but then it is hard to refer to from other code...

Thread Thread
 
ben profile image
Ben Halpern

With the fear of adding too much complexity, seems like checking for dead links could probably be done via some sort of static analysis.

Thread Thread
 
tmr232 profile image
Tamir Bahar

That works when you modify the code, not when you rename your wiki pages...
I'll probably start documenting in a wiki and link to it. If I find any better ideas, I'll probably write about them on this site.

Thread Thread
 
ben profile image
Ben Halpern

Well I was thinking maybe the analyzer could find the links and try test them for 404s.

Thread Thread
 
tmr232 profile image
Tamir Bahar

But what do you do when you find them, if the link is already dead?

Thread Thread
 
ben profile image
Ben Halpern

Well at that point I feel like it's like a failed test. Somebody has to go deal with it and replace the link or remove it. The analyzer's job was only to flag it. This isn't to say that this marries well with the GitHub Wiki as the destination, but that's how these two things would combine.

Another possibility altogether, could be to have documentation actually hosted within code or something and you could verify presence and possible correction the way you would test code. Given sufficient abstraction, this is not too different from verifying 404s though I think.