12 Principles for Better Software Engineering
Don't be a code-jerk. Be thoughtful, communicative, and remember there are actual people involved in this whole "software" thing.
Join the DZone community and get the full member experience.
Join For FreeThese are not just technical tips, but principles that shaped how I learned and think about engineering. Take what’s useful, ignore what isn’t. But remember, being a great developer isn’t only about code.
1. “The Most Elegant Solution Is the One You Never Have to Maintain.”
The most effective code is often the code you never have to write. This might sound counter-intuitive, but one of the most profound lessons I've learned is that sometimes, the most effective solution is to avoid writing new code altogether.
- Example: Before you embark on building a complex feature or system, pause and ask:
- Does a library, service, or existing component already do this?
- Can we simplify the problem so much that this feature isn't even necessary?
- Is there a manual process, or a simpler, non-technical solution, that would suffice for now?
Often, the cost of maintaining, debugging, and evolving new code far outweighs the perceived benefit of building it from scratch.
- PRO-Tip: Prioritize simplicity and reusability. Always look for opportunities to leverage existing solutions, whether internal or external. Question the necessity of every line you write. The less code you have, the less there is to break, and the easier it is to maintain and evolve.
2. “Tools Are Servants of Your Ideas, Not Their Masters.”
Master Your Tools, But Don't Worship Them. Just as a master does, great software engineers understand their tools—languages, frameworks, IDEs, and deployment pipelines. However, the tools are a means to an end, not the end itself.
- Example: Python is a powerful language, Django a robust framework. But relying solely on them without understanding the underlying principles of web development, databases, or algorithms can lead to chaos and inefficient systems. The true master can pick up a new language or framework with relative ease because they grasp the fundamental concepts that transcend specific technologies.
- PRO-Tip: Dive deep into how your tools work. Understand their strengths and weaknesses. But also, regularly explore new tools and paradigms. This prevents dogma and keeps your mind agile. Don't be afraid to leave a comfortable tool behind if a newer, better one emerges, but only after careful consideration and understanding.
3. "Perfect Is a Moving Target; Value Is When You Release."
Know When to Ship, and When to Refine. Perfection can stop you from doing good work, But careless work will ruin long-term success. A true expert knows how to strike the right balance.
- Example: Google's "launch early and iterate" philosophy is a testament to this. They release products when they are "good enough" and then refine them based on real-world user feedback. On the other hand, critical infrastructure like medical software or aerospace systems demands an extremely high level of initial polish and rigorous testing before deployment.
- PRO-Tip: Understand the context of your project. For a new feature, aim for a Minimum Viable Product (MVP) to get feedback quickly. For core, critical systems, invest more upfront in design, testing, and robustness. Always strive for quality, but be pragmatic about where to apply your greatest efforts. Sometimes, a quick-and-dirty solution today allows you to deliver value and learn, which informs the truly elegant solution tomorrow.
4. “Programs Must Be Written for People to Read, and Only Incidentally for Machines to Execute.” — Harold Abelson
Understand the Business, or the Code Won’t Matter: You must understand the business first. If you don’t know what problem you’re solving or who your work is for, your code won’t matter, no matter how perfect it is. Knowing the business gives purpose to your code and makes it truly valuable.
- Example: Google PageRank Algorithm
- Solved a business-critical problem: surfacing the most relevant content.
- Original paper:
The Anatomy of a Large-Scale Hypertextual Web Search Engine
- PRO-Tip: Always ask: What real-world outcome will this produce?
5. “Any Fool Can Write Code That a Computer Can Understand. Good Programmers Write Code That Humans Can Understand.” — Martin Fowler
Write your code as a gift to the next engineer who reads it. Your future teammates will thank you for clear, thoughtful code that’s easy to read and maintain.
- Example: Django Codebase
- Famous for clarity and explicitness.
- Example
urls.py:
Django URLconf Example
- PRO-Tip:
Leave docstrings:
def get_user_profile(user_id):
"""
Retrieve the user profile based on the given user ID.
Returns None if the profile does not exist.
"""
6. “The Most Dangerous Phrase in the Language Is: ‘We’ve Always Done It This Way.’” — Grace Hopper
Every line of code has a story behind it—why it was written, what problem it solves, and how it fits into the bigger picture. Respect that history before you change or remove anything as understanding the story helps you make better decisions.
- Example: Linux Kernel Git History
- Rich commit logs spanning decades.
- Browse online:
Linux Kernel Git Repository
- PRO-Tip:
Usegit blame:
git blame -L 50,70 -- path/to/file.c
…and see who changed those lines and why.
7. “Premature Optimisation Is the Root of All Evil.” — Donald Knuth
Choose the Right Abstraction—Not the Most Abstract One. Pick the right level of abstraction for your code, not the fanciest or most complicated one. The goal is to make your design clear and practical, not to impress people. Good abstractions solve real problems without adding confusion.
- Example: Python collections module
- Simple, practical structures instead of overengineering.
- Docs:
collections — Container Datatypes
- PRO-Tip:
Sometimes alistis better:
words = ["apple", "banana", "cherry"]
8. “The Biggest Problem in Communication Is the Illusion That It Has Taken Place.” — George Bernard Shaw
Communication is the most underrated skill in engineering. You can write great code, but if you can’t clearly explain your ideas, share your decisions, or ask for help, your work will suffer. Good communication makes teams stronger and projects more successful.
- Example:
Stripe API Documentation- Clear and approachable examples.
- See it live:
Stripe API Reference
- PRO-Tip:
Write aREADME.md:
# Payment Processor
This module validates and charges credit cards via the Acme API.
## How to Use
1. Configure credentials.
2. Call `charge()`.
3. Handle exceptions.
9. “Debugging Is Twice as Hard as Writing the Code in the First Place.” — Brian Kernighan
Good logs are like time machines. They let you travel back and see exactly what happened in your system when things go wrong. Clear, detailed logs save you hours of guessing and help you fix problems faster.
- Example: Airbnb Postmortem Culture
- They publish internal retrospectives to learn from incidents.
- Example (summary): Airbnb’s engineering team practices blameless, detailed postmortems using a custom incident-tracking tool to document both failures and successes, fostering a culture of continuous learning and improvement.
- This video, 12 essential logging best practices, explains how to make your logs more useful, structured, secure, and scalable for easier debugging and monitoring.
- PRO-Tip:
Use structured logging:
import logging
logger = logging.getLogger(__name__)
logger.info("Processing order", extra={"order_id": order.id, "user_id": user.id})
10. “If You Want to Go Fast, Go Alone. If You Want to Go Far, Go Together.” — African Proverb
You Grow When Your Team Grows. The real measure of your skill is how much stronger everyone becomes because you were here.”
- Example: Apache Software Foundation
- Thousands of contributors mentored into maintainers.
- See their project governance:
Apache Project Maturity Model
- PRO-Tip:
Pair-program, document decisions, encourage questions.
11. “Code With Purpose, Design With Clarity, Build With Care—This Is How Good Engineers Create Lasting Impact.”
Engineering isn’t just solving problems — it’s solving the right problems, in the right way, for the right reasons.”
-
Example:
Git’s Design
- A sophisticated internal model but simple commands.
- Linus’s original design notes:
Git Design Notes
- PRO-Tip: Keep interfaces small and focused.
12. “Yesterday’s Expertise Is Today’s Starting Line.”
Cultivate a Growth Mindset; The Learning Never Stops
Technology is a relentless tide, constantly bringing new waves of innovation. The moment you believe you've learned it all is the moment you start falling behind.
- Example: The transition from monolithic architectures to microservices, from relational databases to NoSQL, from manual deployments to CI/CD pipelines—these shifts demand continuous learning. The engineers who thrived through these changes were those who embraced new ideas, experimented, and were willing to unlearn old habits.
- PRO-Tip:Dedicate time, even if it's just a few hours a week, to continuous learning. Read technical books, follow industry leaders, experiment with new technologies, contribute to open source, or even teach others.
The act of teaching is one of the most powerful ways to solidify your own understanding.
Keep learning. Keep teaching. Keep building.
Opinions expressed by DZone contributors are their own.
Comments