• Tester-AI
    • Artificial Intelligence(A.I)
      • Applications of Artificial Intelligence in Medicine
      • Artificial Intelligence Applications in Industry
      • Artificial Intelligence in Agriculture
      • Application of AI in the field of traffic
      • Application of AI in the domestic sphere
      • Artificial Intelligence in Education
    • Programmers Worldwide
  • 12. Developers mistakes
    • 1. Underestimating the importance of code quality
    • 2. Use of inappropriate data structures
    • 3. Deteriorate the code
    • 4. Commenting on obvious things
    • 5. To think if something works, it's done right
    • 6. Obsession with performance
    • 7. Not picking the right tools
    • 8. Misunderstanding the Relationship between Code and Data
    • 9. The Invention of the Wheel
    • 10. Incorrect attitude towards code inspection (code review)
    • 11. Wrong attitude towards mistakes
    • 12. Do not rest.
  • Benefits of the Tester-AI
  • Economic justification
  • Tokenomics
  • Roadmap
  • Conclusion
Powered by GitBook
On this page
  1. 12. Developers mistakes

1. Underestimating the importance of code quality

If you want to write good code, focus on readability. Code that's incomprehensible and unreadable is like garbage that can't be recycled.

Think of your program as parts communicating through code. Bad code is like bad communication. As John Woods said

"Write your code as if it will be accompanied by an aggressive psychopath who knows where you live."

Even the "little things" matter. Inconsistent capitalization and indentation can be a sign of sloppy programming. It's more important than you might think.

tHIS is
  WAY MORE important
than
         you think

Avoid long strings. Lines longer than 80 characters are hard to read. Use tools like ESLint and Prettier for JavaScript to clean up your code.

Keep track of the number of lines in your functions and files. Divide your code into small, understandable, and testable parts. A function longer than 10 lines is too long.

Avoid double negation. It's very not not not good.

Give your variables meaningful, informative, and unambiguous names. Don't use short, general, or type-based names.

As Phil Carlton said, "There are only two really hard things in computer science: cache invalidation and naming things." Use constants with meaningful names to store primitives. For example, if you need to use the number 12 somewhere, define a constant like this:

const monthsInYear = 12; 

Don't use shortcuts in your code to save time. Face problems head-on and defeat them with the right code.

In most cases, shorter code is better than longer code. But don't sacrifice readability for brevity. Avoid using ternary operators to keep your code to one line. And don't add unnecessary code either. Removing unnecessary code is the best way to improve any program.

As Bill Gates said, "Measuring programming progress by lines of code is like measuring aircraft building progress by weight."

Avoid excessive conditional logic. Often, what you want to write through a conditional can be expressed differently, which can improve the readability of your code. Don't worry about optimization until it's necessary. Avoid assignments and Yoda-style conditions.

Previous12. Developers mistakesNext2. Use of inappropriate data structures

Last updated 2 years ago