Lines of Code Is Not a Metric, Karen
We are an industry obsessed with measurement. We measure everything: uptime, latency, conversion rates, customer acquisition cost. But when it comes to measuring the productivity of the people who build our products, we are hopelessly lost.
The desire to measure developer productivity is understandable. It's a multi-million dollar line item on the P&L, and we want to know if we're getting a good return on our investment. But the pursuit of a single, simple metric for productivity is a fool's errand. It's a quest that has led to more harm than good, to toxic cultures, and to a fundamental misunderstanding of what it means to build great software.
The Wrong Metrics: Counting the Trees
The history of measuring developer productivity is littered with failed attempts to quantify the unquantifiable.
- •Lines of Code (LOC): The original sin. It's a metric that incentivizes verbose, bloated code and penalizes elegant, concise solutions.
- •Commit Frequency: A measure of how often someone uses Git. It tells you nothing about the quality or impact of their work.
- •Story Points: A measure of a team's ability to estimate, not their ability to deliver value. It's a useful planning tool, but a terrible performance metric.
- •Pull Request Throughput: A measure of how quickly a team can merge code. It can be useful, but it can also incentivize small, trivial changes over large, impactful ones.
Case Study: IBM's LOC Disaster
In the 1980s, IBM paid programmers based on lines of code written. The result:
- •Developers wrote unnecessarily verbose code
- •Simple functions became complex monstrosities
- •The OS/360 operating system ballooned to millions of lines
- •Maintenance became a nightmare, contributing to IBM's decline
- •Bill Gates later called this "the worst metric ever invented"
These metrics are all flawed for the same reason: they measure output, not outcome. They are the trees, and we are lost in them, unable to see the forest.
The Right Framework: Seeing the Forest
So, how do we see the forest? How do we measure what really matters? We need to shift our focus from individual output to team and system outcomes. The SPACE framework, developed by researchers from Microsoft, GitHub, and the University of Victoria, provides a great starting point.
SPACE stands for:
- •Satisfaction and Well-Being: Are your developers happy? Do they feel fulfilled? Do they have a healthy work-life balance?
- •Performance: How is your software performing? Is it reliable? Is it fast?
- •Activity: What are your developers doing? How are they spending their time?
- •Communication and Collaboration: How well is your team working together? How is information flowing?
- •Efficiency and Flow: How easily can your developers get their work done? Are there bottlenecks in the system?
This is not a list of metrics to track on a dashboard. It's a framework for thinking about productivity in a more holistic way.
Practical Ways to Understand Productivity
If you can't have a single metric, what can you have? You can have a rich, qualitative understanding of your team's health and impact, informed by a variety of quantitative signals.
1. Talk to Your People (Satisfaction)
The most important thing you can do is to talk to your engineers.
- •Regular 1-on-1s: Ask them what's blocking them. Ask them what they're proud of. Ask them what they would change.
- •Developer Satisfaction Surveys: Use a simple, regular survey (like the Net Promoter Score) to gauge sentiment and track trends over time.
2. Measure Your System (Performance & Efficiency)
Your production system is a reflection of your team's productivity.
- •DORA Metrics: These four metrics (Lead Time for Changes, Deployment Frequency, Change Failure Rate, and Mean Time to Recovery) are the gold standard for measuring the performance of a software delivery organization.
- •Cycle Time: How long does it take for an idea to go from conception to production? A shorter cycle time is a sign of a healthy, efficient system.
3. Observe Your Team (Communication & Collaboration)
- •Team Health Monitors: Atlassian has a great set of simple, qualitative checks you can run with your team to gauge things like psychological safety, shared understanding, and decision-making.
- •Pull Request Reviews: Are reviews happening in a timely manner? Is the feedback constructive? A healthy review process is a sign of a healthy team.
The Ethics of Measuring Developers
The quest to measure developer productivity isn't just a technical challenge—it's an ethical minefield. Every metric we choose sends a message about what we value, and every dashboard we create shapes behavior in ways we might not intend.
The Surveillance State of Software
When Microsoft introduced stack ranking in the 2000s, they thought they were creating a meritocracy. What they actually created was a culture of backstabbing and political maneuvering that drove away top talent and stifled innovation. Employees spent more time gaming the system than building great products.
Case Study: The Fall of Stack Ranking at Microsoft
Under Steve Ballmer, Microsoft's stack ranking system required managers to rate employees on a bell curve, automatically designating 20% as underperformers. This led to:
- •Top performers avoiding working together to prevent competition
- •Innovation stifled as employees focused on safe, measurable wins
- •A mass exodus of talent to competitors like Google and Amazon
- •The system was finally abolished in 2013 under Satya Nadella, who replaced it with a focus on teamwork and impact
The modern equivalent is the rise of "productivity theater"—developers optimizing for metrics rather than impact:
- •Splitting meaningful PRs into tiny commits to boost frequency metrics
- •Writing verbose code to increase LOC
- •Creating unnecessary abstraction layers to appear "architectural"
- •Scheduling commits for optimal visibility
Privacy and Trust
Every keystroke logged, every minute tracked, every line scrutinized—this isn't productivity measurement, it's digital taylorism. When developers know they're being watched at a granular level, creativity dies. Innovation requires psychological safety, and psychological safety requires trust.
Consider the difference between:
- •Surveillance: "We track every minute of your day"
- •Support: "We measure system health to remove blockers"
The intent might be the same, but the impact on culture is radically different.
The Goodhart Trap
"When a measure becomes a target, it ceases to be a good measure." This principle, known as Goodhart's Law, is particularly vicious in software development. The moment you start rewarding based on a metric, that metric becomes worthless.
Real examples from the field:
- •A team rewarded for test coverage that wrote tests with no assertions
- •Developers penalized for bugs who stopped taking on challenging work
- •Engineers evaluated on story points who inflated every estimate
Case Study: Wells Fargo's Metrics Disaster (Tech Division)
Wells Fargo's technology teams were measured on the number of applications deployed. This led to:
- •Teams splitting single applications into multiple microservices unnecessarily
- •Increased system complexity and maintenance burden
- •Higher infrastructure costs
- •Eventually requiring a complete architectural review and consolidation effort
Power Dynamics and Psychological Safety
Metrics are never neutral—they're tools of power. When used carelessly, they become weapons that destroy the very culture that makes great software possible.
The key questions to ask:
- •Who controls the metrics?
- •Who has access to the data?
- •How is the data used in performance reviews?
- •Can individuals opt out?
- •Is there transparency in how metrics are calculated?
The Economics of Developer Productivity
Let's talk money. The average software engineer in the US costs their employer around $200,000 per year when you factor in salary, benefits, and overhead. For a team of 10, that's $2 million annually. The economic stakes of productivity are massive, but most companies are optimizing for the wrong things.
The Hidden Costs of Bad Metrics
When you measure the wrong things, you don't just get bad data—you get bad outcomes that cost real money:
Attrition Costs: It costs between $100,000 and $500,000 to replace a senior engineer when you factor in:
- •Recruiting costs (25-30% of annual salary)
- •Lost productivity during search (3-6 months)
- •Onboarding time (3-6 months to full productivity)
- •Knowledge loss (priceless)
Technical Debt: Teams optimizing for velocity metrics create debt that compounds:
- •A "quick fix" that saves 2 days today costs 2 weeks next year
- •Architectural shortcuts to hit deadlines create exponential maintenance costs
- •Poor code quality leads to 10x longer feature development times
Meeting Madness: The average developer spends 25% of their time in meetings. For a team of 10 at $200k each, that's $500,000 per year in meeting costs alone.
The Multiplier Effect
Great engineers don't just write more code—they multiply the effectiveness of everyone around them:
- •They write tools that make everyone faster
- •They mentor juniors, turning them into seniors
- •They make architectural decisions that prevent entire classes of bugs
- •They establish patterns that scale across the organization
A single 10x engineer isn't someone who codes 10x faster—they're someone who makes 10 other engineers 2x more effective.
ROI of Developer Experience
Companies that invest in developer experience see measurable returns:
GitHub's 2024 State of DevEx Report found:
- •50% reduction in onboarding time with good tooling
- •2x faster feature delivery with modern CI/CD
- •75% fewer production incidents with proper testing infrastructure
Stripe's Developer Coefficient calculated that:
- •Poor developer experience costs the average company $85 million per year
- •Companies with excellent DevEx grow revenue 2x faster
- •Every $1 invested in developer tools returns $3.50 in productivity
Case Study: Spotify's Developer Experience Investment
Spotify invested heavily in developer experience, creating:
- •Backstage: An open-source developer portal that became the foundation for thousands of companies
- •Golden Path: Standardized, well-documented ways to build services
- •Automated Infrastructure: Self-service platform reducing deployment time from days to minutes
- •Result: 3x increase in deployment frequency, 60% reduction in time-to-market for new features
The Economics of Flow State
Flow state—that magical zone where developers are fully immersed and maximally productive—has real economic value:
- •It takes an average of 23 minutes to recover from an interruption
- •A developer in flow is 5x more productive than baseline
- •Each context switch costs approximately $25 in lost productivity
For a team of 10 developers interrupted 10 times per day, that's $650,000 per year in lost productivity from context switching alone.
Strategies for Improving Productivity
Knowing what not to measure is only half the battle. Here are concrete strategies for actually improving developer productivity.
1. Systems Thinking: Fix the System, Not the People
Most productivity problems aren't people problems—they're system problems. Before you blame the developers, examine the system they're operating in.
Common System Problems:
- •Slow CI/CD pipelines that block deployment
- •Flaky tests that erode confidence
- •Poor documentation that creates knowledge silos
- •Complex approval processes that create bottlenecks
- •Technical debt that makes simple changes complex
System Solutions:
- •Invest in build infrastructure (every minute saved in CI is multiplied by thousands)
- •Create self-service platforms that eliminate handoffs
- •Automate repetitive tasks ruthlessly
- •Establish clear ownership and decision rights
- •Pay down technical debt strategically
2. Developer Experience as Competitive Advantage
Companies that treat developer experience (DevEx) as a product see massive productivity gains.
Key DevEx Investments:
- •Fast Feedback Loops: Sub-second hot reloading, instant test runs, immediate CI feedback
- •Excellent Tooling: IDEs configured with team standards, powerful debugging tools, automated formatting
- •Clear Documentation: Searchable, up-to-date, with examples and explanations
- •Smooth Onboarding: New developers shipping to production on day one
- •Psychological Safety: Freedom to experiment, fail, and learn
Case Study: Google's 20% Time
Google's famous "20% time" policy (allowing engineers to spend 20% of their time on personal projects) led to:
- •Gmail, Google News, and AdSense—products generating billions in revenue
- •Increased retention of top talent
- •A culture of innovation and experimentation
- •While the formal policy has evolved, the principle of giving developers autonomy remains core to Google's culture
Case Study: Netflix's Freedom & Responsibility
Netflix revolutionized developer productivity by:
- •Eliminating vacation tracking—treat developers as adults
- •No expense approval for tools—if it helps you work better, buy it
- •Full production access for all engineers—with great power comes great responsibility
- •Result: One of the highest revenue-per-employee ratios in tech
3. Platform Engineering: The Force Multiplier
Platform engineering is about creating leverage—building tools and systems that multiply the effectiveness of every developer.
High-Impact Platform Investments:
- •Development Environments: Containerized, reproducible, instant spin-up
- •Deployment Pipelines: One-click deploys with automatic rollbacks
- •Observability: Easy debugging with distributed tracing and structured logging
- •Security: Automated scanning and compliance built into the workflow
- •Cost Management: Visibility and optimization tools for cloud spending
Case Study: Amazon's Platform Revolution
Amazon's transformation into a platform company (2002 Bezos API Mandate) forced teams to:
- •Build everything as a service with APIs
- •Use their own services (dogfooding)
- •Create robust tooling for service management
- •Result: AWS was born from internal tools, now a $100B+ business
- •Internal productivity gains: 10x reduction in time to launch new services
Case Study: Airbnb's Developer Productivity Team
Airbnb created a dedicated Developer Productivity team that:
- •Reduced CI build times from 60 minutes to 10 minutes
- •Created a unified development environment used by 100% of engineers
- •Built automated testing infrastructure reducing bug escape rate by 75%
- •ROI: $10M+ annual savings from productivity improvements alone
4. Cognitive Load Management
Developers are knowledge workers, and their primary constraint is cognitive capacity. Every bit of unnecessary complexity is productivity stolen.
Reducing Cognitive Load:
- •Boring Technology: Use proven, well-understood tools
- •Convention Over Configuration: Reduce decisions through smart defaults
- •Modular Architecture: Small, comprehensible services with clear boundaries
- •Effective Abstractions: Hide complexity without hiding understanding
- •Just-In-Time Learning: Documentation and help exactly when needed
5. Meeting Hygiene and Async Culture
Meetings are the death of developer productivity. Every meeting is a context switch, a flow state interrupted, and deep work prevented.
Meeting Strategies:
- •No-Meeting Days: Sacred time for deep work
- •Async by Default: Use written communication for non-urgent matters
- •Meeting Budgets: Teams get a fixed number of meeting hours per week
- •Required Agendas: No agenda, no meeting
- •Decision Documents: Replace discussion meetings with written proposals
Case Study: Shopify's Meeting Purge
In 2023, Shopify deleted all recurring meetings with 3+ people:
- •12,000 recurring meetings canceled overnight
- •Introduced "No Meeting Wednesdays"
- •Meetings require written justification
- •Result: 33% increase in project completion rates
- •Engineers reported highest satisfaction scores in company history
Case Study: GitLab's Async-First Culture
As a fully remote company, GitLab has perfected async work:
- •Everything is documented in their public handbook (2,000+ pages)
- •Decisions made via merge requests, not meetings
- •Average engineer has < 5 hours of meetings per week
- •Result: 3x faster growth than industry average with 1,300+ employees in 65+ countries
6. The Power of Automation
Every manual process is an opportunity for automation. The compound effect of automation is staggering.
High-Value Automation Targets:
- •Code formatting and linting
- •Dependency updates
- •Release notes generation
- •Test data creation
- •Environment provisioning
- •Security scanning
- •Performance regression detection
Case Study: Etsy's Deployment Automation
Etsy transformed from deploying twice a week to 50+ times per day:
- •Built "Deployinator" - one-button deployment system
- •Automated testing, monitoring, and rollback
- •New engineers deploy on their first day
- •Result: 90% reduction in deployment-related incidents
- •Faster feature delivery and happier developers
Case Study: Facebook's Testing Infrastructure
Facebook invested heavily in test automation:
- •Sapienz: AI-powered automated testing finding bugs in mobile apps
- •Infer: Static analyzer preventing null pointer exceptions at scale
- •Prophet: Time series forecasting for performance regression
- •Result: 75% of bugs caught before reaching production
- •Saved thousands of engineer-hours annually
The Future: LLMs and Developer Productivity Measurement
We're on the cusp of a revolution in how we understand and improve developer productivity. Large Language Models aren't just changing how we write code—they're changing how we measure and optimize the entire development process.
Intelligent Code Analysis
LLMs can analyze code in ways that were previously impossible:
Quality Assessment:
- •Identify architectural patterns and anti-patterns
- •Detect code smells and technical debt hotspots
- •Assess readability and maintainability
- •Predict bug-prone areas before they cause issues
Impact Analysis:
- •Understand the true scope of changes
- •Identify hidden dependencies
- •Predict performance implications
- •Assess security vulnerabilities in context
Automated PR Intelligence
Pull request reviews are getting an AI upgrade:
- •Semantic Understanding: LLMs understand what the code is trying to do, not just syntax
- •Context Awareness: Consider the broader codebase and architectural patterns
- •Learning from History: Identify patterns from past bugs and reviews
- •Actionable Feedback: Specific suggestions, not just problem identification
Case Study: Microsoft's AI-Powered Code Reviews
Microsoft integrated AI into their code review process:
- •70% reduction in review turnaround time
- •AI catches 40% of bugs that human reviewers miss
- •Developers spend 50% less time on routine review tasks
- •Focus shifted to architectural and design discussions
Case Study: Google's ML-Powered Code Suggestions
Google's internal ML system analyzes code patterns across their massive codebase:
- •Suggests improvements based on patterns from millions of code reviews
- •Prevents 25% of would-be production bugs
- •Reduces code review rounds by 30%
- •Saves an estimated 1,000 engineer-years annually
Developer Sentiment Analysis
LLMs can analyze communication patterns to understand team health:
- •Burnout Detection: Identify stress patterns in Slack messages and PR comments
- •Collaboration Quality: Assess the tone and effectiveness of team communication
- •Knowledge Gaps: Detect when developers are struggling with unfamiliar domains
- •Culture Monitoring: Track psychological safety through language patterns
Predictive Analytics
The real power of LLMs is in prediction:
Delivery Prediction:
- •Estimate completion times based on code complexity and historical patterns
- •Identify projects at risk of delay before they slip
- •Suggest resource allocation optimizations
Quality Prediction:
- •Predict bug rates for new features
- •Identify architectural decisions that will cause future problems
- •Recommend testing strategies based on risk analysis
Team Prediction:
- •Predict attrition risk based on contribution patterns
- •Identify skill gaps before they become blockers
- •Recommend team compositions for new projects
Case Study: LinkedIn's Predictive Analytics
LinkedIn built ML models to predict developer productivity issues:
- •Identified engineers at risk of burnout with 87% accuracy
- •Predicted project delays 3 weeks in advance
- •Recommended optimal team compositions based on skill graphs
- •Result: 40% reduction in missed deadlines
- •25% improvement in employee retention
Case Study: Meta's Code Quality Predictions
Meta (Facebook) uses AI to predict code quality issues:
- •SapFix: Automatically generates fixes for bugs
- •Getafix: Learns from past code reviews to suggest improvements
- •Predicted 70% of production issues before deployment
- •Reduced debugging time by 50%
- •Enabled engineers to focus on feature development
The Dangers of Algorithmic Management
With great power comes great responsibility. LLM-based measurement introduces new risks:
Bias Amplification: LLMs trained on biased data will perpetuate and amplify those biases
Gaming the AI: Developers will learn to write code that scores well with AI reviewers
Loss of Human Judgment: Over-reliance on AI metrics can miss crucial context
Privacy Erosion: Detailed analysis capabilities enable unprecedented surveillance
Privacy-Preserving Measurement
The future of ethical AI measurement requires privacy-first design:
- •Differential Privacy: Add noise to individual data while preserving aggregate insights
- •Federated Learning: Train models without centralizing sensitive data
- •Homomorphic Encryption: Analyze encrypted data without decryption
- •Opt-In Transparency: Clear consent and control over personal data
A Vision for Augmented Leadership
The goal isn't to replace engineering managers with AI—it's to augment their capabilities:
AI as Coach:
- •Surface insights humans might miss
- •Suggest interventions based on patterns
- •Provide objective third-party perspective
- •Enable data-driven career conversations
AI as Early Warning System:
- •Detect problems before they escalate
- •Identify opportunities for improvement
- •Predict resource needs
- •Flag potential conflicts or misalignments
AI as Knowledge Manager:
- •Capture and codify tribal knowledge
- •Identify expertise across the organization
- •Suggest optimal team compositions
- •Facilitate knowledge transfer
Conclusion: The Path Forward
We've covered a lot of ground—from the ethical minefield of measurement to the economic realities, from practical strategies to the AI-powered future. But in the end, it all comes back to a simple truth: productivity is not a number. It's a feeling.
It's the feeling of a team that is in a state of flow, working together seamlessly, shipping great software that solves real problems for real users. It's the satisfaction of removing a blocker that's been frustrating the team for months. It's the pride of mentoring a junior engineer into a confident contributor. It's the joy of elegant code that just works.
The Leader's Mandate
As we enter the age of AI-augmented development, the role of engineering leadership becomes more crucial, not less. Your job is not to maximize metrics or optimize dashboards. Your job is to:
- •Create Psychological Safety: Build an environment where developers can take risks, make mistakes, and innovate without fear
- •Remove Friction: Ruthlessly eliminate anything that prevents your team from doing their best work
- •Invest in Leverage: Build tools and systems that multiply effectiveness across the organization
- •Measure What Matters: Focus on outcomes, not outputs; on impact, not activity
- •Respect the Human: Remember that behind every commit is a person with hopes, fears, and aspirations
The Paradox Resolved
The paradox of measuring developer productivity is that the more directly you try to measure it, the more you destroy it. But by focusing on creating the right conditions—the right tools, the right culture, the right incentives—productivity emerges naturally.
Stop counting the trees. Start tending the forest. The rest will follow.
A Call to Action
If you're an engineering leader reading this, here's what you can do tomorrow:
- •Audit Your Metrics: What are you currently measuring? What behaviors are those metrics incentivizing? Are they aligned with your actual goals?
- •Talk to Your Team: Not about velocity or story points, but about what's frustrating them, what's exciting them, what would make their work more fulfilling
- •Pick One System Problem: Find one piece of friction in your development process and fix it. It could be slow builds, flaky tests, or painful deployments. Fix one thing.
- •Experiment with AI: Try using LLMs to analyze your codebase or review processes. Learn what's possible, but also what's dangerous.
- •Invest in Developer Experience: Treat your developers' experience as seriously as you treat your customers' experience.
The future of software development isn't about measuring developers like factory workers. It's about creating environments where talented people can do their best work. That's not just more ethical and more economical—it's the only sustainable path forward.
Build great teams. Give them great tools. Get out of their way. That's the secret to developer productivity. Everything else is just counting trees.