BigLep/ChuckanutBayFoodsInternal — comment on commit 076fd524cba98ddfd73928c5a265d9ed1bd4ebee
File: src/com/chuckanutbay/webapp/timeclock/client/ClockInCancelationPanel.java line 32
By BigLep:

Hi Mitch,

Command+I applies your indentation preferences (converting tabs to spaces, or vice versa - whatever you've specified).

Yes, the key is to be consistent. Where tabs break down is when you try to align things beyond the first indentation. Sometimes you may want to do

function(Object arg1,
Object arg2,
Object arg3)

This is impossible to do with tabs as how a tab is interpretted on each system is variable (I may have tabs set to be displayed as 4 spaces, you may have it as 8).

Until this year, I was always a fan of mixing tabs and spaces (tab for the initial indentation, and space after everything else). This works for someone who notices little details like me, but in practice have found most others are not that attentive (which is fine - it's not worth the time correcting people on). Using all spaces is the common denominator so that all parties can be happy.

Let me know if you have more questions about this, but hope the above makes sense.

Steve

On Jan 7, 2012, at 5:41 PM, Mitchell Loeppky wrote:

> So what does command-I do in eclipse? Does it see that I use tabs and then
> make it consistent? If I used spaces would comd-I convert everything to
> tabs?
>
> In article 1 it says that the key is just to be consistent so what is the
> point in changing to spaces. This particular piece of code was mostly
> copied from a GWT example and therefore inconsistent.
> On Jan 7, 2012 5:21 PM, "Steve Loeppky" <
> reply@reply.github.com>
> wrote:
>
>> Pros:
>> It enables someone to have more control on how their code is
>> displayed. You may like tabs 4 spaces wide, and I may like it 3. By using
>> tabs for the initial indent, we get an abstraction to be able to configure
>> this.
>>
>> Cons:
>> A programmer has to be more conscious of what they're doing to
>> determine whether they should be tabbing, or spacing. Jeff Atwood believes
>> it combines all the complexity and pitfalls of both approaches.
>> In practice, haven't found the necessary attentiveness for this
>> being present by default.
>>
>> Relevant articles:
>>
>> http://www.codinghorror.com/blog/2009/04/death-to-the-space-infidels.html
>> http://blogs.msdn.com/b/cyrusn/archive/2004/09/14/229474.aspx
>>
>> ---
>> Reply to this email directly or view it on GitHub:
>>
>> https://github.com/BigLep/ChuckanutBayFoodsInternal/commit/076fd524cba98ddfd73928c5a265d9ed1bd4ebee#commitcomment-846963
>>
>
> ---
> Reply to this email directly or view it on GitHub:
> https://github.com/BigLep/ChuckanutBayFoodsInternal/commit/076fd524cba98ddfd73928c5a265d9ed1bd4ebee#commitcomment-846979