SlideShare a Scribd company logo
1 of 15
No
comment?
sitFRA | 10 March 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?
@laurensvanrijn
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
―Comments that warn you about consequences
―Comments in English
―Comments for ABAP Doc
―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

More Related Content

What's hot

Coding Introductory Lesson Upper Elementary
Coding Introductory Lesson Upper ElementaryCoding Introductory Lesson Upper Elementary
Coding Introductory Lesson Upper ElementaryBrittany Pike
 
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?Markus Voelter
 
Clean Code and Common Engineering Practices
Clean Code and Common Engineering PracticesClean Code and Common Engineering Practices
Clean Code and Common Engineering PracticesRuth Sperer
 
Clean code and Coding Standards
Clean code and Coding StandardsClean code and Coding Standards
Clean code and Coding StandardsMahesh Salaria
 
Englishtown lifestyle
Englishtown lifestyleEnglishtown lifestyle
Englishtown lifestyleTony Shao
 
Real World Application of Development
Real World Application of DevelopmentReal World Application of Development
Real World Application of Developmentdjones101
 
Rsqrd AI: ML Tooling at an AI-first Startup
Rsqrd AI: ML Tooling at an AI-first StartupRsqrd AI: ML Tooling at an AI-first Startup
Rsqrd AI: ML Tooling at an AI-first StartupSanjana Chowdhury
 
Udhayan tn archeology talk
Udhayan tn archeology talkUdhayan tn archeology talk
Udhayan tn archeology talkudhayanchn
 
Silverlight Dev Camp DC Keynote
Silverlight Dev Camp DC KeynoteSilverlight Dev Camp DC Keynote
Silverlight Dev Camp DC KeynoteFrank La Vigne
 
Jak aspekty uporządkują twój kod.
Jak aspekty uporządkują twój kod.Jak aspekty uporządkują twój kod.
Jak aspekty uporządkują twój kod.Future Processing
 
PSU Guest Lecture: Database Programming
PSU Guest Lecture: Database ProgrammingPSU Guest Lecture: Database Programming
PSU Guest Lecture: Database Programmingborkweb
 

What's hot (20)

Coding Introductory Lesson Upper Elementary
Coding Introductory Lesson Upper ElementaryCoding Introductory Lesson Upper Elementary
Coding Introductory Lesson Upper Elementary
 
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
 
Lecture 24
Lecture 24Lecture 24
Lecture 24
 
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?
 
Clean Code and Common Engineering Practices
Clean Code and Common Engineering PracticesClean Code and Common Engineering Practices
Clean Code and Common Engineering Practices
 
Lecture 31
Lecture 31Lecture 31
Lecture 31
 
Clean code and Coding Standards
Clean code and Coding StandardsClean code and Coding Standards
Clean code and Coding Standards
 
Logistics
LogisticsLogistics
Logistics
 
Englishtown lifestyle
Englishtown lifestyleEnglishtown lifestyle
Englishtown lifestyle
 
Real World Application of Development
Real World Application of DevelopmentReal World Application of Development
Real World Application of Development
 
Let's go
Let's go Let's go
Let's go
 
Hacking OOo 2.0
Hacking OOo 2.0Hacking OOo 2.0
Hacking OOo 2.0
 
Rsqrd AI: ML Tooling at an AI-first Startup
Rsqrd AI: ML Tooling at an AI-first StartupRsqrd AI: ML Tooling at an AI-first Startup
Rsqrd AI: ML Tooling at an AI-first Startup
 
Udhayan tn archeology talk
Udhayan tn archeology talkUdhayan tn archeology talk
Udhayan tn archeology talk
 
Way to fci
Way to fciWay to fci
Way to fci
 
Silverlight Dev Camp DC Keynote
Silverlight Dev Camp DC KeynoteSilverlight Dev Camp DC Keynote
Silverlight Dev Camp DC Keynote
 
Jak aspekty uporządkują twój kod.
Jak aspekty uporządkują twój kod.Jak aspekty uporządkują twój kod.
Jak aspekty uporządkują twój kod.
 
PSU Guest Lecture: Database Programming
PSU Guest Lecture: Database ProgrammingPSU Guest Lecture: Database Programming
PSU Guest Lecture: Database Programming
 

Similar to SitFRA - No Comment?

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 2016Søren Lund
 
Documenting code yapceu2016
Documenting code yapceu2016Documenting code yapceu2016
Documenting code yapceu2016Søren Lund
 
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)Dmitrii Ivanov
 
Sudipta_Mukherjee_Resume-Nov_2022.pdf
Sudipta_Mukherjee_Resume-Nov_2022.pdfSudipta_Mukherjee_Resume-Nov_2022.pdf
Sudipta_Mukherjee_Resume-Nov_2022.pdfSudipta Mukherjee
 
Code Review to the Rescue
Code Review to the RescueCode Review to the Rescue
Code Review to the RescueAndrei Sviridov
 
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 processElad Maimon
 
Linters for frontend code review
Linters for frontend code reviewLinters for frontend code review
Linters for frontend code reviewVsevolod Nechaev
 
Sudipta_Mukherjee_Resume_APR_2023.pdf
Sudipta_Mukherjee_Resume_APR_2023.pdfSudipta_Mukherjee_Resume_APR_2023.pdf
Sudipta_Mukherjee_Resume_APR_2023.pdfsudipto801
 
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 samplesTom Johnson
 
TDD - Cultivating a Beginner's Mind
TDD -  Cultivating a Beginner's MindTDD -  Cultivating a Beginner's Mind
TDD - Cultivating a Beginner's MindShai Yallin
 
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 bowlPharo
 
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 typesPooja Rani
 
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...panagenda
 
“One man” development process model
“One man” development process model“One man” development process model
“One man” development process modelSilicon Straits
 
Introducing Pair Programming
Introducing Pair ProgrammingIntroducing Pair Programming
Introducing Pair ProgrammingSteven Smith
 
Markdown - friend or foe?
Markdown - friend or foe?Markdown - friend or foe?
Markdown - friend or foe?Ellis Pratt
 

Similar to SitFRA - No Comment? (20)

sitVIE - No comment?
sitVIE - No comment?sitVIE - No comment?
sitVIE - No comment?
 
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
 
Documenting code yapceu2016
Documenting code yapceu2016Documenting code yapceu2016
Documenting code yapceu2016
 
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
 
Code Review to the Rescue
Code Review to the RescueCode Review to the Rescue
Code Review to the Rescue
 
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
 
Linters for frontend code review
Linters for frontend code reviewLinters for frontend code review
Linters for frontend code review
 
Sudipta_Mukherjee_Resume_APR_2023.pdf
Sudipta_Mukherjee_Resume_APR_2023.pdfSudipta_Mukherjee_Resume_APR_2023.pdf
Sudipta_Mukherjee_Resume_APR_2023.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
 
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
 
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
 
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...
 
The Role of the Architect
The Role of the ArchitectThe Role of the Architect
The Role of the Architect
 
“One man” development process model
“One man” development process model“One man” development process model
“One man” development process model
 
Introducing Pair Programming
Introducing Pair ProgrammingIntroducing Pair Programming
Introducing Pair Programming
 
Blogs
BlogsBlogs
Blogs
 
Markdown - friend or foe?
Markdown - friend or foe?Markdown - friend or foe?
Markdown - friend or foe?
 
Quick Intro to Clean Coding
Quick Intro to Clean CodingQuick Intro to Clean Coding
Quick Intro to Clean Coding
 

Recently uploaded

Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...stazi3110
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxTier1 app
 
Engage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyEngage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyFrank van der Linden
 
XpertSolvers: Your Partner in Building Innovative Software Solutions
XpertSolvers: Your Partner in Building Innovative Software SolutionsXpertSolvers: Your Partner in Building Innovative Software Solutions
XpertSolvers: Your Partner in Building Innovative Software SolutionsMehedi Hasan Shohan
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfjoe51371421
 
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfThe Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfkalichargn70th171
 
What is Binary Language? Computer Number Systems
What is Binary Language?  Computer Number SystemsWhat is Binary Language?  Computer Number Systems
What is Binary Language? Computer Number SystemsJheuzeDellosa
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsAlberto González Trastoy
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantAxelRicardoTrocheRiq
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWave PLM
 
Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...aditisharan08
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...MyIntelliSource, Inc.
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptkotipi9215
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEOrtus Solutions, Corp
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...kellynguyen01
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxbodapatigopi8531
 
Project Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationProject Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationkaushalgiri8080
 
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝soniya singh
 

Recently uploaded (20)

Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
 
Engage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyEngage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The Ugly
 
XpertSolvers: Your Partner in Building Innovative Software Solutions
XpertSolvers: Your Partner in Building Innovative Software SolutionsXpertSolvers: Your Partner in Building Innovative Software Solutions
XpertSolvers: Your Partner in Building Innovative Software Solutions
 
why an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdfwhy an Opensea Clone Script might be your perfect match.pdf
why an Opensea Clone Script might be your perfect match.pdf
 
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfThe Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
 
What is Binary Language? Computer Number Systems
What is Binary Language?  Computer Number SystemsWhat is Binary Language?  Computer Number Systems
What is Binary Language? Computer Number Systems
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service Consultant
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need It
 
Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.ppt
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 
Project Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationProject Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanation
 
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Naraina Delhi 💯Call Us 🔝8264348440🔝
 
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
 

SitFRA - No Comment?

  • 1. No comment? sitFRA | 10 March 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? @laurensvanrijn
  • 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 ―Comments that warn you about consequences ―Comments in English ―Comments for ABAP Doc ―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?

Editor's Notes

  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. 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/