Write and accept only readable code!

Write and accept only readable code!

When writing a program, you need to make sure that it is written correctly so that it works... However, the program must also be written so that it can be read by other team members or by someone who has to change the program "in a year". When a program has a problem or a bug, it is easier to determine the cause of the problem when the program is written clearly and legibly.

In general, we spend more time reading a program than writing it. Writing understandable code makes it easier for anyone to go through and revise the code. The code should be written in such a way that all programmers can understand it.

Well-written source code is in itself the most detailed documentation of a program. Everything the program really does is described here exactly. You then just need to document what each function and module is doing, as the way how they do it can be found in the source code.

It is necessary to write the code so that it can be used and maintained for decades. You never know if that won't really happen in the end.

Repeated use of the code and sharing among developers can greatly increase the productivity of the team. Nobody will include unreadable code in their module. On the contrary, readable and clear code will please everyone, because it saves work and you can learn something from the code.

It is important to write the code legibly right from the start. Don't think that when everything is done, you have the time and desire to rewrite the illegible code more readable.

The person who takes over the program should assess the quality of the source code and complain the illegible code as defect and demand correction. Readable code increases the speed of development and the quality of the created application.

See more on: www.radim-automation.com

To view or add a comment, sign in

More articles by Radim Kalousek

  • Slow graphical user interface

    Finally, it's here. We got the opportunity to create a new HMI visualization - choose technologies, add new features…

  • Buttons reset and start

    Resetting a safety function only confirms that the hazardous condition has been removed. It should never directly cause…

  • Danger! Unexpected machine start

    A machine may be stopped by conditions that have a higher priority than the PLC program controlling machine operation -…

  • Safety stops must have the highest priority

    In the previous article, I introduced different types of machine stops and their intended purpose. This article takes a…

  • Different types of machine stops

    Both the development team and the customer want the same thing: a machine that runs and produces. 😉 However, in the…

  • Buttons: Start, Stop and one more

    In the article When a touch panel isn't enough, I described both the advantages of HMIs (Human-Machine Interfaces)…

    2 Comments
  • Redundant PLC - Yes or No?

    In industrial automation, there are many ways of improving machine availability. One idea that appears quite often is…

  • How long will a failure keep our production down?

    Industrial automation promises higher productivity, better quality, and lower costs. But all of this is only true as…

  • Resilient machine control design

    Modern industrial machines today are equipped with a wide range of advanced systems: extensive HMI panels, connections…

  • When a touch panel isn't enough

    Touchscreen panels have become the standard for controlling devices – not only in consumer electronics but also in…

    2 Comments

Others also viewed

Explore content categories