10 Tips for Clean Code
You are responsible for your code.
Not your organization.
Not your manager.
Not your team.
You.19:27 PM - 07 Aug 2021
Comments are often lies waiting to happen. Code should speak for itself when possible.
Ask yourself: βCan I write code that expresses this comment so I can remove this comment?β19:30 PM - 07 Aug 2021
Single responsibility.
Clean code does one thing,
does it well, and does it only.19:34 PM - 07 Aug 2021
Clean code is minimalistic.
Less code is less buggy.
Less code is less onboarding.
Less code is less maintenance.
Less Code = Less Liability.
Clean Code is minimalistic.19:38 PM - 07 Aug 2021
Write code that expresses intent.
Ex: Use verbs to name functions.19:28 PM - 07 Aug 2021
Work in cycles: incremental and iterative.
Nothing is ever done, iteratively make code better.19:35 PM - 07 Aug 2021
Boy Scout rule - leave the code better than you found it.19:31 PM - 07 Aug 2021
Follow Clean Code Studio on Twitter for more!
(Note: Dev.to wouldn't let me put all 10 Clean Code twitter tips in this post. Remaining tips are posted in the comments section!)
Top comments (11)
Linting helps; doesn't solve everything, but helps.
Agreed! Linting your code base keeps everything consistent, although I'd warn against linters that are too strict as they tend to frustrate devs and waste tons of time when the syntax is off and not automatically fixed by the linter.
Definitely. I personally prefer my editor to just lint my code as I save things, when possible.
I like your style @jzombie π₯
I like your post @cleancodestudio π₯π₯π₯
This thread = gold. I'm invested. I refuse to drop the ball. ["Cracks knuckles"]....let's go
....I like your like of my post in reply to my like of your style in response to your like of any code likably auto-linting via an editor that I assume you like @jzombie π₯π₯π₯π₯π₯π₯π₯π₯π₯