My 10 “Clean” Code Principles (Start These Now)
My 10 “Clean” Code Principles (Start These Now)
Links to other pages
Home
24
Recent
Vikis
Creators
Search
Discover other moments and creators
1. Eliminate if/else branching; early termination
2. Ambiguous definitions: ‘is’ function prefix to denote boolean return
3. Self documenting code: avoid belaboured comments
4. Consistent formatting. Use Eslint + Prettier to automate code style
5. DRY business logic. Look for opportunities to refactor. Make sure to test!
6. Fail or exit functions fast. Related to 1.
7. Avoid magic values - declare and use CONSTANTS instead.
8. Avoid violating single responsibility. Prefer to use pure functions (no side effects)
9. Overly clever code (code golf). Leads to impenetrable single liners (have to rewrite in order to debug)
10. Premature optimisations.
1. Eliminate if/else branching, use early termination
2. Ambiguous definitions: “is” function prefix clearly returns booleans
3. Self-documenting code, avoid belaboured comments
4. Consistent formatting, use Eslint + Prettier to automate code style
5. DRY (don't repeat yourself), look for opportunities to refactor, make sure to test
6. Fail or exit functions fast, related to 1 above
7. Avoid magic values, declare and use constants instead
8. Avoid violating single responsibility, use pure functions with no side effects
10. Premature optimisation
Anytime you say "algorithm" replace it with "audience"
Egwene vs Ishamael - Wheel of Time
Heartbeat Payday #2 ❤️
"Do you like to dance?" Aviendha asks
Come on! Hit me! Conan O'Brien punched by Maria Menounos in the abs
The bureaucracy is expanding to meet the needs of the expanding bureaucracy
Everyone shooting at Wonder Woman
Dune: Part 2 - Riding the sandworm
Attack Death
How do you make God laugh?
End of work from home #funny
Elvis actor cast as Harkonnen Feyd-Rautha
Electric desk in action
All Heartbeat features - No fluff
10-year anniversary of Freedom!
And our son?
Step outside the world's tallest building
Great Wall of China - Civ4
Sexy squeeze through a narrow gap
See the color changes
All Heartbeat Photos features - No fluff
Almost monetized on YouTube
"Fools!" said I "You do not know"
Who did you fire? Senator drills Mark Zuckerberg, CEO of Facebook
Drink a spicy margarita, make some bad decisions
Use a lifeline - Call my parents
Graduation day
Dragon flies in