SlideShare ist ein Scribd-Unternehmen logo
1 von 11
Sustainability Training What makes good code good?
Who are you…? ,[object Object],[object Object],[object Object]
The Question ,[object Object],[object Object]
 
A popular view ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],What makes good code good, Paul DiLascia, MSDN Magazine, 07/2004, p144  http://msdn.microsoft.com/en-us/magazine/cc163962.aspx
Another view ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Bittermanandy,  What is good code? , 10/09/2010 http://bittermanandy.wordpress.com/2010/09/10/what-is-good-code/
And one from scientists ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],31  “ scientists who do some programming ”  on the Effective scientific programming workshop, 20/06/2011 http://www.software.ac.uk/blog/2011-06-22-what-makes-good-code-good
So which of them do you do?
And what are the blockers?
One for the road XKCD, 844 http://xkcd.com/844/
Another view ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Christopher Diggins, The Properties of Good Code, 27/09/2005, http://www.oreillynet.com/onlamp/blog/2005/09/the_properties_of_good_code.html

Weitere ähnliche Inhalte

Mehr von Software Sustainability Institute

Collaborations Workshop 2012 Introduction to the Software Sustainability Inst...
Collaborations Workshop 2012 Introduction to the Software Sustainability Inst...Collaborations Workshop 2012 Introduction to the Software Sustainability Inst...
Collaborations Workshop 2012 Introduction to the Software Sustainability Inst...Software Sustainability Institute
 
Sustainability Training Workshop - Managing Sustainability into Software
Sustainability Training Workshop - Managing Sustainability into SoftwareSustainability Training Workshop - Managing Sustainability into Software
Sustainability Training Workshop - Managing Sustainability into SoftwareSoftware Sustainability Institute
 
Preserving software workshop - Community engagement workshop
Preserving software workshop - Community engagement workshopPreserving software workshop - Community engagement workshop
Preserving software workshop - Community engagement workshopSoftware Sustainability Institute
 

Mehr von Software Sustainability Institute (16)

How breakouts work
How breakouts workHow breakouts work
How breakouts work
 
Collaborations Workshop 2012 Introduction to the Software Sustainability Inst...
Collaborations Workshop 2012 Introduction to the Software Sustainability Inst...Collaborations Workshop 2012 Introduction to the Software Sustainability Inst...
Collaborations Workshop 2012 Introduction to the Software Sustainability Inst...
 
Digital Social Research
Digital Social ResearchDigital Social Research
Digital Social Research
 
Adopting Open Source Software for Longer-term Reuse
Adopting Open Source Software for Longer-term ReuseAdopting Open Source Software for Longer-term Reuse
Adopting Open Source Software for Longer-term Reuse
 
Digital Economies Southampton
Digital Economies SouthamptonDigital Economies Southampton
Digital Economies Southampton
 
Sustainability Training Workshop - Managing Sustainability into Software
Sustainability Training Workshop - Managing Sustainability into SoftwareSustainability Training Workshop - Managing Sustainability into Software
Sustainability Training Workshop - Managing Sustainability into Software
 
Sustainability Training Workshop - Intro to the SSI
Sustainability Training Workshop - Intro to the SSISustainability Training Workshop - Intro to the SSI
Sustainability Training Workshop - Intro to the SSI
 
Preserving software workshop - Community engagement workshop
Preserving software workshop - Community engagement workshopPreserving software workshop - Community engagement workshop
Preserving software workshop - Community engagement workshop
 
Preserving software workshop - Sustainability approaches
Preserving software workshop - Sustainability approachesPreserving software workshop - Sustainability approaches
Preserving software workshop - Sustainability approaches
 
Issue Tracking
Issue TrackingIssue Tracking
Issue Tracking
 
Supporting Software
Supporting SoftwareSupporting Software
Supporting Software
 
Managing Code in Repositories
Managing Code in RepositoriesManaging Code in Repositories
Managing Code in Repositories
 
Planning your project
Planning your projectPlanning your project
Planning your project
 
Ssi maintainers
Ssi maintainersSsi maintainers
Ssi maintainers
 
Introduction to the Software Sustainability Institute
Introduction to the Software Sustainability InstituteIntroduction to the Software Sustainability Institute
Introduction to the Software Sustainability Institute
 
Governance for Software
Governance for SoftwareGovernance for Software
Governance for Software
 

Kürzlich hochgeladen

Glenn Lazarus- Why Your Observability Strategy Needs Security Observability
Glenn Lazarus- Why Your Observability Strategy Needs Security ObservabilityGlenn Lazarus- Why Your Observability Strategy Needs Security Observability
Glenn Lazarus- Why Your Observability Strategy Needs Security Observabilityitnewsafrica
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesThousandEyes
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Mark Goldstein
 
Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfNeo4j
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI AgeCprime
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersNicole Novielli
 
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...Nikki Chapple
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesKari Kakkonen
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch TuesdayIvanti
 
React Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App FrameworkReact Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App FrameworkPixlogix Infotech
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfpanagenda
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterMydbops
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsRavi Sanghani
 

Kürzlich hochgeladen (20)

Glenn Lazarus- Why Your Observability Strategy Needs Security Observability
Glenn Lazarus- Why Your Observability Strategy Needs Security ObservabilityGlenn Lazarus- Why Your Observability Strategy Needs Security Observability
Glenn Lazarus- Why Your Observability Strategy Needs Security Observability
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
 
Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdf
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI Age
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software Developers
 
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examples
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch Tuesday
 
React Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App FrameworkReact Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App Framework
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL Router
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and Insights
 

Sustainability Training Workshop - What makes good code good?

Hinweis der Redaktion

  1. Or how would we distinguish good code from bad code? Of course, we could ask 100 people this and get 100 answers but as there ’ s a group of us here we can distil out what we believe to be the answer!
  2. Thanks to Google we can ask the world what it thinks and see what sorts of replies we get. For “ What makes good code good ” on 6 th May 2011 Paul DiLascia ’ s article was the top hit and it ’ s referenced by many others. How do we compare? Readability is often neglected – just because code is consumed by computers it is read, updated and changed by us!
  3. And one more. This blog post started by acknowledging this is a difficult question due to code being a mix of art and science. These are in order of priority but trade-offs are possible. Note correctness, this needs requirements, specification and design For it to be testable it needs automated tests. It should be extensible, flexible and reusable so you don ’ t need to rewrite it when extending or reusing it. But one must beware of YAGNI (You Ain ’t Gonna Need It) and not waste time writing code you’ll never need.
  4. From universities across the North East attended. Attendees varied both in their experience of programming and the languages they used. MATLAB was the most popular, followed by FORTRAN, C/C++, R and Python, and there were also a handful of users each of Java, Visual Basic, SQL, Smalltalk and hardware definition languages. It must do what it is intended to do and do it correctly. Without this quality, any research deriving from the code could be fundamentally flawed. The code may be worked upon by not just the original author, but others, for example research associates recruited onto a project. Similarly, the original author may need to return to the code after a long break. Source code itself says what the code does and how it does it. However, it is also important that comments be added to include design rationale, or why the code is as it is, why certain implementation decisions were taken. This can be particularly useful when these decisions might otherwise seem unconventional or non-intuitive. The code should be elegant and concise. There should be no redundant or repeated code. However, the code should not be so concise as to be so cryptic that it is very difficult to understand. The code should optimise its usage of processor, memory and storage resources. A few seconds improved run-time in a function is not necessarily worth a day of debugging if it goes wrong. The code should be well-designed and modular as this also promotes testing and code reuse. There should be tests for correctness so that both the author, and others, can have confidence that the code is fit for purpose. In addition, these tests should be shipped with the code to enable users to test their deployments, prove to themselves it works as expected and also to be able to test any changes they make. The code should be scalable and be able to handle inputs which require processing, memory or storage beyond the bounds needed by the original authors. If these bounds are reached it should fail gracefully, not just crash with a core dump. Usability is also important, the delivery of software that is easy to use. This more relates to the question "what makes good software good" than "what makes good code good" but it is beneficial to be aware that someone who is not the original author may use the software. And finally, the software should be portable. Though there may only be a need for it to run on one platform at the time of its writing, developing multi-platform software may make the software attractive to a wider number of users, or to other applications areas. Adoption of these guidelines can help scientists ensure that their code can be more than just a throwaway prototype but an asset that can continue to contribute to the evolution of both their research and that of their peers.
  5. Here ’ s another set of criteria. They ’ re different ways of expressing what we ’ ve already seen. Reflects the problems it solves, little effort to understand and makes sense a year from now relate to design. Easily understood, short, little effort to understand relate to simple and readable. Loose coupling and cohesive relate to modular and layered. Note Documents requirements for usage – not much use if we can ’ t use it!