HunterBeast on Nostr: Our code contains few comments, and recently that left room for ambiguity which was ...
Our code contains few comments, and recently that left room for ambiguity which was caught in code review. I added an assertion and error condition to catch the ambiguity, but I realized; if I had written a comment, would I have ever come to write the code to handle this error condition?
Lesson:
Don't comment your code, just write more code. There are lies, damn lies, and then there's documentation.
Published at
2023-07-20 02:16:43Event JSON
{
"id": "d7324e664bae43a30cb99abd90264648119a6729f7df8cf6222dea32a4fe26a0",
"pubkey": "000000000332c7831d9c5a99f183afc2813a6f69a16edda7f6fc0ed8110566e6",
"created_at": 1689812203,
"kind": 1,
"tags": [],
"content": "Our code contains few comments, and recently that left room for ambiguity which was caught in code review. I added an assertion and error condition to catch the ambiguity, but I realized; if I had written a comment, would I have ever come to write the code to handle this error condition?\n\nLesson:\n\nDon't comment your code, just write more code. There are lies, damn lies, and then there's documentation.",
"sig": "0820e755b63637fc28f34c3d14f9c619d75f651757000f8cc1a6ac7024859740cb356b73dd604e19e0305107bc09317c35dddf15bf6dc5816a675b04bf857370"
}