12 : Getting past Tabs vs Spaces

04 Mar 2022

This week Andy and Rowan chat about why people still have a strong view of Tabs vs Spaces - and many other similar things that cause friction in dev teams. Is it really worth it, aren't there more important things people should be dealing with.

Random fact

Who was the first tech ‘start-up’ in Silicon Valley?

David Packard and William Hewlett are said to have been the first to set up shop in Silicon Valley, forming HP and setting a precedent for technology companies, specifically startup companies to operate in Silicon Valley. - 1939

The company won its first big contract in 1938 to provide test and measurement instruments for Walt Disney's production of the animated film Fantasia, which allowed Hewlett and Packard to formally establish the Hewlett-Packard Company on July 2, 1939.

Hewlett and Packard ran many business operations from David Packard's garage - 367 Addison Avenue, Palo Alto, California - started in 1939

The garage was dedicated as the Birthplace of Silicon Valley in 1989, and HP acquired the property in 2000.

HP is proud to have worked closely with the City of Palo Alto to return the house, garage, and shed to conditions much as they were in 1939. The heritage project was completed in 2005. In 2007, the property was listed on the National Register of Historic Places.

Introduction

Noticed a tweet from David Fowler that made me start thinking about this and how many times I had seen this type of conversation happening -

https://twitter.com/davidfowl/status/1468841585429258247

We’ve both seen (and worked with) people who are ‘religious’ about certain things relating to development. Things like Tabs vs Spaces, IDEs, Languages etc.

We wanted to chat about our experiences and views on this type of thing and how it can affect people and productivity.

I’ve personally been on the receiving end of comments about code that I have written that made me wonder if I should be a developer (and a the time made me feel physically sick) - I’m glad that happened to me as I learnt from it and decided that I would never treat any developer like that.

Healthy ‘discussion’ about development tools, patterns, standards etc is a good thing and should be encouraged - we learn from other peoples experiences and views but when it is no longer a discussion then it’s not ‘healthy’. Should be polite, respectful.

When do you get to a point where you understand what is and isn’t important? Where you don't put too much importance on things like tabs vs spaces or my IDE is better than your IDE.

There area so many things that people get ‘religious’ about:

  • Tabs vs spaces!!
  • Tooling:
    • command line vs gui - git and ide’s
      • you’re not a hardcore dev if you’re not using the CLI
    • text editors - vim / sublime text / notepad++
  • SQL vs NoSQL
  • Windows vs Mac vs Unix
  • TDD / BDD - always have it, no option - waste of time and extra maintenance
  • Dev Stacks and languages
    • Lets face it, everyone prefers what they know
    • GoLang vs C# vs F# vs Javascript vs Python vs etc etc etc
    • The ‘Microsoft is evil’ school of thought
  • Architectural styles
    • Event sourcing
    • CQRS
    • Domain Driven Design
  • Design patterns:
    • Repository pattern vs other data access patterns
  • Git commit message structure
  • SOLID
  • DRY

Things that aren’t going to get a project any nearer to the finish line:

  • see list above - having religious views about any of the above
  • Constraints cause things to give - something has to go

From the things above what would really bring a project to its knees? Using TDD? Using CQRS? Sure some architectural decisions may really hamper a project but it’s got to be a big mistake - and in a culture where people are empowered to speak out (and are listened to) then you can change those decisions before the pain becomes unbearable - BUT it’s depends on the company.

The worst things I’ve seen in companies is the culture and the old guard - “it’s always been like that”, “we can’t change it”, “Dave came up with that idea so there’s no way we can change it” - somebody losing face, people not being able to admit they’re wrong.

Old style companies get left behind - id they don’t appeal to devs looking for a change - companies will miss out on new blood, new ideas, new skills, new opportunities and the ability to stay competitive. New people can cause a change in the dynamics (could be bad as well as good) but people are everything - it’s all about the people - good people = make it a good place to work, which contributes to a good business - it goes around like this.

Why do people focus on these things? Is it because they have got everything else right? I doubt it.

The Joel Test - Joel Spolsky (FogBugz/Stackoverflow)

  1. Do you use source control?
  2. Can you make a build in one step?
  3. Do you make daily builds?
  4. Do you have a bug database?
  5. Do you fix bugs before writing new code?
  6. Do you have an up-to-date schedule?
  7. Do you have a spec?
  8. Do programmers have quiet working conditions?
  9. Do you use the best tools money can buy?
  10. Do you have testers?
  11. Do new candidates write code during their interview?
  12. Do you do hallway usability testing?

Ticks against everything? Yeah right ok I’m sure you have! Do more of the things that cause you pain - better, easier, quicker - suddenly not so painful - those are easier now. Is everybody using tabs over spaces really better than doing some of the above. If you do have all the above in place then yeah now is the time to focus on the small things.

Time is the enemy.

I’d argue now that just getting things done is more important than what you're using, styling, tabs vs spaces. Do the business really care what you used or did to get their application built? I don’t think so - ever been able to justify being late on a project but you have got 90% test code coverage or really nicely formatted code with only spaces/tabs - NO THEY REALLY DON’T - business value must benefit the business.

Do it at the right time - worry about the right things at the right time - when is that? Only you really know and that’s hard - but take a step back and ask yourself does this really make a different right now is it worth doing.

Do you really care about this anymore? Nope - I want to get stuff done - and I don’t want to have to manually do it - automate everything! Work smarter not harder.

I’m happy to look into new ways of doing things, new tools, new frameworks but it’s got to be justified, the right time and be worth it. You should always want to learn new things, for me it’s what keeps it interesting - but I’m not going to argue with you about it :-) I’m also not going to force my ways of working on you.

As an aside...

https://thenewstack.io/spaces-vs-tabs-a-20-year-debate-and-now-this-what-the-hell-is-wrong-with-go/

tabs vs spaces graph from github repos shows spaces are used more often

Spaces win - so now we’ve all agreed on that what about Java vs C# 😑 I think I know who the winner is.

OS project/utility of the week

https://ditto-cp.sourceforge.io/

Ditto is an extension to the standard windows clipboard. It saves each item placed on the clipboard allowing you access to any of those items at a later time. Ditto allows you to save any type of information that can be put on the clipboard, text, images, html, custom formats.