I think that could work well as long as you never had to think about what you were doing. In other words, if your editor understood the code and the scheme and sorted it all out for you regardless of whether you actually typed tabs or spaces. Otherwise you're almost certain to be inconsistent, and it's baseball time.
Yes, that's what I meant, but I also don't think it would work in real life. People wouldn't stay consistent with where they put tabs and spaces and so you'd end up with something that looked fine in one editor and terrible in another. In other words, the "both" situation for which someone would justifiably be beaten with fists, bats, or 2x4s, according to availability.
I like the idea Whitespace. Has anybody written code that does one thing when compiled with Java, and something else when compiled with Whitespace? Two interwoven programs in one file. It'd be like a Bach toccata!
I like the idea Whitespace. Has anybody written code that does one thing when compiled with Java, and something else when compiled with Whitespace? Two interwoven programs in one file. It'd be like a Bach toccata!
If you look at this wiki page it contains links to example programs that are valid in multiple languages and produce the same output in all the languages. Some of the examples use Whitespace.
When my primary data storage facility was floppy disks holding maybe 88KB or so, I was a big believer in tabs. I use a LOT of whitespace in my code (steganograph THAT, sucker!).
However, these days, using tabs merely as a primitive form of compression is pointless. We have disk drives approaching the multi-terabyte range on ordinary home computers.
More seriously, God intended tabs to be located at stop points 8 characters apart. A decently-indented listing or XML file in most languages needs to be printed on half-meter wide paper to avoid ugly wrapping of text if your tabs are that wide. I prefer my indents more on the order of 3-4 characters width.
Then there's the whole Python thing...
Customer surveys are for companies who didn't pay proper attention to begin with.
Mark Ross
Greenhorn
Joined: Jul 02, 2012
Posts: 2
posted
1
Ok, I read through the whole discussion before weighing in. I use spaces exclusively and I set every editor I use to insert spaces for tabs. But, wait, there's more!
None of this will do my code one damned bit of good if I don't use a fixed width font for my code. Now, I'm sure this is all pretty basic to most of you, but I've run into programmers using proportional fonts in their editors and the only way they could get decent alignment was by exclusively using (ugh) tabs. I'm an old man and most of them were irritated when I explained their errors.
So, yes, use spaces AND fixed width fonts (yes, I know the font generally isn't stored with the code).
Definitely spaces (with the IDE putting spaces in if I hit the tab key), for all the reasons already given, plus I'm learning Python, which also spares me all those arguments about curly braces on the same/next line after an if statement!
Anyway, tabs are a fossil relic of the days of typewriters, when it made no difference to your finished document how you got those spaces in there.