DEV Community

Aatmaj
Aatmaj

Posted on • Edited on

5 1

Best coding practices.

Best coding practices.

  • Always name your variables and functions with the utmost care and explain them thoroughly.
  • Keep documentation concise but descriptive.
  • The reading time for programs is much more than the writing time. Hence, the code must be such that the reading is easier to do. A little more time spent in making the code lucid goes a long way in saving time later.
  • Each function must do only one task but do it well.
  • Treat each function as a BlackBox- each function must hide something.
  • Keep the connections simple. Avoid global variables wherever possible.
  • If you use global variables, document them thoroughly. Not doing so will cause side effects.
  • The quality of the test data is more important than its quantity.
  • Program testing can show the presence of bugs, but never their absence. You cannot ever guarantee 100% correct code.

Adapted from the book Data Structures and Program Design in C

Speedy emails, satisfied customers

Postmark Image

Are delayed transactional emails costing you user satisfaction? Postmark delivers your emails almost instantly, keeping your customers happy and connected.

Sign up

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay