SlideShare una empresa de Scribd logo
1 de 15
No
comment?
sitHH | 9 June 2018 | Laurens van Rijn
SAP Inside Track presentation
Index
Today’s topics:
―About me
―Technical Debt
―Clean Code
―The Art of Commenting
―Code Formatting
―ABAP Doc
―Want to know more?
―Q&A
No
comment?
About me
Working as a software engineer:
Uniface (1994-1998), Oracle (1998-2001), JDEdwards (2001-2005),
SAP (2005-∞)
Interested in code quality:
―2005 Anything goes
―2008 Performance matters
―2013 Code Inspector
―2014 ABAP Test Cockpit
―2015 QA set-up responsible
―2018 Clean Code Evangelist… 
No
comment?
Technical Debt
"The problem with quick and dirty is that dirty remains long
after quick has been forgotten."
―Definition: Technical debt is a concept in software development
that reflects the implied cost of additional rework caused by
choosing an easy solution now instead of using a better approach
that would take longer.
―Causes: Lack of documentation, knowledge, collaboration,
insufficient up-front definition, last minute spec changes, future-
coding etc.
―Risks: difficulty to estimate changes, stressed out developers,
(leading to staff turnover), aversion to change.
No
comment?
Clean Code
The principles of clean code:
―Easily accessible to others (straightforward, clear intent, good
abstractions, no surprises, good names)
―Is made for the real world, i.e. has a clear error-handling strategy
―The author clearly cares for the software and other developers
(which implies both readability and maintainability)
―Is minimal (does one thing, has minimal dependencies)
―Is good at what it does
―Uses as little comments as possible, as many comments as
needed. (Comments should tell you why, not what or how. If it
can’t be clarified by reading the code, comments may be needed)
No
comment?
The Art of Commenting (1/5)
Spotted on Twitter… 
―"Documentation is a love letter that you write to your
future self." - Damian Conway
―A love letter, or an apology?
―Template for copy-paste
// Dear future me,
// Please don't hate me for this: but....
// *reasoning*
// It might not seem that way but I love you.
// Sincerely, your past you
No
comment?
The Art of Commenting (2/5)
Good types of comments
―Comments that explain what is happening
―Comments that clarify something that is not legible by regular
humans, something that is clear and legible to you is not
necessarily clear to others
―Comments to temporarily provide a design blueprint while you are
writing the code / To do reminders
―Comments that warn you about consequences
―Comments in English
―Comments for ABAP Doc / abapCI plugin
―Unit tests (alternative comments)
No
comment?
The Art of Commenting (3/5)
Bad types of comments
―Journal comments
―Superfluous comments: They just state what is written below, but
differently
―Obsolete comments:
• Comments form part of your code and should be maintained as
well
• Most pseudo comments
• Commented code that should have been removed
No
comment?
The Art of Commenting (4/5)
Bad types of comments
―Comments that should have been better variable or method
names
―Comments that are necessary because no time was spent to write
clear code (e.g. closing bracket comments)
―Comments created to fulfil Code Inspector requirements AKA fluff
comments
―Global comments in a local place
No
comment?
The Art of Commenting (5/5)
Bad types of comments
―“Funny” or unprofessional comments
No
comment?
Code Formatting
Your code as art?
―"The visual and intellectual enjoyment of well-formatted code is a
pleasure that few non-programmers can appreciate. But
programmers who take pride in their work derive great artistic
satisfaction from polishing the visual structure of their code.“
―Pretty Printer set-up
―Know the difference: “ vs. *
―Blank lines usage
―Grouping & ordering
―Indentation & alignment
―Be a Boy Scout…
No
comment?
ABAP Doc (1/2)
Generates the documentation for your coding
―“! Indicates comments for ABAP Doc
―Part of Eclipse only
―Reduces documentation effort
―Synchronizes with SE24 / SE37 short texts (NW 7.5 or higher)
―Export as HTML pages (NW 7.5 or higher)
―Supported by Code Inspector
No
comment?
ABAP Doc (2/2)
No
comment?
Want to know more?
Literature
―https://www.agilealliance.org/introduction-to-the-technical-debt-concept/
―https://en.wikipedia.org/wiki/Technical_debt
―https://blogs.sap.com/2013/04/29/abap-doc/
―https://www.sebastiansylvan.com/post/the-perils-of-future-coding/
―https://www.dsag.de/sites/default/files/dsag_recommendation_abap_develo
pment.pdf
―https://jason.pureconcepts.net/2015/01/are-you-a-boy-scout/
―Books by Robert C. Martin:
• Clean Code: A Handbook of Agile Software Craftsmanship
• The Clean Coder: A Code of Conduct for Professional Programmers
No
comment?
Say hello
to questions &
answers

Más contenido relacionado

La actualidad más candente

La actualidad más candente (20)

Make a better with clean code
Make a better with clean codeMake a better with clean code
Make a better with clean code
 
DSL development
DSL developmentDSL development
DSL development
 
DSLs: what, why, how
DSLs: what, why, howDSLs: what, why, how
DSLs: what, why, how
 
Implementing DSLs in practice
Implementing DSLs in practiceImplementing DSLs in practice
Implementing DSLs in practice
 
Design patterns for TypeScript and other languages
Design patterns for TypeScript and other languagesDesign patterns for TypeScript and other languages
Design patterns for TypeScript and other languages
 
Zoo of domain-specific languages
Zoo of domain-specific languagesZoo of domain-specific languages
Zoo of domain-specific languages
 
Coding Introductory Lesson Upper Elementary
Coding Introductory Lesson Upper ElementaryCoding Introductory Lesson Upper Elementary
Coding Introductory Lesson Upper Elementary
 
Introduction
IntroductionIntroduction
Introduction
 
Dion computerprogramming
Dion computerprogrammingDion computerprogramming
Dion computerprogramming
 
Lecture 21
Lecture 21Lecture 21
Lecture 21
 
Lecture 25
Lecture 25Lecture 25
Lecture 25
 
Lecture 23 p1
Lecture 23 p1Lecture 23 p1
Lecture 23 p1
 
Build your own Language - Why and How?
Build your own Language - Why and How?Build your own Language - Why and How?
Build your own Language - Why and How?
 
Worst practices for domain-specific modelling
Worst practices for domain-specific modellingWorst practices for domain-specific modelling
Worst practices for domain-specific modelling
 
what is assembly language by faisal shahzad
what is assembly language by faisal shahzadwhat is assembly language by faisal shahzad
what is assembly language by faisal shahzad
 
ICS 2nd Year Book Introduction
ICS 2nd Year Book IntroductionICS 2nd Year Book Introduction
ICS 2nd Year Book Introduction
 
Clean Code and Common Engineering Practices
Clean Code and Common Engineering PracticesClean Code and Common Engineering Practices
Clean Code and Common Engineering Practices
 
Lecture 24
Lecture 24Lecture 24
Lecture 24
 
Logistics
LogisticsLogistics
Logistics
 
Lecture 31
Lecture 31Lecture 31
Lecture 31
 

Similar a sitHH - No comment?

ProgFund_Lecture_1_Introduction_to_Programming.pdf
ProgFund_Lecture_1_Introduction_to_Programming.pdfProgFund_Lecture_1_Introduction_to_Programming.pdf
ProgFund_Lecture_1_Introduction_to_Programming.pdf
lailoesakhan
 

Similar a sitHH - No comment? (20)

Documenting code yapceu2016
Documenting code yapceu2016Documenting code yapceu2016
Documenting code yapceu2016
 
Documenting Code - Patterns and Anti-patterns - NLPW 2016
Documenting Code - Patterns and Anti-patterns - NLPW 2016Documenting Code - Patterns and Anti-patterns - NLPW 2016
Documenting Code - Patterns and Anti-patterns - NLPW 2016
 
Linters for frontend code review
Linters for frontend code reviewLinters for frontend code review
Linters for frontend code review
 
Hidden sides of Code Review (Do-iOS)
Hidden sides of Code Review (Do-iOS)Hidden sides of Code Review (Do-iOS)
Hidden sides of Code Review (Do-iOS)
 
Sudipta_Mukherjee_Resume-Nov_2022.pdf
Sudipta_Mukherjee_Resume-Nov_2022.pdfSudipta_Mukherjee_Resume-Nov_2022.pdf
Sudipta_Mukherjee_Resume-Nov_2022.pdf
 
API Workshop: Deep dive into code samples
API Workshop: Deep dive into code samplesAPI Workshop: Deep dive into code samples
API Workshop: Deep dive into code samples
 
Code quality as a built-in process
Code quality as a built-in processCode quality as a built-in process
Code quality as a built-in process
 
Sudipta_Mukherjee_Resume_APR_2023.pdf
Sudipta_Mukherjee_Resume_APR_2023.pdfSudipta_Mukherjee_Resume_APR_2023.pdf
Sudipta_Mukherjee_Resume_APR_2023.pdf
 
Code Review to the Rescue
Code Review to the RescueCode Review to the Rescue
Code Review to the Rescue
 
TDD - Cultivating a Beginner's Mind
TDD -  Cultivating a Beginner's MindTDD -  Cultivating a Beginner's Mind
TDD - Cultivating a Beginner's Mind
 
Comment soup with a pinch of types, served in a leaky bowl
Comment soup with a pinch of types, served in a leaky bowlComment soup with a pinch of types, served in a leaky bowl
Comment soup with a pinch of types, served in a leaky bowl
 
The Role of the Architect
The Role of the ArchitectThe Role of the Architect
The Role of the Architect
 
Comment soup with a pinch of types
Comment soup with a pinch of typesComment soup with a pinch of types
Comment soup with a pinch of types
 
INTERFACE by apidays 2023 - Mapping the No-Code/Low-Code Ecosystem with Your ...
INTERFACE by apidays 2023 - Mapping the No-Code/Low-Code Ecosystem with Your ...INTERFACE by apidays 2023 - Mapping the No-Code/Low-Code Ecosystem with Your ...
INTERFACE by apidays 2023 - Mapping the No-Code/Low-Code Ecosystem with Your ...
 
C# Fundamental
C# FundamentalC# Fundamental
C# Fundamental
 
New voice, new tone, new IA: Writing for the modern developer
New voice, new tone, new IA: Writing for the modern developerNew voice, new tone, new IA: Writing for the modern developer
New voice, new tone, new IA: Writing for the modern developer
 
Introducing systems analysis, design & development Concepts
Introducing systems analysis, design & development ConceptsIntroducing systems analysis, design & development Concepts
Introducing systems analysis, design & development Concepts
 
APIs and SDKs: Breaking Into and Succeeding in a Specialty Market
APIs and SDKs: Breaking Into and Succeeding in a Specialty MarketAPIs and SDKs: Breaking Into and Succeeding in a Specialty Market
APIs and SDKs: Breaking Into and Succeeding in a Specialty Market
 
Way #5 Don’t end up in a ditch because you weren’t aware of roadblocks in you...
Way #5 Don’t end up in a ditch because you weren’t aware of roadblocks in you...Way #5 Don’t end up in a ditch because you weren’t aware of roadblocks in you...
Way #5 Don’t end up in a ditch because you weren’t aware of roadblocks in you...
 
ProgFund_Lecture_1_Introduction_to_Programming.pdf
ProgFund_Lecture_1_Introduction_to_Programming.pdfProgFund_Lecture_1_Introduction_to_Programming.pdf
ProgFund_Lecture_1_Introduction_to_Programming.pdf
 

Último

%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
masabamasaba
 
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Medical / Health Care (+971588192166) Mifepristone and Misoprostol tablets 200mg
 
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
chiefasafspells
 
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
masabamasaba
 

Último (20)

Artyushina_Guest lecture_YorkU CS May 2024.pptx
Artyushina_Guest lecture_YorkU CS May 2024.pptxArtyushina_Guest lecture_YorkU CS May 2024.pptx
Artyushina_Guest lecture_YorkU CS May 2024.pptx
 
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
 
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital TransformationWSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
 
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
 
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park %in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
 
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
 
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
 
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learn
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation Template
 
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
 
WSO2Con204 - Hard Rock Presentation - Keynote
WSO2Con204 - Hard Rock Presentation - KeynoteWSO2Con204 - Hard Rock Presentation - Keynote
WSO2Con204 - Hard Rock Presentation - Keynote
 
WSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With SimplicityWSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
 
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
 
WSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go PlatformlessWSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go Platformless
 
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
 
WSO2CON 2024 - How to Run a Security Program
WSO2CON 2024 - How to Run a Security ProgramWSO2CON 2024 - How to Run a Security Program
WSO2CON 2024 - How to Run a Security Program
 
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
 

sitHH - No comment?

  • 1. No comment? sitHH | 9 June 2018 | Laurens van Rijn SAP Inside Track presentation
  • 2. Index Today’s topics: ―About me ―Technical Debt ―Clean Code ―The Art of Commenting ―Code Formatting ―ABAP Doc ―Want to know more? ―Q&A No comment?
  • 3. About me Working as a software engineer: Uniface (1994-1998), Oracle (1998-2001), JDEdwards (2001-2005), SAP (2005-∞) Interested in code quality: ―2005 Anything goes ―2008 Performance matters ―2013 Code Inspector ―2014 ABAP Test Cockpit ―2015 QA set-up responsible ―2018 Clean Code Evangelist…  No comment?
  • 4. Technical Debt "The problem with quick and dirty is that dirty remains long after quick has been forgotten." ―Definition: Technical debt is a concept in software development that reflects the implied cost of additional rework caused by choosing an easy solution now instead of using a better approach that would take longer. ―Causes: Lack of documentation, knowledge, collaboration, insufficient up-front definition, last minute spec changes, future- coding etc. ―Risks: difficulty to estimate changes, stressed out developers, (leading to staff turnover), aversion to change. No comment?
  • 5. Clean Code The principles of clean code: ―Easily accessible to others (straightforward, clear intent, good abstractions, no surprises, good names) ―Is made for the real world, i.e. has a clear error-handling strategy ―The author clearly cares for the software and other developers (which implies both readability and maintainability) ―Is minimal (does one thing, has minimal dependencies) ―Is good at what it does ―Uses as little comments as possible, as many comments as needed. (Comments should tell you why, not what or how. If it can’t be clarified by reading the code, comments may be needed) No comment?
  • 6. The Art of Commenting (1/5) Spotted on Twitter…  ―"Documentation is a love letter that you write to your future self." - Damian Conway ―A love letter, or an apology? ―Template for copy-paste // Dear future me, // Please don't hate me for this: but.... // *reasoning* // It might not seem that way but I love you. // Sincerely, your past you No comment?
  • 7. The Art of Commenting (2/5) Good types of comments ―Comments that explain what is happening ―Comments that clarify something that is not legible by regular humans, something that is clear and legible to you is not necessarily clear to others ―Comments to temporarily provide a design blueprint while you are writing the code / To do reminders ―Comments that warn you about consequences ―Comments in English ―Comments for ABAP Doc / abapCI plugin ―Unit tests (alternative comments) No comment?
  • 8. The Art of Commenting (3/5) Bad types of comments ―Journal comments ―Superfluous comments: They just state what is written below, but differently ―Obsolete comments: • Comments form part of your code and should be maintained as well • Most pseudo comments • Commented code that should have been removed No comment?
  • 9. The Art of Commenting (4/5) Bad types of comments ―Comments that should have been better variable or method names ―Comments that are necessary because no time was spent to write clear code (e.g. closing bracket comments) ―Comments created to fulfil Code Inspector requirements AKA fluff comments ―Global comments in a local place No comment?
  • 10. The Art of Commenting (5/5) Bad types of comments ―“Funny” or unprofessional comments No comment?
  • 11. Code Formatting Your code as art? ―"The visual and intellectual enjoyment of well-formatted code is a pleasure that few non-programmers can appreciate. But programmers who take pride in their work derive great artistic satisfaction from polishing the visual structure of their code.“ ―Pretty Printer set-up ―Know the difference: “ vs. * ―Blank lines usage ―Grouping & ordering ―Indentation & alignment ―Be a Boy Scout… No comment?
  • 12. ABAP Doc (1/2) Generates the documentation for your coding ―“! Indicates comments for ABAP Doc ―Part of Eclipse only ―Reduces documentation effort ―Synchronizes with SE24 / SE37 short texts (NW 7.5 or higher) ―Export as HTML pages (NW 7.5 or higher) ―Supported by Code Inspector No comment?
  • 14. Want to know more? Literature ―https://www.agilealliance.org/introduction-to-the-technical-debt-concept/ ―https://en.wikipedia.org/wiki/Technical_debt ―https://blogs.sap.com/2013/04/29/abap-doc/ ―https://www.sebastiansylvan.com/post/the-perils-of-future-coding/ ―https://www.dsag.de/sites/default/files/dsag_recommendation_abap_develo pment.pdf ―https://jason.pureconcepts.net/2015/01/are-you-a-boy-scout/ ―Books by Robert C. Martin: • Clean Code: A Handbook of Agile Software Craftsmanship • The Clean Coder: A Code of Conduct for Professional Programmers No comment?

Notas del editor

  1. This is one of the great discussions among developers: document or not document your code? Is it worth writing documentation in your code? I thought this topic was completely overcome and it was clear that, except some few occasions (implementing a public API), documentation was not necessary. Until I saw a code review where the reviewer pointed out the lack of documentation as an issue. Really? I was one of those who used to document my code… or at least I tried. I was so convinced that code had to be documented. As a backup or reminder for my future myself or any other developer lucky enough to end up in my code. Although I always realized it was always out of date. And by then, I already wondered: what is the purpose of documenting the code if the documentation is always outdated? Until several years ago I read the book Clean Code. I saw it "crystal clear", there is no need to document your code if you code your documentation. With this I mean to use meaningful variable and method names. If the name of the member already tells you the information that it is keeping and the name of the method tells you what the method is doing you can end up reading the code without the need to figure out or document what your code is doing. Extract as much code as you can to methods. Even if you end up having a method with only 3 or 4 lines. Each method should do one thing and only one thing. And the name must explain what it does. Each member of a class must have a name that only reading it you know which information you can find there. Same for variables and input parameters. Following this simple steps you can have a code you can read, having the documentation right in the same code. Yes, I know, there are those times you have to implement code with a complex algorithm or you are copying a code you found on Internet which might be complex, you might not understand and you might not extract in simple and meaningful methods. Yes, there are always exceptions. What do you think? Do you document or write the documentation in your code? “Comments are not necessary, code should be self-documenting.” “Use as little comments as possible, as many comments as needed.” “Don’t document your code, code your documentation” “Code is like humour. When you have to explain it, it’s bad.” “Write code that minimizes the time it would take someone else to understand it - even if that someone else is you.”
  2. English should be used for the comments. 1) Today, development work is most often done in international teams and even if you currently do all your development in another language, there is always the likelihood that your project will become more global in nature over time. The later effort will then run into coordination issues, or have to re-engineer translations, and this will be more difficult than the possibly somewhat larger initial effort of writing the docu- mentation in English. 2) It has also been shown, that the readability of the code and comments is improved if the comments are in English. The reason for this is that the ABAP statements are also English-like and have a structure similar to sentences. Anybody reading the English documentation in the code then does not have to keep switching back and forth between different languages. abapCI is an additional free plugin for ABAP in Eclipse which supports you with Continuous Integration features. Unit tests also indicate what the code does and so acts like a form of documentation to help you understand the code. + Legal comments Todo comments Informative comments Explanation of intent Clarification Warning of consequences Amplification ABAP Doc
  3. You really should document your code. “Retrieve material info” for SELECT * FROM mara. Your comments should always be up-to-date. The character string "#EC after a statement or a part of a statement, which is followed by an ID with the prefix "CI_", defines a pseudo comment for Code Inspector. These pseudo comments can be used to hide certain warnings from Code Inspector for the statement in question. The possible IDs are documented in Code Inspector or in the output of its messages. Alternatively, tweak your Code Inspector settings. Report ABAP_SLIN_PRAGMAS will tell you the relevant Pragma Code for each Pseudo Comment. Code Inspector can spot lines of commented code but may not be able to discern English text from code… - Mumbling Redundant Misleading Mandated Journal Noise, restate the obvious Scary noise / copypasta error comments Don’t use a comment when you can use a variable or function Position markers Closing brace comments Attributions and bylines Commented out code HTML comments Non local info Too much lines of info Function header, can replace comments
  4. Mandatory method signatures or generated code blocks don’t always allow this. It also touches on the discussion whether a Hungarian naming convention should be used. … As you can see you can have a lack or a surplus of comments… Most of us have had the experience of working on spaghetti code. Many of us have produced some spaghetti code ourselves. It’s easy to write code that we understand, because at the time we write it we’re deep in an understanding of the problem we’re trying to solve. Other maintainers of the code aren’t going to have so deep an understanding.
  5. Choose clarity over entertainment value. A Star Trek reference is not a major problem, the other two are definitely not professional. Please note that “Fuck” will give you the same results as “Fuck you sap” (separate words).
  6. “Try and leave this world a little better than you found it, and when your turn comes to die, you can die happy in feeling that at any rate, you have not wasted your time but have done your best.” - Robert Baden-Powell, founder of the Boy Scouts. When applied to ABAP development, this means, eliminating dead code (unused variables, unreachable code), removing comments, and standardizing format. No changes, the functionality does not change. * = Full-line comments / “ = Inline comments (Pretty Printer says )
  7. Checking ABAP Comments for Completeness via Code Inspector The ABAP comments are checked for completeness. In other words, the system checks if there is a comment for all the entities activated via the parameters. Nog uitschrijven… https://blogs.sap.com/2013/04/29/abap-doc/ https://blogs.sap.com/2015/10/21/new-abap-doc-features-with-netweaver-75/