Re: On Tabs and Spaces
- From
- Luke Lu <git@vicaya.com>
- Date
- Oct 17, 2007, 10:03 UTC
- Message-ID
- <A73C6BE2-F990-4634-B996-02CB9B129155@vicaya.com>
- In-Reply-To
- <E29971BA-7306-4570-8383-26D0C9C0B814@mit.edu>
On Oct 17, 2007, at 2:09 AM, Michael Witten wrote:
Show 25 quoted lines
>
> On 17 Oct 2007, at 3:17:08 AM, Luke Lu wrote:
>
>> But I still haven't seen any compelling arguments against the "all
>> space" case
>
> Overhead!
>
> If you use 8 spaces instead of one tab,
> that's using up 7x more space!
>
> Consider:
>
> # calculates the extra space required to
> # use the given number of spaces/tab.
> size()
> {
> count=`grep -RIo "\`printf \"\t\"\`" . | wc -l`;
> perl -e "print $count*$(($1-1))/1024/1024 . \" MB\n\"";
> }
>
> Then in in a git working tree:
>
> size 8; # 1.28701210021973 MB
> size 4; # 0.551576614379883 MBFirst, the overhead is not a simple x4 or x8 conversion in size, but it's the upper bound. Given that, let's look at the percentage of the overhead: my git working tree is 56MB after gc, so the overhead is 2.3% max for size 8 and 0.98% for size 4. That's not significant at all.
Show 9 quoted lines
> > In a linux kernel working tree: > > size 8; # 61.4902725219727 MB > size 4; # 26.3529739379883 MB > > Conclusion: > > Yikes!
Now, compile the kernel, do a du in the tree and report back percentages of the overhead.
Disk is cheap (1GB costs less than half a dollar), people's productivity/time is not. The overhead argument is compelling, not!
__Luke