Microsoft veteran ditches Team Tabs, blaming storage trauma of yesteryear
How do you indent yours?
Veteran Microsoft engineer Larry Osterman is the latest to throw his hat into the "tabs versus spaces" ring.
The debate has vexed engineers for decades – is it best to indent code with tabs or spaces? Osterman, a four-decade veteran of Microsoft, was Team Tabs when storage was tight, but has since become Team Spaces with the advent of terabytes of relatively inexpensive storage.
"Here's the thing," he said. "When you've got 512 kilobytes, and you're writing a program in Pascal with lots of indentation, if you're taking eight bytes for every one of those indentations, for eight spaces, you could save seven bytes in your program by using a tab character."
It all added up, even when floppy disks were part of the equation.
However, according to Osterman, things have changed. Storage is less of an issue, so why not use spaces? A cynic might wonder if that sort of attitude has led to the bloatware of today, where software requires ever-increasing amounts of storage in return for precious little extra functionality and a never-ending stream of patches.
Any decent compiler should strip out any extraneous characters, assuming the code is indeed being compiled beforehand and not interpreted at run-time.
- Office 2024 unveiled for Microsoft 365 refuseniks
- Saying goodbye to the tech dreams Microsoft abandoned with Windows 11 24H2
- Microsoft throws in the towel on HoloLens 2
- Microsoft hits go on Windows 11 24H2: Fresh features, bugs, and a whole lotta AI
For his part, Osterman is now a member of team spaces. "I like spaces simply because it always works and it's always consistent," he said.
The nightmare scenario is where developers have mixed tabs and spaces in the same source code file, creating a mess that has the potential to be indecipherable by whoever has to maintain it in the future.
The argument is set to rumble on, even as fights break out over using Rust or C in Linux. Then there is the near-religious fervor with which developers debate the benefits of vi versus Emacs.
Ultimately, Osterman's recommendation is sound: whatever a developer's preference, the most important thing is not to mix the two approaches.
We'd add that any organization worth working for will have coding standards that should put the matter to rest one way or the other.
Otherwise, if you want to fill your source code with spaces, plenty of companies are more than happy to sell you some extra cloud capacity for all those extra characters. Osterman, no doubt, can probably name at least one. ®