Coding With Fun
Home Docker Django Node.js Articles Python pip guide FAQ Policy

6 lessons programmers must understand in their programming careers, premature optimization is the root of all evil!


Jun 02, 2021 Article blog



Programmers in the growing process, need to learn from a lot of experience, to avoid less detours. w3cschool shares 6 lessons that help programmers grow:

0, premature optimization is the source of all evil

Optimization early in the project can sometimes make the code difficult to read.

At a later stage, you'll find that the previous optimization was just time-consuming and laborious.

 6 lessons programmers must understand in their programming careers, premature optimization is the root of all evil!1

Because as a programmer, you have to be aware that requirements change.

1. When writing code, always imagine that the guy who maintains your code is a violent psychopath who knows where you live.

Writing code must ensure that the code is worth maintaining in the future.

Because you'll be exposed to so much new code, it's easy to be unfamiliar with the previous code.

2. If error correction is the process of eliminating software bugs, then programming must be the process of putting them in.

There are two truths in the world that need not be questioned:

A. People are bound to die.

b. There must be bugs in the program.

 6 lessons programmers must understand in their programming careers, premature optimization is the root of all evil!2

Therefore, we often need code review in order to discover the presence of BUGs before committing.

Often code reviews are conducted in terms of code style, major flaws, design logic, and design ideas.

3, a good programmer is the kind of person who crosses a one-way street and looks on both sides.

Programmers have to prevent exceptions from occurring, and although problems are unlikely, they are within their control.

Also, make the code more meaningful to read.

 6 lessons programmers must understand in their programming careers, premature optimization is the root of all evil!3

4, any code you write, more than 6 months do not look at it, when you look again, it is like someone else wrote.

The old code is still your gold mine. Because old code has the potential to turn into better products.

Look back at your past programs and projects and update them to better products or ideas.

At the same time, reusing code can improve code reliability and reduce development time.

5. The comment code is much like cleaning your toilet - you don't want to do it, but if you do, it will definitely give you and your guests a more enjoyable experience.

Admittedly, most programmers hate writing comments, but paradoxically, they hate people not writing comments.

When you maintain the long-lost ten years of old code is called headache, no notes no need, directly let you doubt life.

W3cschool Official Public Number focuses on programmer methodology, technology, provides real-time technology news, lets you quickly get started programming the world, welcomes to sweep QR code attention.

 6 lessons programmers must understand in their programming careers, premature optimization is the root of all evil!4