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.