Hacker News new | past | comments | ask | show | jobs | submit login

Go uses tabs. That's the law. It's in the documentation.

Groups of spaces and tabs are semantically different. Tabs mean indentation. Spaces mean spaces.




My apologies, thank you for the clarification.


Spaces are tolerated, but the usage of tabs is very encouraged.


>Tabs mean indentation.

Sorry but this is false. The only thing a tab means, is tab.

Please provide your reasoning for the down voting. Thank you.


The dictionary in front of me disagrees:

"A key on a computer keyboard that, when pressed, inserts a special ASCII character used for formatting text, as in indenting a line or block of text."

Actually going back it means tabulation which was an early form of alignment of tables on typewriters. The tab key advanced the carriage to the next tabulation point. It was repurposed as a way of indenting code later and it has become an additional definition of that fact.

(I'm old enough to have owned a typewriter, a nice Selectric one as well ;-)


We are talking about computer semantics which exist in a discretized world, not english language semantics. By your logic, the word integer would be any number not a fraction or decimal down to negative infinity up unto positive infinity. There is no concept of infinity on a computer.

Anyways, that's besides the point, and I think you missed the meaning behind my comment.

The reason why a tab space cannot semantically mean indentation in our world, is because nobody can agree on what that indentation should be. Since you are old enough to have owned a typewriter, maybe you are old enough to remember that by legacy, a tab was equivalent to exactly 8 spaces, and much of our software that runs the internet makes that assumption. Now however, people are saying "use tab to mean indent and everyone can have their way" To quote mikko, "There is no style guide or coding conventions saying that the tab character should be the indent. This assumption is easy to make because it allows you to stick your head into the sand, ignore the surrounding world and by singing “let the users pick their own tab width” mantra."

Again, this wasn't to start a tab vs spaces war for go, and why go chose tabs. It's fine to make a choice, but it was your second statement that provoked my comment.


I get what you mean but a tab is purposely meaningless and unqualified.

It means 1 indent, not 8 spaces, 3 bananas or one tree. It is a unit. How the user displays that is up to them.


This. Absolutely this.

I used to hate tabs and want 2 spaces only, until I started working with other developers. Then suddenly tabs made sense, especially when you've got IDEs coercing every edited file to a person's indentation standard. Standardize on the tab and the pain goes away.


> There is no concept of infinity on a computer.

Sure there is: http://en.wikipedia.org/wiki/IEEE_754-1985#Positive_and_nega...


Ok sorry. There is no true representation of infinity.


...or Scotsmen.


Semantics is contingent upon meaning. Meaning varies and changes. Meaning is defined over time. That's the case with most words. In formatting text, it's as semantic to say that tabs are for "tabulation" and "indentation" as much as spaces are for "space" and "spacing characters." Tabs have always been semantically better as indentation in computing.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: