Viewing a single comment thread. View all comments

Moonside wrote (edited )

"I don't write comments because comments and code drift apart."

"See the unit tests if you really want to figure out how it works."

"I'll document it later now that I got it working and it made it into the API."

"I'll lock down this method's name before writing its documentation."

"Contracts? Code is law."

"We use test driven development here so we don't need dedicated testers."

"The language I use doesn't support checking class invariants well so I just ignore them."

"It was clear enough for Torvalds."

"Commit it now, compile it later."

"I don't write documentation for functions besides types, since types are compiler verified and they are plenty good anyway. Everybody gets these things just like me."

5

twovests OP wrote

tbh I didn't know about 'class invariants' until just now, but Wow these all Hurt to Read

1

Moonside wrote (edited )

If I was an instructor on some software course, I'd make an online assignment to come up with 5 excuses for not writing documentation and share the best answers with the class afterwards.

Class invariants are imo cool and underappreciated part of OOP. It's also my belief, untainted by any real research though, that designing, verifying and testing them would kill lots of bugs.

2