Update from obsidian - thinkpad

Affected files:
.obsidian/plugins/dataview/data.json
.obsidian/plugins/obsidian-omnivore/data.json
Read Later/2023-10-14 - Using CSS custom properties like this is a waste - YouTube.md
Read Later/2023-10-14 - You Don’t Actually Want Open World Games - YouTube.md
Read Later/2023-10-15 - Highlighting fold text, community fork of null-ls, leetcode integration, reduce ram ....md
Read Later/2023-10-18 - The Unreasonable Effectiveness Of Plain Text.md
Read Later/2023-10-21 - How Game Reviews Actually Affect You.md
Read Later/2023-10-23 - Study shows stronger brain activity after writing on paper than on tablet or smartph....md
Read Later/2023-10-23 - Train Your Brain to Be More Creative.md
Read Later/2023-10-25 - Let's Get Webby! 🦀 🕸️.md
Read Later/2023-10-25 - What the Rust Book didn't tell you about testing....md
Read Later/2023-10-31 - Use cases for Rust.md
Read Later/2023-11-01 - Why Signals Are Better Than React Hooks.md
Read Later/2023-11-02 - The First Rule of Comments in Code.md
Read Later/2023-11-02 - Web Accessibility Tips for Developers – A11y Principles Explained.md
Read Later/2023-11-04 - Git Merge vs Rebase vs Squash ¿Qué estrategia debemos elegir-.md
Read Later/2023-11-06 - How to Write Components that Work in Any Framework.md
Read Later/2023-11-07 - How to Avoid Prop Drilling in React.md
Read Later/2023-11-10 - The Complete Guide to Time Blocking.md
Read Later/2023-11-14 - The one thing you need to finish your game.md
Read Later/2023-11-21 - Career Mistakes to Avoid as a Developer.md
Read Later/2023-11-21 - Conventional Commits.md
Read Later/2023-11-21 - How to Write Better Git Commit Messages – A Step-By-Step Guide.md
Read Later/2023-11-21 - The Life-Changing Magic of Tidying Up Your To-Do List.md
Read Later/2023-11-21 - tbaggery - A Note About Git Commit Messages.md
Read Later/2023-12-24 - Historias de usuario - Ejemplos y plantilla - Atlassian.md
Read Later/2023-12-24 - ¿Qué son los puntos de historia en la metodología ágil y cómo se estiman-.md
Read Later/2024-02-15 - React Optimization Techniques to Help You Write More Performant Code.md
Read Later/How to Learn Rust.md
Read Later/The Secret Power of ‘Read It Later’ Apps.md
This commit is contained in:
Alexander Navarro 2024-02-17 16:23:43 -03:00
parent 1e55015bab
commit 7437d8e57c
30 changed files with 2578 additions and 561 deletions

View file

@ -0,0 +1,41 @@
---
id: 24bd8d1e-b118-4930-a86d-3929f2dad34c
title: |
The First Rule of Comments in Code
status: ARCHIVED
tags:
- read-later
date_added: 2023-11-02 23:25:19
url_omnivore: |
https://omnivore.app/me/https-youtu-be-hxsx-3-vbf-qq-si-c-5-qy-m-mg-8-j-yhc-bbq-18b92ffccf6
url_original: |
https://youtu.be/hxsx3vbf-QQ?si=-C5QyMMg8JYhcBBQ
---
# The First Rule of Comments in Code
## Notes
Comments are bad by nature:
- They get outdated pretty quickly, and you don't know if the comments is updated with the code.
- A comments is most probably noise, because it's not gonna provide more information than the code itself.
- Commented code is broken code, because it's probably outdated compared to it's context.
Some rules to evade writing comments:
**Code that needs a comment, needs to be rewritten**. Always try to put the information in the code. if it needs a comment, it's not good enough.
**Move information somewhere else**. this is similar to the previous, move to a variable name, or to a documentation file in the worst case.
**How quickly the information will goes out of date**. It's so simple that a comments goes out of sync with the code, to prevent that transform the comment in code.
**If a comment gives no more information than the code, delete it**.
**"I need to explain the complexity"**. No, you need to fix the complexity. If the complexity is so big, put in the documentation instead. A comment cannot fix complexity, and will require hard work to change that code.
**Don't comment out code, delete it**. Commented code goes quickly out of sync with it's context, is not tested in any way and the effort of updating it is almost the same if not higher that writing it over with better knowledge, so it's better to just delete it. If we need this code back, we can recover it with git.
## Original
[The First Rule of Comments in Code](https://youtu.be/hxsx3vbf-QQ?si=-C5QyMMg8JYhcBBQ)
By [Bran van der Meer](https://www.youtube.com/@branvandermeer)