Share
Fr. 104.00
Klau Haeuptle, Klaus Haeuptle, Floria Hoffmann, Florian Hoffmann, Rodrigo Jordao, Rodrigo Jordão...
Clean ABAP - A Style Guide for Developers
English · Hardback
Shipping usually within 1 to 2 weeks
Description
ABAP developers, are you looking to clean up your code? Then pick up this official companion to the Clean ABAP GitHub repository. This book is brimming with best practices, straight from the experts, to help you write effective ABAP code. Start by learning when to apply each clean ABAP practice. Then, dive into detailed code examples and explanations for using classes, methods, names, variables, internal tables, and more. From writing code to troubleshooting and testing, this is your complete style guide!
In this book, you'll learn about:
a. Clean ABAP Concepts
What is clean ABAP and why is it important to write clean code? Understand clean ABAP concepts with insight from the experts, including special considerations for legacy code and performance.
b. Best Practices
Walk through the what, why, and how behind clean ABAP best practices. Learn to improve your code, including using classes and interfaces appropriately, handling method design and control flow, designing and running unit tests, and much more.
c. Practical Examples
See clean ABAP practices in action! Improve your understanding of how to write effective code. Use detailed examples for each best practice that demonstrate the difference between clean and messy code.
Highlights include:
1) Classes and interfaces
2) Methods
3) Names
4) Variables and literals
5) Internal tables
6) Control flow
7) Comments
8) Formatting
9) Error handling
10) Unit testing
11) Packages
List of contents
... Preface ... 17
... Who This Book Is For ... 17
... How This Book Is Organized ... 17
... Acknowledgments ... 19
... Conclusion ... 21
1 ... Introduction ... 23
1.1 ... What Is Clean ABAP? ... 23
1.2 ... How to Get Started with Clean ABAP ... 26
1.3 ... How to Handle Legacy Code ... 26
1.4 ... How to Check Code Automatically ... 28
1.5 ... How Does Clean ABAP Relate to Other Guides? ... 29
1.6 ... How to Engage with the Clean ABAP Community ... 30
1.7 ... Summary ... 31
2 ... The ABAP Language ... 33
2.1 ... Mind Legacy Code ... 33
2.2 ... Mind Performance ... 35
2.3 ... Prefer Object Orientation to Procedural Programming ... 37
2.4 ... Favor Functional Language Constructs over Procedural Language Constructs ... 43
2.5 ... Avoid Obsolete Language Elements ... 46
2.6 ... Use Design Patterns Wisely ... 48
2.7 ... Summary ... 50
3 ... Classes and Interfaces ... 51
3.1 ... Object Orientation ... 51
3.2 ... Scope and Visibility ... 76
3.3 ... Constructors ... 83
3.4 ... Summary ... 93
4 ... Methods ... 95
4.1 ... Object-Oriented Programming ... 95
4.2 ... Parameters ... 102
4.3 ... Method Body ... 115
4.4 ... Calling Methods ... 125
4.5 ... Summary ... 130
5 ... Names ... 133
5.1 ... Good Naming ... 133
5.2 ... ABAP Peculiarities ... 138
5.3 ... Affixes: Prefixes, Suffixes, and Infixes ... 140
5.4 ... Dealing with Legacy Code ... 142
5.5 ... Summary ... 143
6 ... Variables and Literals ... 145
6.1 ... Variables ... 145
6.2 ... Constants ... 152
6.3 ... Strings ... 160
6.4 ... Booleans ... 161
6.5 ... Regular Expressions ... 164
6.6 ... REDUCE ... 166
6.7 ... Summary ... 168
7 ... Internal Tables ... 171
7.1 ... Using the Right Table Category ... 171
7.2 ... Avoiding DEFAULT KEY ... 173
7.3 ... INSERT INTO TABLE and APPEND TO ... 174
7.4 ... Verifying the Existence of a Row ... 176
7.5 ... Retrieving Table Contents ... 177
7.6 ... LOOP AT WHERE and Nested IF ... 179
7.7 ... Identifying Unnecessary Table Reads ... 180
7.8 ... Block Processing of Table Rows and Single Row Operations ... 181
7.9 ... DESCRIBE TABLE and Table Function LINES ... 182
7.10 ... Summary ... 183
8 ... Control Flow ... 185
8.1 ... IFs ... 185
8.2 ... Nesting Depth ... 190
8.3 ... Conditions ... 190
8.4 ... CASE ... 196
8.5 ... Do 1 Times ... 200
8.6 ... Summary ... 203
9 ... Comments ... 205
9.1 ... Express Yourself in Code ... 205
9.2 ... Comment Placement and Usage ... 207
9.3 ... Comments to Avoid ... 208
9.4 ... FIXME, TODO, and XXX Comments ... 211
9.5 ... Special Comments: ABAP Doc, Pragmas, and Pseudo Comments ... 212
9.6 ... Summary ... 214
10 ... Formatting ... 215
10.1 ... Consistency in Coding Style ... 216
10.2 ... Optimizing for Reading ... 216
10.3 ... The Pretty Printer ... 217
10.4 ... Number of Statements Per Line ... 218
10.5 ... Line Length ... 219
10.6 ... Condensing the Code ... 220
10.7 ... Blank Lines ... 220
10.8 ... Alignment of Assignment Statements ... 221
10.9 ... Alignment of Variable Declarations ... 222
10.10 ... Placement of Closing Brackets ... 223
10.11 ... Formatting Method Parameters ... 223
10.12 ... Summary ... 227
11 ... Error Handling ... 229
11.1 ... Messages ... 229
11.2 ... Return Codes ... 232
11.3 ... Exceptions ... 236
11.4 ... Raising and Catching ... 245
11.5 ... Summary ... 252
12 ... Unit Testing ... 253
12.1 ... Test Classes ... 254
12.2 ... Test Methods ... 262
12.3 ... Class under Test ... 266
12.4 ... Naming ... 267
12.5 ... Assertions ... 269
12.6 ... Test Doubles ... 279
12.7 ... Test Seams ... 289
12.8 ... Principles ... 291
12.9 ... Summary ... 294
13 ... Packages ... 297
13.1 ... General Package Concepts ... 297
13.2 ... Package Concepts in ABAP ... 299
13.3 ... Package Design Options ... 304
13.4 ... Package Checks ... 308
13.5 ... Consequences of Poor or No Package Strategy ... 316
13.6 ... Summary ... 316
14 ... How to Implement Clean ABAP ... 319
14.1 ... Common Understanding among Team Members ... 319
14.2 ... Collective Code Ownership ... 320
14.3 ... Clean Code Developer Initiative ... 322
14.4 ... Tackling the Broken Window Effect ... 323
14.5 ... Code Review and Learning ... 326
14.6 ... Clean Code Advisor ... 330
14.7 ... Learning Techniques ... 330
14.8 ... Continuous Learning in Cross-Functional Teams ... 334
14.9 ... Summary ... 337
... The Authors ... 339
... Index ... 341
About the author
Klaus Haeuptle is a developer, trainer, and product owner for engineering topics. During his career at SAP, he has worked as a developer on several products based on various technologies. Additionally, he facilitates communities across SAP with the intention of sharing knowledge and improving practices and tools. He has influenced testing improvements for ABAP, SAP HANA, and SAPUI5. Together with Florian Hoffmann, he wrote an internal Clean ABAP guide, which was later published externally as an open-source project and serves as the foundation for this book.
Product details
Authors | Klau Haeuptle, Klaus Haeuptle, Floria Hoffmann, Florian Hoffmann, Rodrigo Jordao, Rodrigo Jordão, Michel Martin, Anagha Ravinarayan, Kai Westerholz |
Publisher | Rheinwerk Verlag |
Languages | English |
Product format | Hardback |
Released | 01.01.2021 |
EAN | 9781493220267 |
ISBN | 978-1-4932-2026-7 |
No. of pages | 351 |
Dimensions | 184 mm x 25 mm x 264 mm |
Weight | 878 g |
Series |
SAP Press SAP PRESS Englisch |
Subjects |
Natural sciences, medicine, IT, technology
> IT, data processing
> Programming languages
Informatik, ABAP Objects, ABAP/4, SAP ABAP, Internal tables, Save 15% with code APR15, Formatting, Variables and literals, Names, Comments, Control flow |
Customer reviews
No reviews have been written for this item yet. Write the first review and be helpful to other users when they decide on a purchase.
Write a review
Thumbs up or thumbs down? Write your own review.