The debate between using spaces and tabs for indentation in coding may seem trivial to the uninitiated, but it is a topic that continues to inspire passionate discussions among developers. This seemingly minor choice can affect code readability, maintenance, and even team dynamics.
Let's delve into the arguments for both sides and consider why this debate remains relevant in the software development world.
Time for the long and winding part
I joined a fast growing startup in 2015. I got the job by cold emailing the head of product. They brought me in for a day of interviews — all typical stuff. Until the end. My last conversation was with two of the co-founders — CEO and COO. They asked what kind of person I was. We talked for an hour. I thought they would thank me for coming in and get back to me in a couple days. They offered the job on the spot [1]. The COO left the room, printed the offer letter, and came back with a pen. I was stunned, but exhilarated. I would be the second product hire and hundredth employee.
My first six months were a whirlwind. The company was growing fast. And it showed. Sales had ambitious quotas. Engineering had more bugs than they could fix. Customers had more feature requests than we could track. I felt right at home.
I jumped in and got my hands dirty. The first problem to tackle was process. We needed a better way to prioritize work. I asked around, got input from all departments, made some changes, and communicated them out to the company. Bugs started going down. Development velocity went up. But we still didn't have a long term roadmap.
Next was focusing on my favorite thing — customer discovery. We set up a research program, combed through customer feedback over the past year (e.g. notes in Salesforce, customer support tickets, interview notes), and aligned on the areas we needed to invest over the next year [2].
Everything seems pretty great, right?
We split the engineering team into two squads. One would focus on the existing product (which was responsible for all our revenue) while another would build a new product to take us to the next level [3].
Then I had a surge of responsibility and attention. The Content team started (temporarily) reporting to me. I was presenting at the weekly all hands. And I was invited to the executive leadership meetings.
They were usually held in the CEO's office. There were two couches arranged in an L-shape, an Eames lounge chair in one corner, and his desk chair in the other . I chose to sit on the air conditioning unit by the window behind the couches [4]. During the first meeting I attended, the CEO asked for my opinion in the middle of a debate. He liked it, and pointed to my answer as an exemplar of critical thinking. It felt good. But little did I know it put a target on my back. The direction I was nudging the company did not align with others.
As the months went by, I started noticing a change. I stopped being invited to those meetings. Instead I would be told the outcome and what to do as a result of them. As a product manager, I didn't see it as my place to question those decisions (even if I disagreed with them). So I went along.
Hybrid Approaches and Team Dynamics
The debate often extends into discussions about hybrid approaches, where teams might use tabs for indentation and spaces for alignment within lines, attempting to combine the best of both worlds. However, such strategies require clear team agreements and disciplined adherence to coding standards to prevent formatting chaos.
Ultimately, the choice between spaces and tabs often comes down to team consensus and project guidelines. In environments where collaboration and code sharing are common, agreeing on a standard that everyone follows is more important than the individual preferences of spaces versus tabs. Modern development tools and linters can help enforce these standards, making the choice less about technical limitations and more about team dynamics and coding philosophy.
Conclusion
While the spaces vs. tabs debate might not have a one-size-fits-all answer, it underscores the importance of consistency, readability, and team collaboration in software development. Whether a team chooses spaces, tabs, or a hybrid approach, the key is to make a conscious choice that serves the project's needs and to adhere to it throughout the codebase. As with many aspects of coding, communication and agreement among team members are paramount to navigating this classic programming debate.