Don't call the world dirty because you forgot to clean your glasses!
👇
WRITE FOR HUMANS:
The code we write will be interpreted by machines. However, it will be read and improved by humans. So, write beautiful, impressive and readable code.
USE MEANINGFUL NAMES:
Meaningful names are descriptive enough that other developers will be able to understand the purpose of the variable, function or object.
ONE TASK AT A FUNCTION:
Let every function (or method) perform just one task. This will make your functions smaller, and increase your focus on implementing that specific feature and the ability to debug that function.
USE COMMENTS WHEN NEEDED:
No matter how hard you try to write readable code, sometimes you should insert some comments into your code to explain the why and make your code more understandable.
CONSISTENCY IS KEY:
Pick a set of coding practices and then stick to those practices in all of your projects. It will be much easier to return to your older code and continue where you left off. Indentation, naming style, file structuring etc.
REVIEW YOUR CODE:
When you write code, if you want to keep it in the best shape you need to update it regularly. You should review it on a regular basis, clean it up and improve it.
In the end, it seems like a bit overwhelming in the start but take one step at a time. Get comfortable with it and take the next one. Use a progressive approach to build the habit of writing cleaner code.
• • •
Missing some Tweet in this thread? You can try to
force a refresh
The will-change property hints the browsers what properties are going to change.
Therefore, helping the browser set up optimizations before an element is actually changed.
This is great for optimizing animations / transitions.
Here's how it's done
Although it seems cool to use will-change as much as you can to optimize the performance of the page.
It's recommended to use on elements that are sure to change like sliders, modals.
Moreover, will-change property should only be used to tackle performance issues not anticipate them.
Optimizations use machine resources to accelerate the rendering process and it can become a lot labor intensive for browser to optimize unnecessary elements.