DEV Community

Discussion on: What makes maintaining documentation difficult?

Collapse
 
buinauskas profile image
Evaldas Buinauskas

Maintaining code and documentation separately makes it painful. Also, I'm just bad at documenting things. 😶

Collapse
 
ben profile image
Ben Halpern

Code can't lie, documentation can. It's sooo easy to get them out of sync.

Collapse
 
buinauskas profile image
Evaldas Buinauskas

Getting out of sync was the perfect term I was looking for. Thanks, Ben!

Collapse
 
pbnj profile image
Peter Benjamin (they/them)

I like how modern languages acknowledge this problem by trying to solve it in the language itself.

Both go & rust address this by encouraging you to add documentation along with your code and include nice tooling to generate documentation from comments in your code.

After adopting Go as my primary back-end language, I found myself applying some of those good habits in other languages I use.

Collapse
 
alainvanhout profile image
Alain Van Hout

Code can't lie

Riiiight :-)

Thread Thread
 
bizzy237 profile image
Yury

code tells exactly what it does. sometimes it's not what you expect, though

Thread Thread
 
alainvanhout profile image
Alain Van Hout • Edited

Only when working solely with primitive operators that cannot be overloaded. Otherwise, code can easily lie. There is no shortage of methods like getFoo(), that only retrieves the latest 5 foo (unless it’s a Tuesday), but also removes the oldest foo, sends some random administrator a loosely related email, and might possible do a perfect frontflip and backflip to wrap things up (though not always, and we’ve yet to figure out why it doesn’t do the backflip before the frontflip).