ENIGMA Forums

General fluff => General ENIGMA => Topic started by: freezway on October 18, 2010, 09:17:39 pm

Title: TGMG - A word...
Post by: freezway on October 18, 2010, 09:17:39 pm
Dear TGMG,

USE SPACES! NO ONE LIKES TABS!
Title: Re: TGMG - A word...
Post by: serprex on October 19, 2010, 08:15:32 am
I like tabs
Title: Re: TGMG - A word...
Post by: Josh @ Dreamland on October 19, 2010, 09:11:41 am
I like consistency, and tabs don't offer that. Wherever I open my code, I want it to look the same.
Code: (C++) [Select]
{
  float a = 0,
        b = 1;
I don't like going out of my way to make it [tab]float...[tab][space][space][space][space][space]b...
I like pressing tab two or three times, then just backspacing to where it lines up.

I also like leaving indentation on blank lines. That way, I just click where I want to insert, and press enter. But no, damn IDEs keep stripping trailing blanks.

Anyway, iirc tabs are illegal in YAML, Firefox strips them from non-first-char pastes, replacing them with spaces.... they're a dying breed.
Title: Re: TGMG - A word...
Post by: IsmAvatar on October 19, 2010, 11:39:22 am
Tabs are illegal for indentation in YAML. They are legal, however, in string literals.
For example, the following is valid:
Code: [Select]
---
description: |
 What<tab>now?!
...
Title: Re: TGMG - A word...
Post by: Josh @ Dreamland on October 19, 2010, 12:18:26 pm
...okay.


:P
Title: Re: TGMG - A word...
Post by: RetroX on October 19, 2010, 02:30:06 pm
I like stripped blanks.

Just click the line, backspace, then enter.
Title: Re: TGMG - A word...
Post by: luiscubal on October 19, 2010, 03:10:39 pm
Tabs are AWESOME for consistency.
The only thing that sucks is inconsistent combination of tabs and spaces.
Title: Re: TGMG - A word...
Post by: Josh @ Dreamland on October 19, 2010, 03:18:43 pm
Which is the only way to consistently pull of the code I posted above. Otherwise, the b could be misaligned with the a for everyone not using a tab width of 2, or whatever.
Title: Re: TGMG - A word...
Post by: Rusky on October 19, 2010, 06:01:34 pm
Which is why you don't use arbitrarily-indented blocks. It works for every case but that one which gets a little ugly:
Code: [Select]
float
a = 0,
b = 1;

Where it does work:
Code: [Select]
name = function(
foo, bar,
baz, quux
);
for (
initializer;
condition;
update;
) {
stuff;
}
name = {
initializer,
list
};
Constructor::Constructor(
arguments
) : initializer(foo), list(bar) {
stuff;
}
Constructor::Constructor(
arguments
) :
initializer(foo),
list(bar) {
stuff;
}
...and so on, with tweaks for your style preferences.
Title: Re: TGMG - A word...
Post by: freezway on October 19, 2010, 11:31:18 pm

I also like leaving indentation on blank lines. That way, I just click where I want to insert, and press enter. But no, damn IDEs keep stripping trailing blanks.

YES! can't stand

Code: [Select]
int blah(int foo) {
    bar;}
Title: Re: TGMG - A word...
Post by: TGMG on October 22, 2010, 01:21:42 pm
I just use xcodes formatting which uses tabs, it automatically does it when I press newline and the formatting tools such as reindent use it to and tbh its a habit. Why is it such a big deal? Iv'e never had a problem using tabs, and it will be kinda hard to remember where i have used tabs and where i have used spaces.
Title: Re: TGMG - A word...
Post by: freezway on October 22, 2010, 05:39:57 pm
its annoying to bet things to line up. Can't Xcode use spaces?
Title: Re: TGMG - A word...
Post by: Fede-lasse on October 24, 2010, 11:11:30 am
No tabs.
Title: Re: TGMG - A word...
Post by: luiscubal on October 24, 2010, 03:46:34 pm
Can't you guys just run some kind of automated script to replace tabs with spaces? Perhaps some SVN plugin?
Title: Re: TGMG - A word...
Post by: RetroX on October 24, 2010, 08:30:47 pm
Can't you guys just run some kind of automated script to replace tabs with spaces? Perhaps some SVN plugin?
expand -t 2 file
Title: Re: TGMG - A word...
Post by: freezway on October 24, 2010, 09:45:54 pm
i like 4, not 2, maybe thats just me....
Title: Re: TGMG - A word...
Post by: TGMG on October 25, 2010, 04:41:10 am
I have changed some settings around in xcode so hopefully that should help.
Title: Re: TGMG - A word...
Post by: Fede-lasse on October 25, 2010, 06:39:03 am
Hot.