pwshub.com

Microsoft veteran engineer has his say on tabs versus spaces

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. ®

Source: theregister.com

Related stories
2 weeks ago - Kubernetes whizz says devs can redefine their roles and capitalize on coding ML rewards Interview Software industry veteran and developer advocate Kelsey Hightower, well known for his contributions to the Kubernetes community, has an...
1 month ago - There can be only one … annoying management technique Veteran Microsoft engineer Raymond Chen has penned a blog that gives further insight into the inner workings of the software titan under Bill Gates's leadership.…
1 month ago - Community seems to C Rust more as a burden than a benefit Efforts to add Rust code to the Linux kernel suffered a setback last Thursday when one of the maintainers of the Rust for Linux project stepped down – citing frustration with...
3 weeks ago - You pipsqueaks want memory safety? We'll show you memory safety! We'll borrow that borrow checker After two years of being beaten with the memory-safety stick, the C++ community has published a proposal to help developers write less...
1 month ago - From the best gaming consoles to gaming gear that makes playing a lot more enjoyable. Here are the best gamer gifts for your loved ones.
Other stories
43 minutes ago - Amazon's October Prime Day sale is finally here and the deals are coming in full force. Score great bargains on TVs, laptops, home essentials and so much more!
43 minutes ago - The nifty little Vibe Beam earbuds from JBL will give you waterproof sound for a small price.
43 minutes ago - The Lenovo Chromebook Duet 11 detachable two-in-one hasn't changed much over the years, which is why it continues to be one of the best laptop deals around.
43 minutes ago - Prime members can score this sleek, minimalist Hoto screwdriver for 33% off today.
43 minutes ago - With Prime Day here now, we've found the best deals on board games for your next game night with friends or family and even games for the kids.