Pages: [1] 2
  Print  
Author Topic: TGMG - A word...  (Read 2860 times)
Offline (Unknown gender) freezway
Posted on: October 18, 2010, 09:17:39 PM

Member
Joined: Dec 2009
Posts: 220

View Profile
Dear TGMG,

USE SPACES! NO ONE LIKES TABS!
Logged
if you drop a cat with buttered toast strapped to its back, which side lands down?
joshdreamland: our languages are based on the idea that it's going to end up FUBAR
/kick retep998
Offline (Female) serprex
Reply #1 Posted on: October 19, 2010, 08:15:32 AM
Smooth ER
Developer
Joined: Apr 2008
Posts: 106

View Profile WWW
I like tabs
Logged
Offline (Male) Josh @ Dreamland
Reply #2 Posted on: October 19, 2010, 09:11:41 AM

Prince of all Goldfish
Developer
Location: Ohio, United States
Joined: Feb 2008
Posts: 2949

View Profile Email
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.
« Last Edit: October 19, 2010, 09:14:30 AM by Josh @ Dreamland » Logged
"That is the single most cryptic piece of code I have ever seen." -Master PobbleWobble
"I disapprove of what you say, but I will defend to the death your right to say it." -Evelyn Beatrice Hall, Friends of Voltaire
Offline (Female) IsmAvatar
Reply #3 Posted on: October 19, 2010, 11:39:22 AM

LateralGM Developer
LGM Developer
Location: Pennsylvania/USA
Joined: Apr 2008
Posts: 891

View Profile Email
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?!
...
Logged
Offline (Male) Josh @ Dreamland
Reply #4 Posted on: October 19, 2010, 12:18:26 PM

Prince of all Goldfish
Developer
Location: Ohio, United States
Joined: Feb 2008
Posts: 2949

View Profile Email
...okay.


:P
Logged
"That is the single most cryptic piece of code I have ever seen." -Master PobbleWobble
"I disapprove of what you say, but I will defend to the death your right to say it." -Evelyn Beatrice Hall, Friends of Voltaire
Offline (Male) RetroX
Reply #5 Posted on: October 19, 2010, 02:30:06 PM

Master of all things Linux
Contributor
Location: US
Joined: Apr 2008
Posts: 1055
MSN Messenger - classixretrox@gmail.com
View Profile Email
I like stripped blanks.

Just click the line, backspace, then enter.
Logged
My Box: Phenom II 3.4GHz X4 | ASUS ATI RadeonHD 5770, 1GB GDDR5 RAM | 1x4GB DDR3 SRAM | Arch Linux, x86_64 (Cube) / Windows 7 x64 (Blob)
Quote from: Fede-lasse
Why do all the pro-Microsoft people have troll avatars? :(
Offline (Unknown gender) luiscubal
Reply #6 Posted on: October 19, 2010, 03:10:39 PM
Member
Joined: Jun 2009
Posts: 452

View Profile Email
Tabs are AWESOME for consistency.
The only thing that sucks is inconsistent combination of tabs and spaces.
Logged
Offline (Male) Josh @ Dreamland
Reply #7 Posted on: October 19, 2010, 03:18:43 PM

Prince of all Goldfish
Developer
Location: Ohio, United States
Joined: Feb 2008
Posts: 2949

View Profile Email
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.
Logged
"That is the single most cryptic piece of code I have ever seen." -Master PobbleWobble
"I disapprove of what you say, but I will defend to the death your right to say it." -Evelyn Beatrice Hall, Friends of Voltaire
Offline (Male) Rusky
Reply #8 Posted on: October 19, 2010, 06:01:34 PM

Resident Troll
Joined: Feb 2008
Posts: 961
MSN Messenger - rpjohnst@gmail.com
View Profile WWW Email
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.
Logged
Offline (Unknown gender) freezway
Reply #9 Posted on: October 19, 2010, 11:31:18 PM

Member
Joined: Dec 2009
Posts: 220

View Profile

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;}
Logged
if you drop a cat with buttered toast strapped to its back, which side lands down?
joshdreamland: our languages are based on the idea that it's going to end up FUBAR
/kick retep998
Offline (Unknown gender) TGMG
Reply #10 Posted on: October 22, 2010, 01:21:42 PM

Developer
Joined: Jun 2008
Posts: 107

View Profile WWW Email
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.
Logged
me
GMbed 2.0 :: Embed you gm games in websites.
Offline (Unknown gender) freezway
Reply #11 Posted on: October 22, 2010, 05:39:57 PM

Member
Joined: Dec 2009
Posts: 220

View Profile
its annoying to bet things to line up. Can't Xcode use spaces?
Logged
if you drop a cat with buttered toast strapped to its back, which side lands down?
joshdreamland: our languages are based on the idea that it's going to end up FUBAR
/kick retep998
Post made October 24, 2010, 11:11:30 AM was deleted at the author's request.
Offline (Unknown gender) luiscubal
Reply #13 Posted on: October 24, 2010, 03:46:34 PM
Member
Joined: Jun 2009
Posts: 452

View Profile Email
Can't you guys just run some kind of automated script to replace tabs with spaces? Perhaps some SVN plugin?
Logged
Offline (Male) RetroX
Reply #14 Posted on: October 24, 2010, 08:30:47 PM

Master of all things Linux
Contributor
Location: US
Joined: Apr 2008
Posts: 1055
MSN Messenger - classixretrox@gmail.com
View Profile Email
Can't you guys just run some kind of automated script to replace tabs with spaces? Perhaps some SVN plugin?
expand -t 2 file
Logged
My Box: Phenom II 3.4GHz X4 | ASUS ATI RadeonHD 5770, 1GB GDDR5 RAM | 1x4GB DDR3 SRAM | Arch Linux, x86_64 (Cube) / Windows 7 x64 (Blob)
Quote from: Fede-lasse
Why do all the pro-Microsoft people have troll avatars? :(
Pages: [1] 2
  Print