Content:
1. Make Architecture (Algorithm)
I Saw Many People Start Writing Code Without any Architecture. And 99% of them got Problems because of such thinking.
Writing code without thinking of its architecture is useless in the same way as dreaming about your desires without a plan of achieving them.
Before Writing the code, you should understand what it will be doing, how, what it will use, how modules and services will work with each other, what structure will it have, how it will be tested and debugged, and how it will be Updated.
2. Take Notes.
Note in different formats.
i ) Audio
The audio note is a form of meeting discussion recording. or video Recording.
ii) Make a diary.
We will not remind everything that discusses in a meeting. So always make a habit write in a diary.
3. Keep it Simple and Readable.
Always write code that is simple to read and which will be understandable for developers. because time and resources that will be spent on hard readable code will be much higher than what you get from optimization.
If you need to make optimization, then make it like an independent module with DI, with 100% test coverage and which will not be touched for at least one year.
Don’t write complex code. More it is simpler than fewer bugs it may have and less time needed to debug them.
4. Comments.
Some one says: Code never lies sometimes Comments do.
Always write simple and Readable Comments.
5. Be a Duct type Programmer.
i) Make it work
Write Simple and it will work and give Expected Output.
ii) Make it Fast
Once your code works Make it Fast means writing in short terms and doing memory optimization.
iii) Make it Beautiful
The last part of the code is Make Beautiful means writing proper Comments and Always
Follow line spacing.
6. Don’t write code when you are tired or in a bad mood.
When developers are tired they are making 2–5 more bugs and mistakes than when they are full of energy. So working more is very bad practice. That’s why more and more countries thinking about 6 hours of workday, and some of them already have it. Mental work is not the same as working with your biceps.
7. Don’t write all at once make developing iterative.
Before writing code analyze and predict, what your customers/clients really need, then select MVF(Most Valuable Features) that you can develop with good quality in a short term. Use such iterations to deploy quality updates, and not waste time and resources on unreasonable desires and sacrifice with quality.
8. Go out, and get hobbies.
Work differentiation increases mental abilities and gives new fresh ideas. So make pauses and go out in the fresh air, talk with friends, play games, etc.
9. Learn the Processes and tools.
Always Learn New things and showcase your skill on Github, Stackoverflow, medium.com, and many other sites.
10. Learn new things as you get free time.
When people stop learning they start to degrade
I’ll be very grateful if you can share in the comments your ideas and practices about writing good code.
Thank you for reading this blog.
Read My Other Blogs:
How to Prepare for a Job Interview?
Embedded C language Interview Questions.
Automotive Interview Questions