Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.programming > #2605 > unrolled thread

indenting

Started bybob <bob@coolfone.comze.com>
First post2012-12-14 13:47 -0800
Last post2012-12-16 20:54 +0100
Articles 11 — 9 participants

Back to article view | Back to comp.programming


Contents

  indenting bob <bob@coolfone.comze.com> - 2012-12-14 13:47 -0800
    Re: indenting Ian Collins <ian-news@hotmail.com> - 2012-12-15 15:40 +1300
      Re: indenting "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> - 2012-12-15 09:10 +0100
        Re: indenting Robert Wessel <robertwessel2@yahoo.com> - 2012-12-15 04:10 -0600
        Re: indenting "Chris Uppal" <chris.uppal@metagnostic.REMOVE-THIS.org> - 2012-12-15 11:17 +0000
        Re: indenting Rui Maciel <rui.maciel@gmail.com> - 2012-12-15 12:16 +0000
          Re: indenting "Chris Uppal" <chris.uppal@metagnostic.REMOVE-THIS.org> - 2012-12-15 12:29 +0000
            Re: indenting Ian Collins <ian-news@hotmail.com> - 2012-12-16 08:29 +1300
    Re: indenting rossum <rossum48@coldmail.com> - 2012-12-15 13:23 +0000
    Re: indenting treetaxi <noreply@treetaxi.invalid> - 2012-12-15 19:28 -0700
      Re: indenting Thomas Mlynarczyk <thomas@mlynarczyk-webdesign.de> - 2012-12-16 20:54 +0100

#2605 — indenting

Frombob <bob@coolfone.comze.com>
Date2012-12-14 13:47 -0800
Subjectindenting
Message-ID<cb97085e-252e-41d6-94ff-6dfb86d80085@googlegroups.com>
Is it better to use tabs or spaces when indenting code?

[toc] | [next] | [standalone]


#2607

FromIan Collins <ian-news@hotmail.com>
Date2012-12-15 15:40 +1300
Message-ID<aj268hFjn61U5@mid.individual.net>
In reply to#2605
bob wrote:
> Is it better to use tabs or spaces when indenting code?

Is it better to buy a blue or a red car?

Those who prefer blue will give you one answer, those who prefer red 
another.

-- 
Ian Collins

[toc] | [prev] | [next] | [standalone]


#2608

From"Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Date2012-12-15 09:10 +0100
Message-ID<4wgclhdxxtw6$.k6vk8kdw6582$.dlg@40tude.net>
In reply to#2607
On Sat, 15 Dec 2012 15:40:17 +1300, Ian Collins wrote:

> bob wrote:
>> Is it better to use tabs or spaces when indenting code?
> 
> Is it better to buy a blue or a red car?
> 
> Those who prefer blue will give you one answer, those who prefer red 
> another.

Well, there is one argument against tabs. ASCII HT is 8 spaces wide, which
far too much. This tempts people to change the tab width in the IDE from
the ASCII standard to 2, 3, 4, whatever, keeping HT in the source. This
opens gates of hell.

-- 
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de

[toc] | [prev] | [next] | [standalone]


#2609

FromRobert Wessel <robertwessel2@yahoo.com>
Date2012-12-15 04:10 -0600
Message-ID<m0joc8tcud71vhp24492gf0ak06dpnu615@4ax.com>
In reply to#2608
On Sat, 15 Dec 2012 09:10:16 +0100, "Dmitry A. Kazakov"
<mailbox@dmitry-kazakov.de> wrote:

>On Sat, 15 Dec 2012 15:40:17 +1300, Ian Collins wrote:
>
>> bob wrote:
>>> Is it better to use tabs or spaces when indenting code?
>> 
>> Is it better to buy a blue or a red car?
>> 
>> Those who prefer blue will give you one answer, those who prefer red 
>> another.
>
>Well, there is one argument against tabs. ASCII HT is 8 spaces wide, which
>far too much. This tempts people to change the tab width in the IDE from
>the ASCII standard to 2, 3, 4, whatever, keeping HT in the source. This
>opens gates of hell.


Fixed tab stops every eight positions is not specified by ASCII,
although it is a very common convention.

[toc] | [prev] | [next] | [standalone]


#2610

From"Chris Uppal" <chris.uppal@metagnostic.REMOVE-THIS.org>
Date2012-12-15 11:17 +0000
Message-ID<ItedndvRLM86wVHNnZ2dnUVZ8rudnZ2d@bt.com>
In reply to#2608
Dmitry A. Kazakov wrote:

> Well, there is one argument against tabs. ASCII HT is 8 spaces wide, which
> far too much. This tempts people to change the tab width in the IDE from
> the ASCII standard to 2, 3, 4, whatever, keeping HT in the source. This
> opens gates of hell.

No, that's just Hell's catflap.

Where it goes tits-up is when people mix tabbed and spaced indentation -- then 
that hits absolute bottom when people used spaced indentation to match, say, 
what they see as 4-space tabs, and someone else uses spaced indentation to 
match what /they/ see as 2-spaced tabs.

My advice to the OP.  Use spaces or tabls exclusively: never mix.  If someone 
else mixes, then shoot them.  Do not attempt to warn them first, just blaze 
away...

    -- chris 

[toc] | [prev] | [next] | [standalone]


#2611

FromRui Maciel <rui.maciel@gmail.com>
Date2012-12-15 12:16 +0000
Message-ID<kahpmo$ia8$1@dont-email.me>
In reply to#2608
Dmitry A. Kazakov wrote:

> Well, there is one argument against tabs. ASCII HT is 8 spaces wide, which
> far too much. This tempts people to change the tab width in the IDE from
> the ASCII standard to 2, 3, 4, whatever, keeping HT in the source. This
> opens gates of hell.

The tab character is interpreted however the text editor is configured to 
interpret it, and you will be hard pressed to find an IDE that doesn't let 
the user configure how tabs are interpreted.  

It's possible some underdeveloped text editors don't let the users configure 
how tabs are handled, but that would be the exception instead of the norm, 
and a waking call to look for an upgrade.


Rui Maciel

[toc] | [prev] | [next] | [standalone]


#2612

From"Chris Uppal" <chris.uppal@metagnostic.REMOVE-THIS.org>
Date2012-12-15 12:29 +0000
Message-ID<5LKdnTXiKZCW8FHNnZ2dnUVZ7sWdnZ2d@bt.com>
In reply to#2611
Rui Maciel wrote:

> The tab character is interpreted however the text editor is configured to
> interpret it

Or the terminal.

(If you can remember terminals ;-)

    -- chris


[toc] | [prev] | [next] | [standalone]


#2614

FromIan Collins <ian-news@hotmail.com>
Date2012-12-16 08:29 +1300
Message-ID<aj41c9Fjn62U1@mid.individual.net>
In reply to#2612
Chris Uppal wrote:
> Rui Maciel wrote:
>
>> The tab character is interpreted however the text editor is configured to
>> interpret it
>
> Or the terminal.
>
> (If you can remember terminals ;-)

Or the printer....

-- 
Ian Collins

[toc] | [prev] | [next] | [standalone]


#2613

Fromrossum <rossum48@coldmail.com>
Date2012-12-15 13:23 +0000
Message-ID<qauoc8lno08jmjnp3jrctma5d7g9g5k67c@4ax.com>
In reply to#2605
On Fri, 14 Dec 2012 13:47:42 -0800 (PST), bob <bob@coolfone.comze.com>
wrote:

>Is it better to use tabs or spaces when indenting code?
For yourself, use whatever you prefer.  For exporting code to other
places either use whatever is specified by the destination.  If
nothing is specified, then use spaces since they will look the same
everywhere.  Tabs will look different depending on what setting is
used for tab width.

$0.02

rossum

[toc] | [prev] | [next] | [standalone]


#2615

Fromtreetaxi <noreply@treetaxi.invalid>
Date2012-12-15 19:28 -0700
Message-ID<kajbkh$9d$1@dont-email.me>
In reply to#2605
On 12/14/2012 02:47 PM, bob wrote:
> Is it better to use tabs or spaces when indenting code?
Yes.  Dashes, asterisks, and greater-than's can confuse the compiler.

[toc] | [prev] | [next] | [standalone]


#2617

FromThomas Mlynarczyk <thomas@mlynarczyk-webdesign.de>
Date2012-12-16 20:54 +0100
Message-ID<kal8ua$l32$1@news.albasani.net>
In reply to#2615
treetaxi schrieb:
> On 12/14/2012 02:47 PM, bob wrote:
>> Is it better to use tabs or spaces when indenting code?
> Yes.  Dashes, asterisks, and greater-than's can confuse the compiler.

Maybe the OP should have written "tabs XOR spaces". Then the correct 
answer would have been "Yes".

Greetings,
Thomas

-- 
Ce n'est pas parce qu'ils sont nombreux à avoir tort qu'ils ont raison!
(Coluche)

[toc] | [prev] | [standalone]


Back to top | Article view | comp.programming


csiph-web