Don't Write Code
BAD Look at those indents and nesting. This looks like the pyramids. Are you a pharaoh? No. You are not a pharaoh. Pharaohs don't use Twitter. So don't build pyramids const Header = ({ title }) => { if (title) { return <h1 class="header">{title}</h1> } else { return null } } BETTER Use early returns to make your functions return the short values as early as possible, leave the long happy path for the end const Header = ({ title }) => { if (!title) { return null } return <h1 class="header">{title}</h1> } BEST Don't write code. The world has enough apps as it is. It's cool to not do one.
A three-panel programming joke compares bad code with deeply nested conditionals, better code using an early return, and the best solution: writing no code at all. The punchline mocks programmer optimization culture by suggesting that avoiding unnecessary apps is the ultimate improvement, and it works as a reaction to overengineering or excessive coding. EN: A three-panel programming joke compares bad code with deeply nested conditionals, better code using an early return, and the best solution: writing no code at all. The punchline mocks programmer optimization culture by suggesting that avoiding unnecessary apps is the ultimate improvement, and it works as a reaction to overengineering or excessive coding.
code editor window / окно редактора кодаJavaScript code / код JavaScriptconditional statement / условный операторnested indentation / вложенные отступыfunction / функцияheader element / элемент заголовкаpyramid / пирамидаTwitter reference / упоминание Twitteryellow background / жёлтый фонred green yellow window buttons / красная зелёная жёлтая кнопки окнаtext panels / текстовые панели
- @rzeczyzabawne / 752 2022-03-17
- Template
- Good, Better, Best
- Type
- image
- Size
- 752×800 · 50.3 KiB
- Mood
- sarcastic, absurd
- Language
- en
- Added