Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I would be more sympathetic to 80 column limits if Linux didn't have indent set to 8 columns.


This was a solved problem with tab indenting. It's a bit unfortunate that space indenting won, but I understand why.


What do you mean? Linux uses tabs.


Winning doesn't mean completely extinguishing the competition.


Not really a solved problem. Even if you set your editor to display 1 tab as 2 columns, another person may set their editor to display 1 tab as >2 columns. So even using tabs, a project has to set rules for tab width.


Why would that be a problem? That's the point, that you can set tab width any way you want.


The argument is that the line length limit has to be related to some default indentation length, which in Linux's case is 8 spaces.


This is always the argument against tabs, but it makes no sense. So what?

If you don’t like your tab width, CHANGE IT. That’s a huge win over spaces, where indentation is hard-coded.


I somehow forgot to add the essential part of my comment. Sorry, here it is:

If someone prefers a narrow tab width and breaks lines based on that, then someone who prefers a wide tab width will get overfull lines:

    20 column limit, 2-column tabs:
    if (a==b) {         |
      if (b==c) {       |
        some_function();|

    20 column limit, 4-column tabs:
    if (a==b) {         |
        if (b==c) {     |
            some_functio| <- overfull line
Either way, the project has to set some sort of official tab width. Or at least, a maximum tab width.


If you nest code that deep, you probably should extract some logic into separate functions.

I remember Linus saying that explicitly.




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

Search: