Embrace the Unix Philosophy
An approach to software development that is pragmatic and grounded in experience.
Welcome!
Hi this is John with this week’s Developing Skills - Skills for Developers looking to develop their careers. **
🙏 Thank you for being one of the 9,499 software developers who have subscribed, I’m honoured to have you as a reader. 🎉
If there is a topic you’d like to see covered, please let me know by replying to this email📧
Tip of The Week: Lessons From the Unix Philosophy
The Unix philosophy isn't a set of rules; it's a way of thinking that has profoundly influenced the world of software engineering. It is a set of ideas, or perhaps ideals to incorporate into your approach and to aim for.
Here’s what they are:
1. Modularity: Break your code into simple, interconnected parts with clean interfaces. This makes your system more manageable and facilitates easier debugging.
2. Clarity over Cleverness: Prioritise clarity in your code over unnecessary cleverness. Clear code is easier to maintain and understand, reducing the risk of bugs and enhancing readability.
3. Composition: Design your programs to be easily connectable to other programs. Favour simplicity and interoperability to foster a cohesive ecosystem of software tools.
4. Separation of Concerns: Keep policy separate from mechanism and interfaces from engines. This separation enhances flexibility, allowing for easier adaptation to changing requirements.
5. Simplicity: Aim for simplicity in your designs. Complexity should only be added when absolutely necessary, as simpler solutions are easier to understand, debug, and maintain.
6. Transparency: Design your code for visibility, making it easy to inspect and debug. Transparent code reduces the likelihood of errors and facilitates collaboration among developers.
7. Robustness: Robustness is the child of transparency and simplicity. Robust software can gracefully handle unexpected conditions and remains stable in unexpected circumstances.
8. Representation: Fold knowledge into data to simplify program logic. Clear and structured data enable more straightforward reasoning and reduce the complexity of code. Make the program logic dumb (simple) and robust.
9. Least Surprise: Strive for interfaces that are intuitive and least surprising to users. Familiarity and consistency in design enhance usability and reduce the learning curve.
10. Silence: Minimise unnecessary output in your programs. Well-behaved software should operate unobtrusively, providing information only when necessary to avoid overwhelming users.
11. Repair: Handle errors gracefully, failing noisily and as soon as possible when necessary. Design your software to be transparent in its failure modes to facilitate diagnosis and debugging.
12. Economy: Software engineer are expensive; conserve their time in preference to computing time. Choose high-level languages and automate repetitive tasks to conserve human effort.
13. Generation: Use code generators to automate repetitive tasks and minimise hand-hacking of programs. Generated code tends to be more reliable and less error-prone than manually written code.
14. Optimisation: Prototype your solutions before optimising them. Focus on getting your code working correctly before optimizing for performance, as premature optimisation can lead to unnecessary complexity and bugs.
15. Diversity: Distrust all claims for “one true way”. Avoid rigid, closed systems in favour of open, extensible architectures.
16. Extensibility: Design your software for the future by leaving room for growth and evolution. Prioritise backward compatibility and flexibility to adapt to changing requirements over time.
Adopting these Unix-inspired principles can help you write cleaner, more maintainable code and build systems that will be around as long as Unix and it’s derivatives have.
Two Ways I Can Help You Level Up As A Software Engineer:
I write another newsletter, Coding Challenges that helps you become a better software engineer through coding challenges that build real applications.
I have some courses available:
Become a Better Software Developer by Building Your Own Redis Server (Python Edition) which guides you through solving the Redis Coding Challenge in Python.
Build Your Own Shell (Go Edition) which guides you through solving the Shell Coding Challenge in Go.
Rule 15. really is the Unix way. There is an important distinction between philosophies and rules and how to get the most out of them. My approach is:
- rules should be automated. Coding standards, naming, and similar
- philosophies should be taught through example and company culture