Open-source project: SAP/styleguides – Clean ABAP

A highly valuable resource for the ABAP developer is the clean ABAP guide available on GitHub.com under SAP/styleguides. The guide helps the ABAP developer in writing clean code.

What is clean code?

The bible of the clean coding movement is the book Clean Code: A Handbook of Agile Software Craftsmanship by Robert C. Martin. The opening quote of the book states:

Writing clean code is what you must do in order to call yourself a professional. There is no reasonable excuse for doing anything less than your best.

Robert C. Martin

In the foreword of the book, the following summary of clean code is given:

… Yet attentiveness to detail is an even more critical foundation of professionalism than is any grand vision. First, it is through practice in the small that professionals gain proficiency and trust for practice in the large. Second, the smallest bit of sloppy construction, of the door that does not close tightly or the slightly crooked tile on the floor, or even the messy desk, completely dispels the charm of the larger whole. That is what clean code is about.

James O. Coplien

As you understand from the quotes above, we need to focus on the details in order to write clean, professional code.

Clean ABAP

There are numerous open-source projects and style guides available for writing clean code in different programming languages. The open-source project SAP/styleguides concerns itself with ABAP, the high-level programming language created by the software company SAP.

The Clean ABAP guide gives the developer recommendations on a number of basic topics, such as naming, constants, tables, strings, booleans, and conditions. The guide also digs deeper into more advanced topics, such as OOP best practices, error handling, and testing.

The guide is written in a dense way, without lengthy discussions. It is very much to the point and provides a number of useful examples on patterns and anti-patterns. For quick reference, there are also cheat sheets available.

The project license is CC BY 3.0. For a human-readable summary of the license, see the summary by Creative Commons.

Conclusion

Writing clean code is an essential characteristic of a professional ABAP developer. There are many useful patterns and recommendations presented in the SAP/styleguides project. I think that every ABAP developer should be familiar with the guide and its concepts.

For the developer who has worked for several years with ABAP, I particularly recommend the sub-section Modern ABAP Language Elements which gives a neat summary of newer ABAP syntax.

Start reading about and applying clean code concepts today! I promise that the quality of your code will improve a lot.

Disclosures

I’m an active contributor to SAP/styleguides.

The link to the book Clean Code: A Handbook of Agile Software Craftsmanship is an affiliate link. As an Amazon Associate I earn from qualifying purchases.

Leave a Reply

Your email address will not be published. Required fields are marked *