angular-cli icon indicating copy to clipboard operation
angular-cli copied to clipboard

Cannot change tabulation size

Open albanx opened this issue 10 years ago • 49 comments

Hi There Is there a way to set the tab size to 4 spaces instead of 2 of the new generated files?

Cheers Alban

albanx avatar Jun 30 '16 08:06 albanx

I think most of community is against that, because the tab characters has proven to be problematic in different platforms

What are the problems? I've never encountered an issue with tabs that wasn't a result of a developer misusing them. Not arguing; I'm genuinely curious what the issues are on other platforms.

Josh1billion avatar Feb 20 '17 18:02 Josh1billion

@josh, really? then you're too young... ex... format a code with tabs in your editor, open it on github or bitbucket it will break all formating (at least a tab will be spaced probably 10 spaces), you can have wired behaviuor on some command line editors. Space has consistency, 1 space is 1 space everywhere, tabs are not.

On Mon, Feb 20, 2017 at 7:55 PM, Josh [email protected] wrote:

I think most of community is against that, because the tab characters has proven to be problematic in different platforms

What are the problems? I've never encountered an issue with tabs that wasn't a result of a developer misusing them. Not arguing; I'm genuinely curious what the issues are on other platforms.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/angular/angular-cli/issues/1252#issuecomment-281156936, or mute the thread https://github.com/notifications/unsubscribe-auth/ABFAqOKh-hZq5PtujPvCIUAc32NhT7C7ks5reeGKgaJpZM4JB73x .

-- www.albanx.com www.realuploader.com

albanx avatar Feb 20 '17 18:02 albanx

really? then you're too young...

Quite a rude assumption. I've been programming for about 15 years, thanks.

open it on github or bitbucket it will break all formating (at least a tab will be spaced probably 10 spaces)

Right, by default, GitHub displays tabs larger than most (as 8 spaces, not 10). That's configurable to something sane like 4 or 2, just like any text editor is able to do. Does 8-space indentation make things harder to read? Yes, for me and I'm assuming for most people. But it doesn't "break all formatting" unless the author misused tabs. As long as the "tabs for indentation, spaces for alignment" mantra is followed, I've never seen a case where this was an issue.

Space has consistency, 1 space is 1 space everywhere, tabs are not.

Yes, and that's the issue with using spaces for indentation, not the advantage. You may prefer 2-space indentation, while I prefer 4-space indentation. With tabs for indentation, every developer gets to work on code in whichever style is most readable to them. If your code looks terrible when the indentation length varies, you're mixing up your indentation with your alignment, and that's your fault as a developer.

Josh1billion avatar Feb 20 '17 19:02 Josh1billion

Issues is you have to configure every editor to have the same tab length spaces not.

Any case I am not going to argue on this since it is not the topic of this conversation. If you're looking for flamewars go on stackoverlow you will find a lot of topics this.

On 20 Feb 2017 19:12, "Josh" [email protected] wrote:

really? then you're too young...

Quite a rude assumption. I've been programming for about 15 years, thanks.

open it on github or bitbucket it will break all formating (at least a tab will be spaced probably 10 spaces)

Right, by default, GitHub displays tabs larger than most (as 8 spaces, not 10). That's configurable to something sane like 4 or 2, just like any text editor is able to do. Does 8-space indentation make things harder to read? Yes, for me and I'm assuming for most people. But it doesn't "break all formatting" unless the author misused tabs. As long as the "tabs for indentation, spaces for alignment" mantra is followed, I've never seen a case where this was an issue.

Space has consistency, 1 space is 1 space everywhere, tabs are not.

Yes, and that's the issue with using spaces for indentation, not the advantage. You may prefer 2-space indentation, while I prefer 4-space indentation. With tabs for indentation, every developer gets to work on code in whichever style is most readable to them. If your code looks terrible when the indentation length varies, you're mixing up your indentation with your alignment, and that's your fault as a developer.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/angular/angular-cli/issues/1252#issuecomment-281160366, or mute the thread https://github.com/notifications/unsubscribe-auth/ABFAqHWZLVwnrQit_212PGF2GBytkb3zks5reeWTgaJpZM4JB73x .

albanx avatar Feb 20 '17 19:02 albanx

Issues is you have to configure every editor to have the same tab length spaces not.

No, you don't. There is no reason to do so. If you've read what I said or have enough experience to have experienced it firsthand, you'll know that it's unnecessary for developers to have matching indentation lengths, so long as they don't mix up indentation with alignment. That's the advantage of tabs.

Any case I am not going to argue on this since it is not the topic of this conversation. If you're looking for flamewars go on stackoverlow you will find a lot of topics this.

Who's looking for a flamewar? You opened the conversation with a dismissive insult after I asked for an example to back up your claim.

really? then you're too young...

Josh1billion avatar Feb 20 '17 19:02 Josh1billion

Please do not cry now... pardon me if you felt insulted... .

On Mon, 20 Feb 2017, 19:45 Josh, [email protected] wrote:

Issues is you have to configure every editor to have the same tab length spaces not.

No, you don't. There is no reason to do so. If you've read what I said or have enough experience to have experienced it firsthand, you'll know that it's unnecessary for developers to have matching indentation lengths, so long as they don't mix up indentation with alignment. That's the advantage of tabs.

Any case I am not going to argue on this since it is not the topic of this conversation. If you're looking for flamewars go on stackoverlow you will find a lot of topics this.

Who's looking for a flamewar? You opened the conversation with a dismissive insult after I asked for an example to back up your claim.

really? then you're too young...

—

You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/angular/angular-cli/issues/1252#issuecomment-281166542, or mute the thread https://github.com/notifications/unsubscribe-auth/ABFAqAJg1YE8XuxnP4HjdVdxqYjlbH_oks5ree1TgaJpZM4JB73x .

albanx avatar Feb 20 '17 19:02 albanx

Please do not cry now... pardon me if you felt insulted... .

Teenager confirmed. Let's continue this conversation when you're an adult with some real-world development experience. Until then, by all means, continue cargo cult developing with no understanding of the points you're arguing for and against. 😄

Josh1billion avatar Feb 20 '17 19:02 Josh1billion

@albanx and @Josh1billion please refer to our Code of Conduct and adhere to it during ALL interactions related to the Angular project. This thread has clearly reached the end of its useful life, and @filipesilva's answer isn't going to change in the forseeable future. Locking.

robwormald avatar Feb 20 '17 20:02 robwormald

This should be available soon-ish via automatically running TS Lint fixers on generators. This is being tracked in https://github.com/angular/angular-cli/issues/6272.

filipesilva avatar May 11 '17 11:05 filipesilva