SlideShare a Scribd company logo
1 of 19
Download to read offline
PRINCIPLES
OF

GOOD
PROGRAMMING
Presentation By
Angelin
@ardentlearner
DRY

DON’T REPEAT YOURSELF
I will not repeat myself
I will not repeat myself
I will not repeat myself
I will not repeat myself
I will not repeat myself
I will not repeat myself
REPETITION IS THE ROOT OF ALL SOFTWARE EVIL

As soon as you start repeating yourself (e.g. a long expression, a
series of statements, same concept) create a new abstraction.
@ardentlearner

1
ABSTRACT
Each significant piece of functionality in a program should be
implemented in just one place in the source code.
Main Problem

1st layer abstraction

2nd layer abstraction

3rd layer abstraction
@ardentlearner

2
KISS
Always remember to…

KISS
KEEP

IT

SIMPLE

STUPID

Simplicity (and avoiding complexity) should always be a key goal.
Simple code takes less time to write, has fewer bugs and is easier
to modify.

@ardentlearner

3
YAGNI
Avoid Creating a YAGNI
(You aren’t going to need it)

You should try not to add
functionality until you need it.
Pain

“Hey,
we could …”

YAGNI

The simplest
thing that could
possibly work

No Pain
@ardentlearner

4
SIMPLE

IT’S THE
THINGS
THAT MAKE A
Do the simplest thing that could possibly work.
A good question to ask one’s self when programming is,
“What is the simplest thing that could possibly work?”
This helps keep us on the path towards simplicity in the design.
@ardentlearner

5
DON’T MAKE ME THINK

The code should be easily read and understood with a
minimum of effort required.

If code requires too much thinking from an observer to
understand, then it can probably stand to be simplified.
@ardentlearner

6
OPEN / CLOSED
OPEN

MODIFICATION

FOR
EXTENSION
CLOSED

Software entities (classes, modules, functions, etc.) should be
open for extension,
but
closed for modification.
In other words, do not write classes that people can modify.
Write classes that people can extend.
@ardentlearner

7
MAINTAINABLE
Write Code for the Maintainer
Almost any code that is worth
writing is worth maintaining in
the future.

WRITE YOUR

AS IF THE PERSON
MAINTAINING IT
IS A
HOMICIDAL
MANIAC

WHO KNOWS
WHERE YOU LIVE
@ardentlearner

8
LEAST ASTONISHMENT

Code should surprise the reader as little as possible.
This means following standard coding conventions and
the code should do what the comments and name suggest and any
potentially surprising side effects should be avoided as much as
possible.
@ardentlearner

9
SINGLE RESPONSIBILITY

A component of code (e.g. class or function) should perform a
single well defined task.
@ardentlearner

10
MINIMIZE COUPLING

“All modules should be independent as far as possible”
Improves maintainability
@ardentlearner

11
MAXIMIZE COHESION

“Things that belong together should be kept together”
Makes code easier to understand, debug and test.
@ardentlearner

12
THE LAW OF DEMETER
Talk only to your closest friends

THE LAW OF DEMETER
is also known as
Principle of Least Knowledge
@ardentlearner

13
AVOID PREMATURE OPTIMIZATION

Don’t even think about optimization unless your code is working
but slower than you want. Only then should you start thinking
about optimizing and only with the aid of empirical data.
"We should forget about small efficiencies, say about 97% of the time:
Premature Optimization is the root of all evil" - Donald Knuth.
@ardentlearner

14
REUSE CODE

Reusing code
improves code reliability
and
decreases development time.
@ardentlearner

15
SEPARATION OF CONCERNS

Different areas of functionality should be managed by
distinct and minimally overlapping modules of code.
@ardentlearner

16
EMBRACE CHANGE

@ardentlearner

17
HAPPY
PROGRAMMING !

@ardentlearner

More Related Content

What's hot

Fragmentación vertical - MySQL
Fragmentación vertical - MySQLFragmentación vertical - MySQL
Fragmentación vertical - MySQLAngel Vazquez
 
Introduction to SQL Server Security
Introduction to SQL Server SecurityIntroduction to SQL Server Security
Introduction to SQL Server SecurityJason Strate
 
Jp perez correction quizz oracle mairie de paris acma 2007 2008
Jp perez correction quizz oracle mairie de paris acma 2007 2008Jp perez correction quizz oracle mairie de paris acma 2007 2008
Jp perez correction quizz oracle mairie de paris acma 2007 2008MRamo2s
 
Applications Android - cours 12 : Persistance de données SQLite
Applications Android - cours 12 : Persistance de données SQLiteApplications Android - cours 12 : Persistance de données SQLite
Applications Android - cours 12 : Persistance de données SQLiteAhmed-Chawki Chaouche
 
Ebs 12.2 con9021_pdf_9021_0001
Ebs 12.2 con9021_pdf_9021_0001Ebs 12.2 con9021_pdf_9021_0001
Ebs 12.2 con9021_pdf_9021_0001jucaab
 
İleri Seviye T-SQL Programlama - Chapter 14
İleri Seviye T-SQL Programlama - Chapter 14İleri Seviye T-SQL Programlama - Chapter 14
İleri Seviye T-SQL Programlama - Chapter 14Cihan Özhan
 

What's hot (7)

Schnittstelle HR.pdf
Schnittstelle HR.pdfSchnittstelle HR.pdf
Schnittstelle HR.pdf
 
Fragmentación vertical - MySQL
Fragmentación vertical - MySQLFragmentación vertical - MySQL
Fragmentación vertical - MySQL
 
Introduction to SQL Server Security
Introduction to SQL Server SecurityIntroduction to SQL Server Security
Introduction to SQL Server Security
 
Jp perez correction quizz oracle mairie de paris acma 2007 2008
Jp perez correction quizz oracle mairie de paris acma 2007 2008Jp perez correction quizz oracle mairie de paris acma 2007 2008
Jp perez correction quizz oracle mairie de paris acma 2007 2008
 
Applications Android - cours 12 : Persistance de données SQLite
Applications Android - cours 12 : Persistance de données SQLiteApplications Android - cours 12 : Persistance de données SQLite
Applications Android - cours 12 : Persistance de données SQLite
 
Ebs 12.2 con9021_pdf_9021_0001
Ebs 12.2 con9021_pdf_9021_0001Ebs 12.2 con9021_pdf_9021_0001
Ebs 12.2 con9021_pdf_9021_0001
 
İleri Seviye T-SQL Programlama - Chapter 14
İleri Seviye T-SQL Programlama - Chapter 14İleri Seviye T-SQL Programlama - Chapter 14
İleri Seviye T-SQL Programlama - Chapter 14
 

Similar to The principles of good programming

Most valuable software design principles
Most valuable software design principlesMost valuable software design principles
Most valuable software design principlesJeroen Hildering
 
30% faster coder on-boarding when you have a code cookbook
30% faster coder on-boarding when you have a code cookbook30% faster coder on-boarding when you have a code cookbook
30% faster coder on-boarding when you have a code cookbookGabriel Paunescu 🤖
 
Software Development Essential Skills
Software Development Essential SkillsSoftware Development Essential Skills
Software Development Essential SkillsJohn Choi
 
YAGNI Principle and Clean Code
YAGNI Principle and Clean CodeYAGNI Principle and Clean Code
YAGNI Principle and Clean CodeLuan Reffatti
 
How have we developed product without bugs
How have we developed product without bugsHow have we developed product without bugs
How have we developed product without bugsSigma Software
 
Best Practices For Writing Super Readable Code
Best Practices For Writing Super Readable CodeBest Practices For Writing Super Readable Code
Best Practices For Writing Super Readable CodeAnsviaLab
 
7 rules on code readability
7 rules on code readability7 rules on code readability
7 rules on code readabilityPer Lundholm
 
Culture And Aesthetic Revisited
Culture And Aesthetic RevisitedCulture And Aesthetic Revisited
Culture And Aesthetic RevisitedAdam Keys
 
10 tips to save you time and frustration while programming
10 tips to save you time and frustration while programming10 tips to save you time and frustration while programming
10 tips to save you time and frustration while programmingHugo Shi
 
You shouldneverdo
You shouldneverdoYou shouldneverdo
You shouldneverdodaniil3
 
festival ICT 2013: Ruby, the 0.8 language you were looking for
festival ICT 2013: Ruby, the 0.8 language you were looking forfestival ICT 2013: Ruby, the 0.8 language you were looking for
festival ICT 2013: Ruby, the 0.8 language you were looking forfestival ICT 2016
 
Refactoring page objects The Screenplay Pattern
Refactoring page objects   The Screenplay Pattern Refactoring page objects   The Screenplay Pattern
Refactoring page objects The Screenplay Pattern RiverGlide
 
Writing Clean Code
Writing Clean CodeWriting Clean Code
Writing Clean CodeNascenia IT
 

Similar to The principles of good programming (20)

Most valuable software design principles
Most valuable software design principlesMost valuable software design principles
Most valuable software design principles
 
30% faster coder on-boarding when you have a code cookbook
30% faster coder on-boarding when you have a code cookbook30% faster coder on-boarding when you have a code cookbook
30% faster coder on-boarding when you have a code cookbook
 
Software Development Essential Skills
Software Development Essential SkillsSoftware Development Essential Skills
Software Development Essential Skills
 
YAGNI Principle and Clean Code
YAGNI Principle and Clean CodeYAGNI Principle and Clean Code
YAGNI Principle and Clean Code
 
Best pratice
Best praticeBest pratice
Best pratice
 
How have we developed product without bugs
How have we developed product without bugsHow have we developed product without bugs
How have we developed product without bugs
 
Best Practices For Writing Super Readable Code
Best Practices For Writing Super Readable CodeBest Practices For Writing Super Readable Code
Best Practices For Writing Super Readable Code
 
7 rules on code readability
7 rules on code readability7 rules on code readability
7 rules on code readability
 
Culture And Aesthetic Revisited
Culture And Aesthetic RevisitedCulture And Aesthetic Revisited
Culture And Aesthetic Revisited
 
Simple is the best
Simple is the bestSimple is the best
Simple is the best
 
10 tips to save you time and frustration while programming
10 tips to save you time and frustration while programming10 tips to save you time and frustration while programming
10 tips to save you time and frustration while programming
 
You shouldneverdo
You shouldneverdoYou shouldneverdo
You shouldneverdo
 
Java
JavaJava
Java
 
festival ICT 2013: Ruby, the 0.8 language you were looking for
festival ICT 2013: Ruby, the 0.8 language you were looking forfestival ICT 2013: Ruby, the 0.8 language you were looking for
festival ICT 2013: Ruby, the 0.8 language you were looking for
 
Clean Code
Clean CodeClean Code
Clean Code
 
Agile mindset
Agile mindsetAgile mindset
Agile mindset
 
Refactoring page objects The Screenplay Pattern
Refactoring page objects   The Screenplay Pattern Refactoring page objects   The Screenplay Pattern
Refactoring page objects The Screenplay Pattern
 
Good programming
Good programmingGood programming
Good programming
 
Writing Clean Code
Writing Clean CodeWriting Clean Code
Writing Clean Code
 
2.1.8 clean code and debugging
2.1.8 clean code and debugging2.1.8 clean code and debugging
2.1.8 clean code and debugging
 

More from Angelin R

Comparison of Java Web Application Frameworks
Comparison of Java Web Application FrameworksComparison of Java Web Application Frameworks
Comparison of Java Web Application FrameworksAngelin R
 
[DOC] Java - Code Analysis using SonarQube
[DOC] Java - Code Analysis using SonarQube[DOC] Java - Code Analysis using SonarQube
[DOC] Java - Code Analysis using SonarQubeAngelin R
 
Java Source Code Analysis using SonarQube
Java Source Code Analysis using SonarQubeJava Source Code Analysis using SonarQube
Java Source Code Analysis using SonarQubeAngelin R
 
Exception handling & logging in Java - Best Practices (Updated)
Exception handling & logging in Java - Best Practices (Updated)Exception handling & logging in Java - Best Practices (Updated)
Exception handling & logging in Java - Best Practices (Updated)Angelin R
 
A Slice of Me
A Slice of MeA Slice of Me
A Slice of MeAngelin R
 
Team Leader - 30 Essential Traits
Team Leader - 30 Essential TraitsTeam Leader - 30 Essential Traits
Team Leader - 30 Essential TraitsAngelin R
 
Action Script
Action ScriptAction Script
Action ScriptAngelin R
 
Agile SCRUM Methodology
Agile SCRUM MethodologyAgile SCRUM Methodology
Agile SCRUM MethodologyAngelin R
 
Exception handling and logging best practices
Exception handling and logging best practicesException handling and logging best practices
Exception handling and logging best practicesAngelin R
 
Tamil Christian Worship Songs
Tamil Christian Worship SongsTamil Christian Worship Songs
Tamil Christian Worship SongsAngelin R
 
Flex MXML Programming
Flex MXML ProgrammingFlex MXML Programming
Flex MXML ProgrammingAngelin R
 
Introduction to Adobe Flex
Introduction to Adobe FlexIntroduction to Adobe Flex
Introduction to Adobe FlexAngelin R
 
Software Development Life Cycle (SDLC)
Software Development Life Cycle (SDLC)Software Development Life Cycle (SDLC)
Software Development Life Cycle (SDLC)Angelin R
 
Restful Web Services
Restful Web ServicesRestful Web Services
Restful Web ServicesAngelin R
 
Effective Team Work Model
Effective Team Work ModelEffective Team Work Model
Effective Team Work ModelAngelin R
 
Team Building Activities
Team Building ActivitiesTeam Building Activities
Team Building ActivitiesAngelin R
 

More from Angelin R (17)

Comparison of Java Web Application Frameworks
Comparison of Java Web Application FrameworksComparison of Java Web Application Frameworks
Comparison of Java Web Application Frameworks
 
[DOC] Java - Code Analysis using SonarQube
[DOC] Java - Code Analysis using SonarQube[DOC] Java - Code Analysis using SonarQube
[DOC] Java - Code Analysis using SonarQube
 
Java Source Code Analysis using SonarQube
Java Source Code Analysis using SonarQubeJava Source Code Analysis using SonarQube
Java Source Code Analysis using SonarQube
 
Exception handling & logging in Java - Best Practices (Updated)
Exception handling & logging in Java - Best Practices (Updated)Exception handling & logging in Java - Best Practices (Updated)
Exception handling & logging in Java - Best Practices (Updated)
 
A Slice of Me
A Slice of MeA Slice of Me
A Slice of Me
 
Team Leader - 30 Essential Traits
Team Leader - 30 Essential TraitsTeam Leader - 30 Essential Traits
Team Leader - 30 Essential Traits
 
Action Script
Action ScriptAction Script
Action Script
 
Agile SCRUM Methodology
Agile SCRUM MethodologyAgile SCRUM Methodology
Agile SCRUM Methodology
 
Exception handling and logging best practices
Exception handling and logging best practicesException handling and logging best practices
Exception handling and logging best practices
 
Tamil Christian Worship Songs
Tamil Christian Worship SongsTamil Christian Worship Songs
Tamil Christian Worship Songs
 
Flex MXML Programming
Flex MXML ProgrammingFlex MXML Programming
Flex MXML Programming
 
Introduction to Adobe Flex
Introduction to Adobe FlexIntroduction to Adobe Flex
Introduction to Adobe Flex
 
Software Development Life Cycle (SDLC)
Software Development Life Cycle (SDLC)Software Development Life Cycle (SDLC)
Software Development Life Cycle (SDLC)
 
Restful Web Services
Restful Web ServicesRestful Web Services
Restful Web Services
 
Effective Team Work Model
Effective Team Work ModelEffective Team Work Model
Effective Team Work Model
 
Team Building Activities
Team Building ActivitiesTeam Building Activities
Team Building Activities
 
XStream
XStreamXStream
XStream
 

Recently uploaded

Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?XfilesPro
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsSnow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsHyundai Motor Group
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your BudgetHyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your BudgetEnjoy Anytime
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 

Recently uploaded (20)

Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?
 
The transition to renewables in India.pdf
The transition to renewables in India.pdfThe transition to renewables in India.pdf
The transition to renewables in India.pdf
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsSnow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your BudgetHyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 

The principles of good programming

  • 2. DRY DON’T REPEAT YOURSELF I will not repeat myself I will not repeat myself I will not repeat myself I will not repeat myself I will not repeat myself I will not repeat myself REPETITION IS THE ROOT OF ALL SOFTWARE EVIL As soon as you start repeating yourself (e.g. a long expression, a series of statements, same concept) create a new abstraction. @ardentlearner 1
  • 3. ABSTRACT Each significant piece of functionality in a program should be implemented in just one place in the source code. Main Problem 1st layer abstraction 2nd layer abstraction 3rd layer abstraction @ardentlearner 2
  • 4. KISS Always remember to… KISS KEEP IT SIMPLE STUPID Simplicity (and avoiding complexity) should always be a key goal. Simple code takes less time to write, has fewer bugs and is easier to modify. @ardentlearner 3
  • 5. YAGNI Avoid Creating a YAGNI (You aren’t going to need it) You should try not to add functionality until you need it. Pain “Hey, we could …” YAGNI The simplest thing that could possibly work No Pain @ardentlearner 4
  • 6. SIMPLE IT’S THE THINGS THAT MAKE A Do the simplest thing that could possibly work. A good question to ask one’s self when programming is, “What is the simplest thing that could possibly work?” This helps keep us on the path towards simplicity in the design. @ardentlearner 5
  • 7. DON’T MAKE ME THINK The code should be easily read and understood with a minimum of effort required. If code requires too much thinking from an observer to understand, then it can probably stand to be simplified. @ardentlearner 6
  • 8. OPEN / CLOSED OPEN MODIFICATION FOR EXTENSION CLOSED Software entities (classes, modules, functions, etc.) should be open for extension, but closed for modification. In other words, do not write classes that people can modify. Write classes that people can extend. @ardentlearner 7
  • 9. MAINTAINABLE Write Code for the Maintainer Almost any code that is worth writing is worth maintaining in the future. WRITE YOUR AS IF THE PERSON MAINTAINING IT IS A HOMICIDAL MANIAC WHO KNOWS WHERE YOU LIVE @ardentlearner 8
  • 10. LEAST ASTONISHMENT Code should surprise the reader as little as possible. This means following standard coding conventions and the code should do what the comments and name suggest and any potentially surprising side effects should be avoided as much as possible. @ardentlearner 9
  • 11. SINGLE RESPONSIBILITY A component of code (e.g. class or function) should perform a single well defined task. @ardentlearner 10
  • 12. MINIMIZE COUPLING “All modules should be independent as far as possible” Improves maintainability @ardentlearner 11
  • 13. MAXIMIZE COHESION “Things that belong together should be kept together” Makes code easier to understand, debug and test. @ardentlearner 12
  • 14. THE LAW OF DEMETER Talk only to your closest friends THE LAW OF DEMETER is also known as Principle of Least Knowledge @ardentlearner 13
  • 15. AVOID PREMATURE OPTIMIZATION Don’t even think about optimization unless your code is working but slower than you want. Only then should you start thinking about optimizing and only with the aid of empirical data. "We should forget about small efficiencies, say about 97% of the time: Premature Optimization is the root of all evil" - Donald Knuth. @ardentlearner 14
  • 16. REUSE CODE Reusing code improves code reliability and decreases development time. @ardentlearner 15
  • 17. SEPARATION OF CONCERNS Different areas of functionality should be managed by distinct and minimally overlapping modules of code. @ardentlearner 16