For most of my coding life, I have been the only user of my programs. I wrote them to aid my work or personal life, and only rarely did anyone else even see my code or watch it run. This wasn't on purpose. It just turned out that way. In my current job I do belong to a small development team, but our programs are still only for in-house use, so the only needs we have to consider are our own.
This situation is starting to change. My programming projects are becoming more relevant to the outside world, and I want to share some of them as open source. This means I'm needing to reshape some of my programming practices and learn some areas of software development I've had the luxury of ignoring all these years.
I haven't completely ignored these areas, though. I pick up on them here and there as I read about how other people code or as I see them in the software I use. Knowing that I'll probably need to know about them someday, I've kept a list. And now the time has come for me to fill in the details.
I'm filling in the details here in this guide for two reasons. First, as I learn, writing helps me clarify my thoughts and keep them flowing. And second, posting my writing might help other people. So if you're like me and you've programmed mainly for yourself--what I call private coding--and you're starting to share your work with others--public coding--then maybe what I've learned so far can grease some of your own planning.
This project consists of my reading other developers' advice, examining their code, deciding what to adopt and how to adapt it to my needs and preferences, and creating templates, procedures, reference materials, and anything else that might help me code well for a public user base.
This guide will be oriented toward Python for now, but I imagine a lot of its suggestions apply to other languages too. At this point it also centers around desktop command-line programs, but I'm hoping to expand it into other interfaces and environments.
Since this guide is a place for me to learn, I welcome feedback, and I'm always open to arguments that my choices could be improved or suggestions for things I've missed.
This is an early iteration of the guide, so it's incomplete, and a lot of it is only sketched out.
- Software Development Methodology
- Version Control
- Code Style
- Project Structure
- User Interface
- Application Configuration
General coding guides
These are resources with advice on many aspects of writing good code. The ones I haven't read are on my to-read list. I'll probably be adding others.
Another resource that overlaps with this guide but covers more on the project management end of OSS is Producing Open Source Software.
To show how I'm implementing these ideas in my own code, I'll refer to my GitHub repositories throughout the guide, mainly my templates for cookiecutter, a Python app that creates project skeletons for any language, and my snippets for Sublime Text 2, the text editor I use. Snippets are templates Sublime inserts wherever you type the corresponding trigger strings.
Here are projects that show up in lists of high quality code, so I'll examine some of them and include any relevant discoveries in the guide. All the projects I'm listing for now are in Python.
In addition to these, I keep a mental list of software with features I might want to emulate, even if I don't plan to study their code very thoroughly:
- Firefox - automatic updating; possibly its add-on architecture, if it ever settles down
- WordPress - plugin hooks
Buschmann, Frank, ed. Pattern-Oriented Software Architecture: A System of Patterns. Chichester ; New York: Wiley, 1996.
Fowler, Martin. Patterns of Enterprise Application Architecture. The Addison-Wesley Signature Series. Boston: Addison-Wesley, 2003.
Martin, Robert C. Clean Architecture: A Craftsman’s Guide to Software Structure and Design. Boston: Prentice Hall, 2018.
Humble, Jez, and David Farley. Continuous Delivery: Reliable Software Releases through Build, Test, and Deployment Automation. Upper Saddle River, NJ: Addison-Wesley, 2010.
Agans, David J. Debugging: The Nine Indispensable Rules for Finding Even the Most Elusive Software and Hardware Problems. New York: Amacom, 2002.
Evans, Eric. Domain-Driven Design: Tackling Complexity in the Heart of Software. Boston: Addison-Wesley, 2004.
Gamma, Erich, ed. Design Patterns: Elements of Reusable Object-Oriented Software. Addison-Wesley Professional Computing Series. Reading, Mass: Addison-Wesley, 1995.
Martin, Robert C., ed. Clean Code: A Handbook of Agile Software Craftsmanship. Upper Saddle River, NJ: Prentice Hall, 2009.
McConnell, Steve. Code Complete. 2nd ed. Redmond, Wash: Microsoft Press, 2004.
Raymond, Eric S. The Art of UNIX Programming: With Contributions from Thirteen UNIX Pioneers, Including Its Inventor, Ken Thompson. Nachdr. Addison-Wesley Professional Computing Series. Boston: Addison-Wesley, 2008.
Bowman, Courtney, Ari Gesher, John K. Grant, Daniel Slate, and Elissa Lerner. The Architecture of Privacy: On Engineering Technologies That Can Deliver Trustworthy Safeguards. First edition. Sebastopol, CA: O’Reilly Media, 2015.
Fogel, Karl. Producing Open Source Software: How to Run a Successful Free Software Project. Version 2.3106., 2018. https://producingoss.com/.
McConnell, Steve. Rapid Development: Taming Wild Software Schedules. Redmond, Wash: Microsoft Press, 1996.
Stellman, Andrew, and Jennifer Greene. Learning Agile. First edition. Beijing: O’Reilly, 2014.
Fowler, Martin, and Kent Beck. Refactoring: Improving the Design of Existing Code. The Addison-Wesley Object Technology Series. Reading, MA: Addison-Wesley, 1999.
McDonald, Kent J. Beyond Requirements: Analysis with an Agile Mindset. New York: Addison-Wesley, 2016.
Patton, Jeff. User Story Mapping: Discover the Whole Story, Build the Right Product. First edition. Beijing ; Sebastopol, CA: O’Reilly, 2014.
Howard, Michael, David LeBlanc, and John Viega. 24 Deadly Sins of Software Security: Programming Flaws and How to Fix Them. New York: McGraw-Hill, 2010.
Nygard, Michael T. Release It! Design and Deploy Production-Ready Software. Second edition. The Pragmatic Programmers. Raleigh, North Carolina: The Pragmatic Bookshelf, 2018.
Beck, Kent. Test-Driven Development: By Example. The Addison-Wesley Signature Series. Boston: Addison-Wesley, 2003.
Feathers, Michael C., and Robert C. Martin. Working Effectively with Legacy Code. Robert C. Martin Series. Upper Saddle River, NJ: Prentice Hall Professional Technical Reference, 2005.
Freeman, Steve, and Nat Pryce. Growing Object-Oriented Software, Guided by Tests. The Addison-Wesley Signature Series. Upper Saddle River, NJ: Addison Wesley, 2010.
Meszaros, Gerard, and Martin Fowler. XUnit Test Patterns: Refactoring Test Code. Upper Saddle River, New Jersey: Addison-Wesley, 2007.
Cooper, Alan. About Face: The Essentials of Interaction Design. 4th edition. Indianapolis, IN: John Wiley and Sons, 2014.
Rosenfeld, Louis, Peter Morville, and Jorge Arango. Information Architecture: For the Web and Beyond. Fourth edition. Sebastopol, CA: O’Reilly Media, Inc, 2015.