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

Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 
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
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 
Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Neo4j
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
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
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraDeakin University
 
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024BookNet Canada
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
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
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 

Kürzlich hochgeladen (20)

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
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 
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...
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 
Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
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
 
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptxVulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning era
 
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
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
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 

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!