Slashdot Mirror


Is the 80 Columns Limit Dead?

Dancing Primate asks: "Reading through the code of co-workers and various open source projects, I'm finding that people are no longer formatting their code to 80 columns. With most people using X and the wide range of non-vi editors, is the 80 column limitation disappearing? Am I the only one who gets grumpy when I do a diff or print code, and it's hard to read?"

317 comments

  1. U of Toronto by beyonddeath · · Score: 4, Interesting

    I know in a lot of my coding classes at U of T they required no more than 80 characters on a line, lest you get some hefty mark deductions. I dont stick to it for my stuff tho i usually limit it to when my screen starts scrolling to the right....

    1. Re:U of Toronto by saden1 · · Score: 2, Informative

      The current project I’m working on has set 120 columns as standard acceptable column width. This is of course the maximum characters you can print on an A4 paper in landscape layout.

      We have 21" monitors and should and high resolution these days so I see no reason to stick with 80 columns.

      --

      -----
      One is born into aristocracy, but mediocrity can only be achieved through hard work.
    2. Re:U of Toronto by Dan+Ost · · Score: 3, Interesting

      I generally limit my own code to 72 columns so that when I print 2 columns
      in landscape mode with line numbers, there is no wrapping and enough white
      space to the right of the code to make notes and such.

      One of my beefs with Java is that it seems impossible to write comfortable code
      in less than 120 columns.

      --

      *sigh* back to work...
    3. Re:U of Toronto by tverbeek · · Score: 1
      I see no reason to stick with 80 columns

      How about readability? Granted, 80 is completely arbitrary, but if you're in column 70something and you're still typing (and you're not coding in COBOL, in which case you get a free pass), your code is going to be difficult to read no matter how large your monitor is. Newspapers have real estate that makes a 21" monitor look cramped, but they still put their text in much narrower columns.

      One of the things my programming instructors nagged us about was the formatting of our code. e.g. You could put an entire "for" loop on a single line, but unless it's a really simple one, that'd make it harder to read.

      One of the things my graphic design instructros nagged us about was negative space. e.g. You could fill the entire page/screen, but that creates an atmosphere of clutter and chaos.

      80 columns may not be the law anymore, but it's still a good idea.

      --
      http://alternatives.rzero.com/
    4. Re:U of Toronto by Mr+Z · · Score: 1

      I personally prefer to have two or three tall, thin windows. I can't do that if the text is wider than 80 columns.

      For all my stuff I'm an 80-column bigot. If your line of code is that long, break it up into shorter segments. For instance, even chained "if" clauses can be wrapped onto multiple lines. It's much clearer that way, at least to me.

      There are times when wider-than-80 is appropriate. For instance, tabular data works well in a wide format. Typical code, however, rarely suffers at the hands of 80 columns.

      --Joe
    5. Re:U of Toronto by julesh · · Score: 2, Insightful

      One of my beefs with Java is that it seems impossible to write comfortable code
      in less than 120 columns.


      I see no reason why you should have a problem with that. I write Java in my job, and rarely exceed my editor window's default width, which is 94 columns. Are you using 8 column indents, by any chance?

    6. Re:U of Toronto by muyuubyou · · Score: 1

      94 is still a whole lot.

  2. huh? by reynaert · · Score: 2, Insightful

    Why would vi have any problem with long lines?

    1. Re:huh? by Rheingold · · Score: 3, Informative
      You obviously haven't used the stock vi in Solaris recently...
      Terminal too wide
      --
      Wil
      wiki
    2. Re:huh? by Anonymous Coward · · Score: 1, Funny

      And what's the problem? I use the stock vi in Solaris all the time and never get that error. Long lines wrap just like they are supposed to...

    3. Re:huh? by Anonymous Coward · · Score: 0

      I think most vi users run it in console. Most consoles are run at 80x25. Code past the 80th character and you can't see all the text or it might take a second line which clutters the display.

    4. Re:huh? by Anonymous Coward · · Score: 0
      Terminal too wide

      I use stock Solaris vi all the time (less and less). It's not limited to 80 characters. I'm pretty sure it never has been. There's a limit, but a quick test shows that is a little over 163. Do you really need line coded that long? If so, I hope I never have to program with you.

      Still, I'm getting pretty sick of stock Solaris for many utilities. As far as stock vi, being limited to one undo drives me nuts.

    5. Re:huh? by mooingyak · · Score: 1

      I use almost nothing but the stock vi in Solaris. I've never seen that error, but I have gotten 'Line too long', which seems to come up around 2k / line.

      --
      William of Ockham had no beard. The most likely explanation is that it was chewed off by squirrels every morning.
    6. Re:huh? by pyrrhonist · · Score: 4, Insightful
      Do you really need line coded that long?

      No, you don't understand. Imagine this:

      1. You log into a machine to check some logs.
      2. You adjust the screen size to read the long lines in the log files.
      3. You realize the you need to change a configuration file.
      4. You run vi to change the file, and it says, "Terminal too wide".
      5. You resize the terminal.
      6. You run vi to change the file, and it says, "Terminal too wide".
      7. You resize the terminal again.
      8. You run vi to change the file, and it says, "Terminal too wide".
      9. You resize the terminal again.
      10. You run vi to change the file, and it says, "Terminal too wide".
      11. You beat the every loving crap out of the Sun box.
      Why the fuck is there a hard limit?!? In summary, I installed vim.
      --
      Show me on the doll where his noodly appendage touched you.
    7. Re:huh? by Rheingold · · Score: 1

      Yes, 163/164 is the breaking point, now that you point it out, at least on Solaris 8. I don't actually code in a terminal that wide, but often when I'm doing sys admin work I maximize one of the terms to tail or view a log, which happens to be 165 characters wide on my laptop. I rarely return the window to it's original size immediately and open something to edit and *bam*, puke-city.

      --
      Wil
      wiki
    8. Re:huh? by Rheingold · · Score: 1

      Heh, I'm glad to see I'm not the only one then ;)

      --
      Wil
      wiki
    9. Re:huh? by Ricwot · · Score: 0

      good god, you were actually talking about vi, I assume when anyone says vi they really mean vim.

    10. Re:huh? by 0x0d0a · · Score: 0, Troll

      I think that all right-thinking people use emacs, not vi. That being said, what about fmt logfile >logfile-formatted?

    11. Re:huh? by Anonymous Coward · · Score: 0

      Well, I meet a lot of people, and I'm convinced that the vast majority of wrong-thinking people are right.

    12. Re:huh? by Gumshoe · · Score: 3, Insightful
      Why the fuck is there a hard limit?!? In summary, I installed vim.
      In my early UNIX sysadmin career when I was learning the ropes, I was admonished by my boss when he realised I was using vim instead of vi. His reasoning as far as I could gather was that vi is universal and vim isn't and that I might "learn bad habits" by using vim and "become unstuck" if I ever needed to config a machine that doesn't have vim installed.

      Even in my inexperienced youth I realised that there's a line in the sand between UNIX advocacy and clueless lunacy and that he had crossed it.
    13. Re:huh? by larien · · Score: 1

      Yes, they do, but if you maximise the xterm/dtterm window with a high enough resolution (1152x864 is sufficient, not sure of 1024x768), vi will complain on startup; actually, it just won't start.

    14. Re:huh? by pyrrhonist · · Score: 1
      I think that all right-thinking people use emacs, not vi.

      There's not a lot of room for emacs on an embedded system with a Momentum blade.

      That being said, what about fmt logfile >logfile-formatted?

      Well, that'd be fine, except the log file wasn't the issue. Fixing the config file was the problem.

      --
      Show me on the doll where his noodly appendage touched you.
    15. Re:huh? by smittyoneeach · · Score: 1

      Ah, these sand lines...blown about by the wind...

      --
      Get thee glass eyes, and, like a scurvy politician, seem to see things thou dost not.--King Lear
    16. Re:huh? by foobsr · · Score: 1

      Fixing the config file was the problem.

      ... sed 's/[^0-9]*\([0-9][.0-9]*\)[^0-9]*.*/\1/' ...

      :)

      Or s.th. .

      CC.

      --
      TaijiQuan (Huang, 5 loosenings)
    17. Re:huh? by Anonymous Coward · · Score: 0

      If he really said "become unstuck", he was probably a Kurt Vonnegut fan and hopefully joking.

    18. Re:huh? by oh · · Score: 1
      In my early UNIX sysadmin career when I was learning the ropes, I was admonished by my boss when he realised I was using vim instead of vi. His reasoning as far as I could gather was that vi is universal and vim isn't and that I might "learn bad habits" by using vim and "become unstuck" if I ever needed to config a machine that doesn't have vim installed.
      I don't see a problem using whatever editor you like, so long as you can remember enough ed commands to get by.

      And I'm dead serious.
      --
      Democracy isn't about no one telling you what to do. It's about everyone telling you what to do.
    19. Re:huh? by Tet · · Score: 1
      I think that all right-thinking people use emacs, not vi.

      That's funny. I think precisiely the opposite. Seriously. I wonder what disease of the brain convinces people that using emacs is a good idea. All right-thinking people use vi[1]. But that just goes to show how pointless holy wars like that are. People have different viewpoints. Just let them get on with it. If pepole want to cripple themselves by using emacs, who am I to try and stop them? :-)

      [1] Which makes for a nice soundbite, but isn't strictly true. Brian Kernighan is "right-thinking" by pretty much any definition, and his editor of choice is Rob Pike's sam . But he uses vi rather than emacs when sam isn't available. Thus my point is proved :-)

      --
      "The invisible and the non-existent look very much alike." -- Delos B. McKown
  3. I'm sorry... by flabbergast · · Score: 1

    but I really had no idea that you were supposed to limit to 80 characters. I skipped intro to cs as an undergrad (thanks AP Comp Sci), so I never had someone deduct points for not following this particular rule, and no one since has asked me about it.

    1. Re:I'm sorry... by 0x0d0a · · Score: 4, Informative

      The main reason for it is that (a) it lets people with default-width xterms and terminals read your code, and (b) it provides a reasonably universal standard to code around.

      80 col seems pretty unused in the Windows world, where most people use that godawful Visual Studio Editor, and conventions are to extend lines to infinity.

      80 col is common in the *IX world, where most folks doing a lot of coding are using emacs/xemacs or vi. Space-indented, 80 col code can be read by pretty much anyone and edited by anything, so it's a reasonably universal standard to base code on.

      Some projects deviate from this -- it's considered good open source etiquette to stick with the format already being used in the file that you're hacking on, instead of mixing things up.

      That being said, I rather like the idea of python's approach (where how the user chooses to view code, wrapped or scrolling, is independent of the storage format).

    2. Re:I'm sorry... by Triddle · · Score: 1

      As a contract programmer I have worked with a number of companies over the past decade on platforms such as MVS, UNIX, Windows, OS/2 and various embedded systems. Every one of those companies has had a rule that no line is to exceed 80 columns wide.

      However... when you actually look at the existing code in every one of those companies they are replete with lines that break the 80 column rule - and new code is no better.

      A similar issue arises with tabs vs spaces. I have worked for companies that require only tabs be used [with various tab widths], and companies that require tabs never be used, but when you check existing code it is *always* a mixture of tabs and spaces that sends the formatting to hell no matter how you view it.

      I guess those who think they are in charge set rules that satisfy their personal opinions, but the developers [particularly short term contractors] do whatevery they prefer anyway. It is a fact that in most cases the test of a job well done is the reliability and specification compliance of the finished code, not the formatting of the source. So much so, that the company I am with at present is the first to review my source since the early 90s.

      The multiparameter APIs in Windows, OS/2 etc don't help, and the casting that is forced upon us by these operating systems is as much to blame as programmers who refuse to adapt.

      My personal view is that setting an 80 column rule is a good idea in principle, but as systems become more complex it becomes harder to comply in a meaningful way (ie so the code is more readable, which is the point after all).

    3. Re:I'm sorry... by Anonymous Coward · · Score: 0
      Two of the last three places I've worked had check-in scripts that checked for both tabs (they said no tabs), and line length (80 chars). The one (very large) open-source project I submitted code to also flamed me immensly for not following their rules.

      "But as systems become more complex it becomes harder to comply in a meaningful way "

      Not really. As the system becomes large and complex, the source-control system is a convenient place to put a gatekeeper, be it automated or manual.

    4. Re:I'm sorry... by dfghjk · · Score: 1

      Mixing tabs and spaces doesn't screw anything up. What screws things up is people deciding that a tab means anything other than move to the next 8-column aligned stop. If the original definition were followed there would be no problem, but since programmers are lazy and want to use a single tab for indentions but not use 8 columns per stop (since it looks like shit) they break things. That's what screws up formatting. Of course, it's no big deal to write a filter that fixes tab/space issues on check-ins but all team members must agree on the definition of what a tab is. 8 columns is the correct one.

  4. 80 chars wide... by ophix · · Score: 1

    considering that i hardly ever am in a console session where i have only 80 characters accross.... no, i care not about 80 char alignment. even when i dont load up X, i still use the fb to get a decent sized console to work in. 80 chars is just too narrow for me these days

  5. 72 by EddieBurkett · · Score: 1

    I was taught to use a 72 character limit on an 80-wide window. I can't say I've looked much at other people's code lately for comparison.

    --
    The only thing I hate more than hypocrites are people who hate hypocrites.
    1. Re:72 by Dark$ide · · Score: 3, Interesting
      That was to allow for the sequence numbers on the cards in columns 73-80.

      We're still suffering from the days of card readers and punches.

      I've not punched a card since 1981. But I've edited lots of MVS (aka OS/390 aka z/OS) datasets that are fixed to 80 bytes (sequence in 73-80) by the architecture.

      --

      Sigs. We don't need no steenking sigs.

    2. Re:72 by jc42 · · Score: 1

      Hmmm ... I wonder what percent of the readers these days can tell you where both of these numbers came from. Probably a lot have read where the 80 came from, but the 72?

      (I have actually used IBM punch cards, and I still have a few souvenir cards hidden away in a drawer. ;-)

      Of course, this relic isn't nearly as amazing as the US railroad gauge. (Not to mention the myths about where it came from.)

      In any case, I'm frequently bemused by email and newsgroup messages that, in their multiple levels of quotes, show the effects of multiple line wraps at column 72. It's usually pretty easy to verify that that's what happened.

      --
      Those who do study history are doomed to stand helplessly by while everyone else repeats it.
    3. Re:72 by bolthole · · Score: 1

      more commonly nowadays, limiting text to 72 colums, is for email, so that you can QUOTE people, and have more than 1 level of nesting, yet still keep the result within 80 columns.

    4. Re:72 by Dan+Ost · · Score: 1

      There's another reason to use 72: if you're editing in an 80 column terminal
      and want line numbers displayed, you lose 8 columns to the numbering (at least
      in vi(m)).

      That's why I code to 72 when I can (pretty easy in C and Python...impossible
      in C++ or Java).

      --

      *sigh* back to work...
    5. Re:72 by joeljkp · · Score: 2, Informative

      Or if you write a lot of Fortran77 code (common in engineering).

      --
      WeRelate.org - wiki-based genealogy
    6. Re:72 by ffsnjb · · Score: 2, Interesting

      72 column is required in most COBOL environments I've worked in. *shudders*

      Actually, I should put COBOl experience on my resume, I could probably score a really badass job with that. All of the old COBOL hackers are dying. Someone has to port that legacy code eventually.

      --
      "Why do you consent to live in ignorance and fear?" - Bad Religion
    7. Re:72 by yuri+benjamin · · Score: 1

      Usenet - same reason as email - multi-level nesting.

      --
      You make the mistake of thinking you can educate the fundamental stupidity out of people. You can't.
  6. yes it does by jeffy124 · · Score: 2, Insightful

    when printing a monospace 12 point font on a piece of paper.

    --
    The One Rule Of Chess You'll Ever Need: Don't play someone who carries a kit in their bookbag.
    1. Re:yes it does by keramida · · Score: 1
      when printing a monospace 12 point font on a piece of paper.

      Well, since you mentioned 12 points, this is too large for my taste. I usually use something around 8-9pt for printed code. But you're right it's still nice to be able to read code without semi-random wraparounds that make the rest of the page look like a mess.

      --
      My other computer runs FreeBSD too.
    2. Re:yes it does by Frizzle+Fry · · Score: 1

      Why are you printing code in 12 point font?! You can buy reading glasses in any pharmacy/ convenience store for a few bucks, btw.

      --
      I'd rather be lucky than good.
    3. Re:yes it does by Mr.+Slippery · · Score: 3, Insightful
      Why are you printing code in 12 point font?! You can buy reading glasses in any pharmacy/ convenience store for a few bucks, btw.

      If you print and display at a decent size, you won't end up needing reading glasses...

      Don't strain your eyes - you only get one pair.

      --
      Tom Swiss | the infamous tms | my blog
      You cannot wash away blood with blood
    4. Re:yes it does by pclminion · · Score: 1
      How does point size have anything to do with eye strain? The paper is still the same distance away from your face regardless of the size of the letters on the paper. Your eyes focus the same in either case.

      I thought we'd moved beyond the medieval superstition that looking at certain kinds of things can damage your eyes...

    5. Re:yes it does by Mr.+Slippery · · Score: 1
      The paper is still the same distance away from your face regardless of the size of the letters on the paper.

      Um, most of us move closer to read smaller print.

      --
      Tom Swiss | the infamous tms | my blog
      You cannot wash away blood with blood
  7. Framebuffer by Ricwot · · Score: 1

    sing the framebuffer thingy I get a 1280x1024 command line, so I get miles of columns for code. surely now this can be used instead of crazy vt100 or whatever

  8. The Way of the World by Jason+Scott · · Score: 4, Informative

    As the administrator of TEXTFILES.COM, I can attest that it is certainly the case that modern writers who submit me works for the uploads section generally pay little or no attention to formatting along any given column length. Keep in mind that I always ask for these submissions in ASCII form, so this isn't the result of converting over from Word or StarOffice.

    I think the reason I get files like this one is that people just let notepad and similar programs do the wrap for them. The fact that web browsers don't always wrap means you get some pretty funky looks.

    This is not 100 percent true, of course: I've gotten submissions just this year that keep to the 80 column limit and include formatting taking advantage of it.

    But on the whole, I think it's just that people no longer think of the world as sized in 80 columns, and we might as well understand that's the case. My heart will always be for the way it used to be, of course.

    1. Re:The Way of the World by AltaMannen · · Score: 2, Insightful

      As far as text documents go I find text to be easier to read when people don't assume a certain display width. I commonly have several applications open and very little screen space left for my notepad text window.

      I think people replying to emails with a cutoff of 40-80 characters can be really difficult to read since I usually use a large window to read their emails and that sometimes leaves a whole 2/3rds of the window blank.

      Source code should have reasonable but flexible limits. A width of 80 sounds low but as long as the code is readable on a modern monitor I don't find any problems with it. When you start indenting with spaces instead of tabs just to keep within 80 or 72 characters width then it just gets ridiculous.

    2. Re:The Way of the World by .@. · · Score: 0, Flamebait

      Look: If you want to whinge about people using 40-80 character lines, then there's nothing stopping you from CONCATENATING THE LINES AT YOUR END.

      You folks seem to want to say that all us 80-column adherents should use autowrapping editors and viewers. Why can't you be arsed to auto-concat lines to whatever length you want, instead?

      Feh.

      --
      .@.
    3. Re:The Way of the World by eraserewind · · Score: 2, Informative

      Auto-concat is not guarenteed to be correct, how can a system know which lines definitely should be joined? It can only guess by using some arbitrary rules?

      Auto-split, since it is just splitting at the nearest word boundary to 80 will always be correct.

      80 columns is a display issue, and should be handled by the system doing the display.

    4. Re:The Way of the World by .@. · · Score: 0, Redundant

      So auto-concat then split to whatever your line width is. Trivial.

      Stop insisting that people change their behavior to suit your display preferences, and fix it on your end.

      --
      .@.
    5. Re:The Way of the World by Halfbaked+Plan · · Score: 1

      Goodness gracious. You're advocating people insert hard carriage returns that delimit at 80 columns??

      Perhaps you'd be happy with a word processor that rings a little bell when you reach column 75??

      'The way it used to be' was 80 column punched cards. That vintage ASCII art started out as a deck of cards, ya know...

      --
      resigned
    6. Re:The Way of the World by ComputerSlicer23 · · Score: 2, Insightful
      You're doing a very bad job of interepreting his words, so I'll give you an example:

      1. Item #1
      2. Item #2
      3. Item #3
      4. Item #4
      Now, that would look just stupid if it was like this:
      1. Item #1 2. Item #2 3. Item #3 4. Item #4

      In the end, ASCII (which all good e-mail should be presuming it's in English), there is no such thing as a hard linebreak versus a soft linebreak. In desktop publishing such a thing exists. E-mail as a general rule doesn't have a well defined, broadly implemented standard for such a beast.

      Which is precisely his beef. It's relatively straightforward a paragraph all on one line into arbitrary length lines (in this case, there are only hard-breaks, and the text viewer implements softbreaks for you). However, it's painful to join things that aren't 80 characters together. The text viewer can't tell if you meant that carriage return to be a softbreak or a hardbreak. On a hardbreak it shouldn't join the two lines, on a softbreak it should. A lot of people aren't terribly consistant (I'm not for example), and their e-mails are a pain to read in an auto-formatted text viewer. I've cringed on more then on occasion when someone quotes my e-mail on a list when they use a 60 char line breaking, and I use 72 char line breaking. Then the last 12-20 characters get split onto their own line. It just looks horrible.

      There is some header that can affect this along lines of "Text-flowed" in the Mime Headers, so that things word wrap properly (essentially, your text has soft line breaks, and hard line breaks), where as standard ASCII has no such concept.

      I use mutt with vim as my text viewer. I've been known to re-format e-mails on a fairly regular basis and re-save them to be readable to me. I do the interpretation of soft vs. hard breaks and save it so it's easy to read (for me).

      Stop being so hard headed and assuming the other guy's just an anal retentive prick. He's got a legitimate point that the interpretation of line breaks is very difficult.

      Kirby

    7. Re:The Way of the World by iantri · · Score: 1
      Hard returns at the 80th column is a tried and true convention.. it works.. and it makes the file readable on ANYTHING that displays 80 columns.

      If the files were not in plain ASCII, obviously this would not be a good idea, but many programs can't wrap plain ASCII properly (Internet Explorer, for one.)

    8. Re:The Way of the World by Halfbaked+Plan · · Score: 2, Insightful

      It often looks like hell when I try to read that sort of text on my Handspring Visor. Why not delegate wrapping to the viewing software.

      The 'many programs' that can't wrap are broken.

      --
      resigned
    9. Re:The Way of the World by Anonymous Coward · · Score: 0

      i wrote a converter app that would take text and make a html output that looked like the text does in notepad with wrapping on

      its written in delphi style object pascal and compiles fine with both delphi and freepascal (with the -Sd command line switch)

      http://www.jake0.org.uk/~plugwash/txt2html.zip

    10. Re:The Way of the World by Hatta · · Score: 1

      So, just pipe it through fmt.

      --
      Give me Classic Slashdot or give me death!
    11. Re:The Way of the World by dfghjk · · Score: 1

      So is white space. I suppose we should save text files with no embedded white space then? Isn't block indentation just a display issue?

  9. I don't get it by Dixie_Flatline · · Score: 4, Interesting

    Because of the way that people name their methods and variables now (int IHaveToDoABunchOfNiftyStuffHere( INT nThisIsAReallyImportantInt ) ) 80 columns isn't particularily feasible. That said, I don't understand why people don't just standardize on a column width and stick with it. When I first started working here, I tried to work within 80 columns, but my coworkers hated it when I reformatted their code, and I hated it when they touched mine. Now I format to 132 columns, and nobody really notices when I reformat their code to fit.

    All the important stuff happens at the END of the line. It's where the actual methods get called and the work gets done. Seeing the beginning the line is usually entirely meaningless, and I hate scrolling to have to see the end of the line at 160 characters. I've already got my hands on the keyboard, and the mouse isn't a tool that I can use to input code, so it's just a waste of my time to put my hand on it. Most editors even indent and format the code pretty nicely if you manually break the line in a language like C or C++ which don't care about whitespace.

    It doesn't really matter what the column width is as long as
    1) Everyone sticks to it
    2) You don't have to scroll to see the end of the line.

    1. Re:I don't get it by Vaevictis666 · · Score: 2, Interesting
      I guess that's part of the reason some of the newer languages out there (Perl, Python, Ruby) allow post-conditionals.

      die("The meat of the statement is at the front of the line") if Language.supports("post-conditionals");

    2. Re:I don't get it by EvilIdler · · Score: 1

      What sort of coding practice makes 132 columns necessary, really?
      Is this all Gtk+ code? ;)

      "gtk_window_routine_that_replaces_the_one_with_t he _misspelled_name()" :)

    3. Re:I don't get it by keramida · · Score: 1
      Not always. A very common "idiom" these days is:
      #define MAX_RIDICULOUSLY_NAMED_STRUCTS 16

      typedef struct
      {
      int foo;
      }
      SOME_RIDICULOUSLY_LONG_NAME_T;

      SOME_RI DICULOUSLY_LONG_NAME_T ArrayOfRidiculouslyNamedStructs[MAX_RIDICULOUSLY_N AMED_STRUCTS];
      pthread_mutex_t LockForTheArrayOfRidiculouslyNamedStructs;

      which, of course, looks awful when you have to actually use the names later on:

      I never quite got it why people find the above piece of source more elegant than say...

      #define MAX_FBUF 16

      struct fbuf {
      int foo;
      };

      struct fbuf fbufs[MAX_FBUF];
      pthread_mutex_t fbuf_mtx;

      The ridiculous names are the cause of most of the problems people have with 80-column terminals IMHO.

      --
      My other computer runs FreeBSD too.
    4. Re:I don't get it by Anonymous Coward · · Score: 0

      Because your names obscure the fact that the code is about being ridiculous.

    5. Re:I don't get it by AdamPiotrZochowski · · Score: 1


      For those wondering why 132 is magic to some, here is a list of
      line widths and reasons:

      size reason
      ---- -----------------
      __40 Old Terminals (old dos)
      __40 file_id.diz
      __72 Plaintext Emails
      __72 links/lynx/w3 webpage margins
      __80 Newer Terminals (new dos/vt100)
      _132 Newest VESA text mode supported
      ____ by hardware in GFX cards

      Depending on who you are, and what purpose you have, different
      widths are good.

      First old green/amber monitors were 12" (or blurry tvs) and
      fitting and reading more than 40chars on screen was hard, so
      we had initially 40chars.

      Also, meet assembly coder, generally the code will fit in the
      first 40 characters, while the rest will be used for comments.

      If you want to format code nicely for email you will be
      formatting 72 chars to be safe. Before someone starts saying that
      there is no such thing as 72 for email, you are mistaken for a
      multitude of reasons.
      -> if someone replies, your lines will be prefixed. with 72 chars
      there is enough space to include original message through four
      replies (by which time discussion moves offtopic, or graviates
      around another quote)
      -> all mail clients adhere to this rule, from pine to mozilla

      The 80 characters is also left over from old times. You
      want your code to fit completly to whenever/whoever is reading
      it. Pico/Vi/Emacs are here to blame. Many DOS editors actually
      are following more closely to the 72 char limit (such editors
      as turbo/borland pascal).
      Here we started getting color monitors (ega/cga/vga) and they
      were larger, sharper, and on 14" finally we could fit 80 chars.

      The 132 characters is by now an old mode introduced with VESA
      standard. Remember first games that were 640x480x256 in DOS?
      Thats when VESA was created and when we got 132 characters.
      Ofcourse, this was almost 10years ago, people were switching
      to windows, and monitors did not grow up to support 132 chars
      properly yet. Of the more famous programs for dos to utilize
      all the text modes properly would be Cubic Player.

      Novadays, the line limit is on how much you can fit on your
      screen, there are few factors:
      1. IDE -> many Integrated Development Environments want to put
      things on the left and right size. Opened files, objects
      toolbar, properties explorer, color picker. Clutter galore.
      2. Resolution -> Afterall, there are so few pixels on the screen
      3. Eyes / Monitor Size -> some people have problems reading
      smaller fonts. At 1024/768 I am fitting easily 170 chars
      (running terminal 6px by 8px)

      I am always wondering why people want blurry fonts (anti aliased
      as some call it) and why some want variable sized fonts (that
      are harder to read, and less predictable).

      --
      /apz, viva la terminal

    6. Re:I don't get it by hotpotato · · Score: 2, Insightful
      It doesn't really matter what the column width is as long as
      1) Everyone sticks to it
      2) You don't have to scroll to see the end of the line.

      I disagree. Reading short lines is less tiresome than reading long lines. This is the reason why most newspapers use rather narrow columns in print.

      When lines are logically longer than 80 chars, I use line breaks to make them fit.. not too difficult, and I find that several short lines of method calls are much easier to read than a single long line.

    7. Re:I don't get it by E_elven · · Score: 2, Insightful

      Your example may not be the best. It's usually really important to know what the hell the condition is. That's why it's generally a good idea to:

      if something
      x
      else
      y
      end

      That being said, postconditionals make the code flow much better and are excellent for short single choices (i.e. just an if, not an if-else).

      --
      Marxist evolution is just N generations away!
    8. Re:I don't get it by Hes+Nikke · · Score: 1
      well given your second example, your first should probably be something more along the lines of the following:
      #define MAX_FRAMEBUFFERS 16

      struct frameBufffer {
      int foo;
      };

      struct frameBufffer frameBuffers[MAX_FRAMEBUFFERS];
      pthread_mutex_t frameBufferMatrix;
      using full names verses your abbreviations, for the same symbol names kinda negates your augment though ;) (and it still fits in this tiny little html editor)

      no, for me, it's when you are 15 levels of branches and loops deep and you have all the white space on the left...
      --
      Don't call me back. Give me a call back. Bye. So yeah. But bye our, well, but alright we are on a shirt this chill.
    9. Re:I don't get it by Fallen+Andy · · Score: 1

      Um. I'd reckon 100-120 is the most I tolerate, but
      I'm no fascist. So long as you can read a co-workers
      code (and not laugh too much) what's the problem?

      80 columns is a sicko leftover of old Hollerith
      punch cards.

      Meaningful var names are great, but uh: IHaveToThinkUpThisStinkinVarNameSoImGoingToPissOff EveryOne
      (case sensitive of course) (AARRGGH!).

      If you don't have the brainpower to *format* your
      code as you think then you shouldn't be programming.

      Remember, you're likely to be the poor sucker who has to debug this schizoid mess 10 years later if it's engineered well..

      Every "shop" has it's own rules, and it isn't such
      a big deal to conform (even if they think the GNU
      rules are good and believe in the great gods K&R
      (first edition)).

      Really, this stuff is a non issue. Tabs vs. spaces
      is a far more evil one. Along with the more modern
      "how do I teach this F*King IDE that I don't
      indent that way" (mixing auto gend code with
      my style makes me scream). Anyone know how
      to persuade Vizual Studio to change its manners?

      (ok, it's a badly formatted posting :-)).

    10. Re:I don't get it by __david__ · · Score: 2, Insightful

      This is true for english prose, but is *not* the case with code. Having all the code on one line is usually more readable even if the line is very long. This is easy to prove, just try it.

      Having lines that are long is especially useful when you have some sort of repeating pattern that makes a nice column down the screen (either very similar code or a data structure). Wrapping lines in this case royally screws the readability.

      -David

    11. Re:I don't get it by jrockway · · Score: 1

      Come to think of it, what's the convention for appending _t. I subconsciously _t all my structs, but is this "correct"?

      --
      My other car is first.
    12. Re:I don't get it by Mr+Z · · Score: 1
      no, for me, it's when you are 15 levels of branches and loops deep and you have all the white space on the left...

      If you're nested that deeply, then perhaps it's time to reconsider your coding style. More than 4 or 5 levels is a serious warning. There are these great new inventions called "functions" and "procedures" that might help.

      </snarky>

      --Joe
    13. Re:I don't get it by Mr+Z · · Score: 1

      I believe 132 was also the limit imposes by dot matrix printers in "condensed" mode. I recall the old "green-bar" paper having a similar column count.

    14. Re:I don't get it by Scarblac · · Score: 2, Informative

      Perl does that, Python doesn't. I don't know about Ruby.

      And Perl does it because those guys like giving you many options, it doesn't mean that actually using that is a good idea. Perl contains lots of possibilities that in 99% of the cases are a bad idea to use.

      --
      I believe posters are recognized by their sig. So I made one.
    15. Re:I don't get it by nutsy · · Score: 1

      _s for structs, _t for type(def)s. E.g.:

      typedef struct some_structure_s {
      blah...
      } some_structure_t;

    16. Re:I don't get it by Clover_Kicker · · Score: 1

      IBM 3270 terminals did 132 columns waaay before the PC existed.

    17. Re:I don't get it by Dixie_Flatline · · Score: 1

      You know what I did to get Visual Studio to behave?

      I ditched it, and went back to emacs. I only use Visual Studio for debugging (because the debugger is quite nice, actually. Plus, what choice did I have? :D)

      I found the command line switches I needed for compiling, and I can do everything except debugging and source control through emacs, and I'm sure I could do the source control if I cared that much. It's easier to use the SC app on its own, anyway.

    18. Re:I don't get it by Hes+Nikke · · Score: 1
      no, for me, it's when you are 15 levels of branches and loops deep and you have all the white space on the left...


      If you're nested that deeply, then perhaps it's time to reconsider your coding style. More than 4 or 5 levels is a serious warning. There are these great new inventions called "functions" and "procedures" that might help.

      not all of that nesting is my fault, and as a mater of a fact i've been slowly removing some of that nesting from the code i've inherited by using methods (the term of choice in Objective C.) besides, that fifteen figure i mentioned before was an exaggeration - to some extent.

      don't forget that methods/functions/procedures/etc have more overhead than branching - especially with an environment as dynamic as Cocoa/GNUStep/NexStep.
      --
      Don't call me back. Give me a call back. Bye. So yeah. But bye our, well, but alright we are on a shirt this chill.
    19. Re:I don't get it by AdamPiotrZochowski · · Score: 1


      IBM 3270 terminal is amazing technological marvel that should be
      much more well known. Its very similiar to http/html. The server
      formats a page, sends it to client, and forgets about it. The
      terminal client then guides user to fill out the form (like
      almost a browser). Once user is ready he submits the form
      back to the server. Server then does some work and sends another
      form to fill out (to correct input, or to do something else).

      VT100 is nice especially when it comes to interactivity (since
      server can act upon every single keystroke), but IBM 3270 really
      shines when it comes to being low on cpu usage (only acts when
      user submits a form).

      There are gateways that convert IBM 3270 terminal output into
      http/html. I believe AT&T is one company to prolong their
      mainframe usefullness through this.

      my lame excuse: the IBM 3270 that I have access to is quite
      adamant as to the client line widths and to connect succesfully
      I have to ensure to be in 3270 mode 2 (80x24).

      I should have read up on other modes. 3270 mode 5 is as you say,
      meaning 132 wide (by 27 lines).

      Thank you

      --
      /apz, one learns new things

    20. Re:I don't get it by Clover_Kicker · · Score: 1

      Unfortunately, a lot of mainframe software is hardcoded for 80x24 (or was it 80x25?).

      I haven't had to sit in front of a bona-fide 3270 for ~10 years, but it was frustrating to realize that even if the terminal could change modes, most of the apps didn't benefit.

      You're right, 3270 is pretty neat technology, but I sure didn't shed any tears when they hauled my green monster away and replaced it with an XTerm.

    21. Re:I don't get it by Mr+Z · · Score: 1

      Methods/functions/procedures don't always have more overhead than a nested-if. If they're only called from a few places, they'll get inlined everywhere. If they're called from many places, the reduction in codesize may end up giving a net benefit in program cache behavior.

      In the end, it's unlikely that you'd measure a run-time difference in anything but the most time consuming parts of your code. Given that, it seems like the focus should then rest on the speed of development and the ease of maintenance, as opposed to the cycle count of the functions themselves.

      Just a thought.

      --Joe
    22. Re:I don't get it by jrockway · · Score: 1

      Okay, thanks. I always do typedef struct {} name_t; so I guess I'm right. Now I know why, though :)

      --
      My other car is first.
    23. Re:I don't get it by nri · · Score: 1

      make this fit nicely in 80 char width. (Its c, so don't suggest a c++ templates). It looks VERY nice in a wide screen. Reads well very well.

      FixTypeTable FixTypeTab[] = {
      {"char", FixEncodeChar, FixDecodeChar, FixPrintChar, FixDupChar, FixSizeChar, FixInitChar},
      {"int", FixEncodeInt, FixDecodeInt, FixPrintInt, FixDupInt, FixSizeInt, FixInitInt},
      {"float", FixEncodeFloat, FixDecodeFloat, FixPrintFloat, FixDupFloat, FixSizeFloat, FixInitFloat},
      {"time", FixEncodeTime, FixDecodeTime, FixPrintTime, FixDupTime, FixSizeTime, FixInitTime},
      {"date", FixEncodeDate, FixDecodeDate, FixPrintDate, FixDupDate, FixSizeDate, FixInitDate},
      {"monthyear", FixEncodeMonthYear, FixDecodeMonthYear, FixPrintMonthYear, FixDupMonthYear, FixSizeMonthYear, FixInitMonthYear},
      {"dayofmonth", FixEncodeDayOfMonth, FixDecodeDayOfMonth, FixPrintDayOfMonth, FixDupDayOfMonth, FixSizeDayOfMonth, FixInitDayOfMonth},
      {"asxtime", FixEncodeAsxTime, FixDecodeAsxTime, FixPrintAsxTime, FixDupAsxTime, FixSizeAsxTime, FixInitAsxTime},
      {"asxdatetime", FixEncodeAsxDateTime, FixDecodeAsxDateTime, FixPrintAsxDateTime, FixDupAsxDateTime, FixSizeAsxDateTime, FixInitAsxDateTime},
      {"simpletime", FixEncodeSimpleTime, FixDecodeSimpleTime, FixPrintSimpleTime, FixDupSimpleTime, FixSizeSimpleTime, FixInitSimpleTime},
      {"datlen", FixEncodeDataLen, FixDecodeDataLen, FixPrintDataLen, FixDupDataLen, FixSizeDataLen, FixInitDataLen},
      {"data", FixEncodeData, FixDecodeData, FixPrintData, FixDupData, FixSizeData, FixInitData},
      {"price", FixEncodePrice, FixDecodePrice, FixPrintPrice, FixDupPrice, FixSizePrice, FixInitPrice},
      {"cobolprice", FixEncodeCobolPrice, FixDecodeCobolPrice, FixPrintCobolPrice, FixDupCobolPrice, FixSizeCobolPrice, FixInitCobolPrice}
      };

      If you still have an issue, then try
      map :set wrap
      map [29~ :set nowrap "

      I personally have windows set at 100 chars, and use the key mapping above F6/Shift F6 to set/unset word wrapping.

      --
      if :w! doesn't work, try :!cvs commit -m""
    24. Re:I don't get it by Anonymous Coward · · Score: 0
      If you're nested that deeply, then perhaps it's time to reconsider your coding style...There are these great new inventions called "functions"

      Ooh. If you're so smart, then why do all the lisp programs have a bunch of expressions that end '))))))))))'.

      Perhaps in HTML, or whatever you program in, you don't nest more than 4-5 levels, but in some languages it's common. For example, quoting python-mode.el:

      '(?< ?> ?!)))))))))
    25. Re:I don't get it by Anonymous Coward · · Score: 0

      Surely someone as intelligent and eloquent as you realizes that you don't "program" HTML, as it is not an executable language. It's not Turing complete.

      As for deeply nested LISP expressions (and yes, LISP is supposed to be all-CAPS), that's just an aspect of how LISP is specified. You end up with many nested level of parentheses due to the postfix nature of its expression syntax. Big whup. It's not like you're blowing an entire level of indentation with each one.

    26. Re:I don't get it by Emil+Brink · · Score: 1

      Well, according to this page, types with _t suffixes can actually be reserved.

      Even if that is not so, I tend to assume that _t types are provided by the "system", and not part of the application code. Thus, I find use of this convention very confusing, since (at least in my experience) there is a difference in reliability between "system" and application code.

      Personally, I use MixedCase for type names, which make them distinctive since functions and variables are all lower case.
      --
      main(O){10<putchar(4^--O?77-(15&5128 >>4*O):10)&&main(2+O);}
    27. Re:I don't get it by Anonymous Coward · · Score: 0

      windbg. It's free, and once you get used to the crack-addled command language, it's not bad for someone who likes GDB. The newest version with the dockable windows is the only way to go.

    28. Re:I don't get it by cerberusss · · Score: 1
      my coworkers hated it when I reformatted their code, and I hated it when they touched mine

      Stop wasting time and let everyone agree to use a formatter like Jalopy (for Java). You'll be surprised at the feeling of relief when you can just bang your code in, right-click and reformat.

      --
      8 of 13 people found this answer helpful. Did you?
    29. Re:I don't get it by dfghjk · · Score: 1

      The "great gods" of K&R chose their format based on what would fit best on a small page and would be cheapest to publish. Those very "gods" admitted that the style would otherwise not be their preference. Curious how stupid reasons for making decisions somehow come to be believed as being genious. The K&R style blows.

      Tabs and spaces shouldn't be a problem unless your editor is stupid. Perhaps you should turn code auto-generation off. You really need that?

  10. In the real world... by bretharder · · Score: 1

    ...people don't follow stupid rules like this.

    Back in school we used to have to write the whole program out on paper first, that was a f-ing joke.
    I have never written code with pen and paper;
    I may write ideas & conditional statements, but never code.

    1. Re:In the real world... by n0d3 · · Score: 1

      Back in school you had to do your exams in the first few years on paper. And almost every little mistake counted.

      I for one say 80 chars a collumn is a good thing. 'Documents' have a limited size. (paper size) so why not code (etc). Just because we can type unlimited doesn't mean we should keep on going unlimitedly and let the client handle wrapping ...

      I like 80 collumns (and would happily use 132 if that would be the new 'standard') because it is an easyer read. on my (x) terms in my vi in everything. I hate vertical scrolling. (I don't particulary like the way vi wraps lines either)

      Just keep it at some 'universal' standard. 80 might be outdated yes, but a standard should still be adheared to to make reading easy.

    2. Re:In the real world... by EvilIdler · · Score: 1

      Try this experiment:
      Print some text in landscape mode, with a font that allows 132
      characters wide. How readable do you find it?

    3. Re:In the real world... by jrockway · · Score: 1

      I program stack computers. And I almost always write out the program on paper first. Actually I use a four-step procedure. First I write out the state of the stack after every instruction. For example, say I want to calculate 4A + B^2 ... here's what I write

      X X X X X X
      X B X X X X
      B A B 4A 4A X
      A 4 4A B B^2 4A+B^2
      (time--->)

      Then I figure out what instruction I used to get there:

      (start), 4, MUL, SWAP, SQR, ADD

      Then I try it out on my own data, by hand. (Let's use 1 for A and 4 for B, the result should be 20)

      X X X X X
      X 4 X X X
      4 1 4 4 X
      1 4 4 16 20

      Okay, it worked.

      THEN I type it into the computer, and run some more test cases. So you see, what you learned in school may actually be useful!

      --
      My other car is first.
    4. Re:In the real world... by rjch · · Score: 1
      Back in school we used to have to write the whole program out on paper first, that was a f-ing joke.
      I have never written code with pen and paper;
      I may write ideas & conditional statements, but never code.

      I'm not a programmer per se - I write reports as part of my job. No, I never write the entire SQL query out in full on paper, but when trying to figure out linking a half dozen tables together on some weird method (i.e. more than just join x on x.id = z.id), I'll diagram my queries first and jot down joins.

      Makes coming up with the right query first time (rather than having to debug, which is always harder) one hell of a lot easier.
    5. Re:In the real world... by julesh · · Score: 1

      So you see, what you learned in school may actually be useful!

      But only if you're programming in an obscure and very rarely used environment, such as using stack based assembly language (e.g. x86 floating point, although not integer) or forth.

      Out of interest, exactly why do you program stack computers, when there are many well designed automated processes that can convert from a more natural and understandable infix notation to a stack based one with a very high degree of efficiency (I like to call them 'compilers')?

    6. Re:In the real world... by jrockway · · Score: 1

      Research. Somebody has to write compilers, ya know.

      Also, CPUs don't design themselves. (I don't either, as a disclaimer :) It's good to have testcases for the new CPUs, dontcha think.

      Anyway, you're not going to write a web browser for a stack computer. But remember that there's more to CS than that.

      (OF is written in Forth, BTW. Very flexible.)

      --
      My other car is first.
  11. um news flash by josepha48 · · Score: 1
    80 columns died when they came out with 132 column printers. Where have you been?

    No seriously on Linux use svgatextmode if you can or a framebuffer driver and try to expand the columns on your screen. Or just use X / windows elsewhere.

    80 columns is thought of as old.

    --

    Only 'flamers' flame!
    Does slashdot hate my posts?

    1. Re:um news flash by .@. · · Score: 1

      Really? Then how to you recommend people still using vt100 terminals cope?

      What about people using PDA or cellphone-based ssh
      clients?

      slrn? Mutt?

      My Apple //e and I spit at you.

      I generally find those who advocate ditching the 80-column standard are the same ones who have no problem with HTML-ized email.

      Bah. Feh.

      --
      .@.
    2. Re:um news flash by black+mariah · · Score: 0, Troll
      Really? Then how to you recommend people still using vt100 terminals cope?
      Buy a real fucking computer?
      What about people using PDA or cellphone-based ssh clients?
      See above.
      slrn? Mutt?
      Join the rest of us in a fucking GUI by, well,, BUYING A REAL FUCKING COMPUTER.
      I generally find those who advocate ditching the 80-column standard are the same ones who have no problem with HTML-ized email.
      I fucking hate HTML email, and 80 columns is fucking stupid. Write to whatever width the code needs, stupid fucking cellphones be damned.
      --
      'Standards' in computing only impress those who are impressed by things like 'standards'.
    3. Re:um news flash by Anonymous Coward · · Score: 0

      Look at me! I can fucking swear!

      We're all so damn proud.

    4. Re:um news flash by 0x0d0a · · Score: 2, Insightful

      The advantage of using 80 columns is that you can have multiple source lines on screen.

      At 1152x864, you can slap four xterms with the default fixed 9 font onscreen, and refer easily to headers and other code.

      I view X as particularly useful because I can *have* four terminals onscreen at once, though I can make any bigger if I feel like it or my eyes are tired.

    5. Re:um news flash by .@. · · Score: 1

      Typical. Assuming everyone wants to, or is able to, change the system they use.

      Stop insisting that the rest of the world conform to your display preferences. 80-column ASCII is the lowest common denominator. All your gee-whiz eye-candy isn't going to change that.

      Or do you want all your SMS messages to include 50k of XML markup? After all, you should BUY A REAL COMPUTER, as you say.

      How about we bog down your cellphone with 500k emails that say nothing but, "I'll be home at 5", because they're XML-ized, carrying embedded graphics, and so forth? After all, you should just BUY A REAL COMPUTER.

      Don't worry; the real world will adjust your perspective soon enough.

      --
      .@.
    6. Re:um news flash by Dan+Ost · · Score: 1

      This is very true. At 1024x768 resolution, two xterms 56x80 fit neatly side by
      side on my laptop. I run at a higher resolution on my workstation and will
      lengthen my xterms, but I like to stick to 80 or 88 columns wide. I've tried
      coding in 132 columns, but find that long lines are unwieldy to read and write.

      --

      *sigh* back to work...
    7. Re:um news flash by black+mariah · · Score: 0, Troll

      Typical. Bringing up things that are marginally related to the discussion in order to make yourself look smart.

      I never mentioned a fucking thing about XML, dipshit, and in fact I stated that I hate HTML emails so you can very easily guess, unless you're a dumbass, that I don't like XML as it pertains to email or text messages very much either.

      We're talking about how many columns to use for plain text. This is a stupid fucking argument. You use as many as are neccesary. Any text editor/display should wrap it (and UNwrap it, something I wish nedit did) automatically. If what your using is so archaic that it can't even handle that, you SERIOUSLY need to invest in new hardware. If you can't change the system for business reasons (legacy hardware), then you probably have internal ways of dealing with it already. If you can't for other reasons (no money. Been there.), you just have to deal with it on your own and not expect the rest of the world to bend over and take it because you can't keep up.

      I'd have thought by now that we'd be done with the 'lowest common denominator' in all but specialized areas. I thought programmers hated irrational limitations.

      --
      'Standards' in computing only impress those who are impressed by things like 'standards'.
    8. Re:um news flash by Mr.+Slippery · · Score: 1
      No seriously on Linux use svgatextmode if you can or a framebuffer driver and try to expand the columns on your screen. Or just use X / windows elsewhere.

      Why would I want to strain my eyes with smaller text? I've managed to stay 20/20 in both eyes despite all these years of staring at displays, and I attribute this to using large clear fonts. (I'm a fan of 12 point Lucida Typewriter bold for my Emacs and terminal windows)

      80 columns is thought of as old.

      80 columns is classic. Like a pair of Levi 501's. Old, yes, but optimal too - there just isn't a better solution. Think of it as carrying on a Grand Tradition from Elder Days, and be glad.

      --
      Tom Swiss | the infamous tms | my blog
      You cannot wash away blood with blood
    9. Re:um news flash by welshie · · Score: 1

      Don't be daft. If you don't code to the 80 character line limit,
      your code would never fit on the punched card. Now, if everyone
      were to upgrade to paper tape, this wouldn't be a problem.

      Oh, and all the VT100 and TVI925 terminals would need to be hardware upgraded.

    10. Re:um news flash by McSnarf · · Score: 1

      N00b :) 80 columns have nothing whatsoever to do with printers - it's the amount of columns of Hollerith punched cards. These were then taken as granted for IBM's 3270, DECs VT52 etc.pp.

  12. Error by Anonymous Coward · · Score: 4, Funny

    With most people using X

    The proper technology name is ActiveX.

    1. Re:Error by Anonymous Coward · · Score: 0

      Shut up, that was fucking lame.

    2. Re:Error by nlindstrom · · Score: 1

      YHBT. YHL. HAND.

    3. Re:Error by Frizzle+Fry · · Score: 1

      You fail it. If you want to make a stupid comment about "most people using X", the comment must involve a rave in some way.

      --
      I'd rather be lucky than good.
  13. 80 columns lives by bandy · · Score: 2, Informative

    80 columns is still the default width of an xterm and Gnome Terminal window. Grumpy cow-orkers insist on sticking to 80 columns. It's a fact of life. Get used to it.

    --
    "You might as well get your son a ticket to hell as give him a five string banjo." -unknown minister
    1. Re:80 columns lives by jon787 · · Score: 1

      Thats exactly what I was going to point out. All my xterms are 80 columns, likewise with my NEdit window. My console runs a framebuffer at 1280x1024 and will do twice that.

      --
      X(7): A program for managing terminal windows. See also screen(1).
    2. Re:80 columns lives by EvilIdler · · Score: 1

      It might also be a sane limit before people lose track of what
      they were reading. I know I sometimes have to re-scan lines of
      footnotes with tiny fonts in O'Reilly books and such.

    3. Re:80 columns lives by AdamPiotrZochowski · · Score: 1

      blah , pico has a limit of 72 chars per line, and we all
      like it.

      And the good old file_id.diz standard defines for the file to be
      no larger than 40characters wide and no more than 10 lines long
      (some older ones forced 5 lines long), with the first line
      being the MOST descriptive.

      Not to mention that assembly programmers can do it under 40 chars
      per line.

      you people with 80 chars per line are WAY too spoiled.

      --
      /apz, why does BBS novadays means webforum? I want telnet BBS

    4. Re:80 columns lives by jrockway · · Score: 1

      Yup, and C-x 3 M-x follow-mode make it easy to use that space efficiently. Thank you, RMS, for emacs :)

      --
      My other car is first.
  14. 80? I thought it was 72! by BladeMelbourne · · Score: 1

    Printing wide code can be annoying - although if the printout showed when lines wrapped with the down-then-left arrow common in some editors... that would make life easier.

    But it's not as annoying as printing the output from SQL statements in M$ Query Analizer... especially when there is a text(16) field in the output that needs analising!

  15. It's been dead a long while. by Spudley · · Score: 4, Insightful

    You've only just noticed, eh? Methinks you've had your head stuck in the sands of the character-based terminal a bit too long.

    The only reason I can think of to keep using 80 character lines now is if you're writing in COBOL (which forces the issue). For anything else, you can either write your lines as long as you need them (if you're programming), or you turn on word-wrap (if you're doing anything else).

    When I say 'as long as you need them', that isn't an invitation to write programs with 700-character lines; I mean, there's still a requirement for a degree of common sense, even for programmers ;), but sticking to 80 characters is truly limiting, especially these days when everyone has screens and editors that are capable of so much more.

    --
    (Spudley Strikes Again!)
    1. Re:It's been dead a long while. by jc42 · · Score: 1

      When I say 'as long as you need them', that isn't an invitation to write programs with 700-character lines; ...

      Oh, I dunno. Some years back, a particularly obnoxious programmer on the team produced a ridiculously-long routine to do a certain task. I opined that I could do it in a lot less code. His response was something sarcastic along the lines of "Oh, yeah; I suppose you could do it in one line of C." I paused a few beats, and said that, yes, I could. He sneered at this, so I offered a wager, which he accepted. A few hours later, I presented the group with a single-line routine that did the same thing, and demanded that he pay up.

      The single line was actually his code, with all the newlines removed (and the more useless comments dropped). It was several thousand bytes wide, of course, but one line.

      Well, it was good for a joke. I also produced an equivalent, well-formatted code that was only about 10% as much code as his "solution", and ran much faster. That's what earned me his eternal enmity.

      All this is why the "obfuscated" C and perl contests limit the byte count of entries. And, of course, some entries each year are usually a single long line, to fit within the limit by eliminating all unnecessary white space. But for such contests, such code is "good".

      There is amazingly little logic to all this ...

      --
      Those who do study history are doomed to stand helplessly by while everyone else repeats it.
    2. Re:It's been dead a long while. by chris_mahan · · Score: 2, Insightful

      Use Jedit.

      The line-wrap feature is killer.

      Put line numbers in the giutter

      it prints to printer with line-wrap.

      use code-to-html plugin for pretty web output

      code your code without worrying about all that.

      --

      "Piter, too, is dead."

  16. Of course, otherwise it doesn't fit on my... by monopole · · Score: 2, Funny

    ...Hollerith cards

  17. Was there a limit?! Oh My Goodness! by Ridgelift · · Score: 1

    Well, I guess I came to the party late. I didn't even realize that code used to be formatted to 80 columns!

    I guess that's why most of my old code is impossible to maintain. In search of something better, I switched to Python because of ESR recommendation and I really, really like it. The forced syntax makes my code a lot more readable. Although I've been struggling to switch my LAMP coding from Linux/Apache/MySQL/PHP to Linux/Apache/MySQL/Python, I'm hoping it will be easier to maintain.

    I think I'll begin to adopt fixed-width as well and see if I can continue to make code maintenance improvements. To me, computing speed is no longer an issue. Development and maintenance speed is king now.

    1. Re:Was there a limit?! Oh My Goodness! by Anonymous Coward · · Score: 0

      Hahaha. You actually listen to ESR's recommendations? You use variable-width fonts to code? Nice troll.

  18. Never! by Dr.+Photo · · Score: 4, Funny

    If we don't format our code to 80 columns, then how will we maintain back-compatibility with IBM punch cards?!

    1. Re:Never! by Drakon · · Score: 1

      ETC punch cards, you mean
      (Cryptonomicon)

  19. I hate wide text! by EvilIdler · · Score: 1

    I rarely keep program windows as wide as the screen, since I want
    to see parts of the other windows I'm using at all times. Don't ask
    me to use taskbars and such - I just don't like them :)

    My code typically ends up somewhere around 80 characters wide,
    at most, because of this. And it's no big deal putting that in PRE
    tags or similar on the web if it's already formatted.

  20. More then 80 columns is fine by stefanlasiewski · · Score: 2, Interesting

    You can violate the 80 column rule any time you want. Just do me one favor-- get rid of the tabs.

    But remember, a 'tab' MUST be equal to 4 spaces or less. Destroy the tab character! Save the whitespace!

    Nothing awakens the Hulk more then looking at code that someone indented with 8 tabs. Yarrrrg!

    --
    "Can of worms? The can is open... the worms are everywhere."
    1. Re:More then 80 columns is fine by Tumbleweed · · Score: 4, Insightful

      Okay, Hulk, that's just dumb. You _want_ indentation to be done via tabs - that way everyone can set the tab to _display_ as as many characters as they want. How many 'spaces' (equivalent) a tab displays should be up to your text editor of choice. The original author can display their tab characters as equivalent to 8 or whatever, and you can view it as 4 or whatever. That's the genius of using tabs for indentation.

    2. Re:More then 80 columns is fine by stefanlasiewski · · Score: 1

      Ok, you're right. I think I actually just want consistant tabs... it's been a long week.

      I was just trying to find a bug in some code written by a number of different authors: One guy used tabs, one used sets of 4 spaces, one guy used sets of 2 spaces... and of course, 8 indents means 8 nested statements. it's easy to get lost in there.

      --
      "Can of worms? The can is open... the worms are everywhere."
    3. Re:More then 80 columns is fine by Nasarius · · Score: 1

      Learn to configure your favorite editor properly. Or switch to a better editor. I recommend vim.

      --
      LOAD "SIG",8,1
    4. Re:More then 80 columns is fine by Tumbleweed · · Score: 1

      Yuck!

      Yeah, that would involve a series of search & replaces just to get it to the point of readability. There might be some programs out that that fix formatting problems like that for you; certainly worth looking for.

    5. Re:More then 80 columns is fine by 0x0d0a · · Score: 1

      No.

      This would be true in a system without hard line breaks. In a hard-line-broken environment, be it 80 col, 120 col, 132 col, or whatever.

      However, if you start changing tab width around, consistent line length goes to hell (not bad if you're shortening tabs, but if you lengthen them, you have a bunch of lines that are badly broken).

      This is a long, long debate.

    6. Re:More then 80 columns is fine by Tumbleweed · · Score: 1

      Tab size has nothing to do with how a line is broken, though. A tab is a character only - how it's displayed is up to the application. How word wrapping is handled is also up to the application. If your application doesn't let you configure both of those things to your liking, then you're using the wrong application.

    7. Re:More then 80 columns is fine by mellon · · Score: 3, Interesting

      Right, what happens if you do this is that the bozo that has tabs=4 sometimes uses tabs and sometimes uses spaces, and then when you try to load it into an editor with 8-character tabs, the indentation is all screwy. Whereas if everybody uses 8-character tabs, which is the usual meaning of ascii character number 9, then this never happens.

      The bottom line, though, is that this is a religious war, and as the person who's currently at the top of the list said, it's better for a team to just agree on what the indentation style is going to be, and stick with it. Otherwise you wind up with non-terminating flame wars (or terminated team members).

    8. Re:More then 80 columns is fine by Tumbleweed · · Score: 1

      If everyone is going to agree on something, then agree on using tabs and not multiple spaces. Then everyone can view at whatever indentation they want and not screw anyone else over.

    9. Re:More then 80 columns is fine by mellon · · Score: 1

      You _can't_ agree on tabs and not spaces, because there is no way to look at a piece of text and see that there are no spaces. Believe me, I've tried working with people who think that this isn't a problem, and it quickly becomes one. Editors will insert spaces for you instead of tabs, so even if you never hit the space bar, there's still no guarantee of anything. The only way you can have visual consistency between users is to agree on what width a tab has.

    10. Re:More then 80 columns is fine by Tumbleweed · · Score: 1

      > Editors will insert spaces for you instead of tabs

      Only if they're crappy, and aren't configurable, or if they're misconfigured. If you can get everyone to agree on a 'tab width,' then you can get everyone to agree on using tabs for indentation. Then it's just a matter of using a decent text editor to let you display those tabs however you wish. Getting people to agree on using tabs consistently should be easier than getting people to agree on using a specific 'width.'

    11. Re:More then 80 columns is fine by Tumbleweed · · Score: 1

      > there is no way to look at a piece of text and see that there are no spaces

      Oh yeah, forgot this bit of nonsense. This is also either a case of not knowing what your text editor can do, or of using a _really_ crappy text editor. Your text editor should have a mode where you can display spaces & such, and you can _very_ easily tell the difference between spaces and tabs.

      That this conversation is evening happening is amazing to me - how can so many people not know about the tab issue by now? How are people STILL putting up with crappy text editors in this day and age? Simply amazing.

    12. Re:More then 80 columns is fine by E_elven · · Score: 2, Insightful
      The problem with tabs is getting things to align neatly, particularly for functions and such. I like to align my function arguments (if need be):
      some_function(parm,
      other_parm,
      one_more_parm);
      Hard to do with tabs unless you mess with the whitespace around the parentheses which isn't a good idea.
      --
      Marxist evolution is just N generations away!
    13. Re:More then 80 columns is fine by Anonymous Coward · · Score: 2, Insightful
      The problem with tabs is getting things to align neatly, particularly for functions and such. I like to align my function arguments (if need be):

      some_function(parm,
      other_parm,
      one_more_parm);

      The solution is something like:
      [tab][tab]some_function(parm,
      [tab][tab][_14_spaces__]other_parm,
      [tab][tab][_14_spaces__]one_more_parm);


      Tabs are useless for this kind of alignment, but that doesn't rule them out completely. Tab until you hit the correct indentation level, then switch to spaces to align. In the above example, you could replace [tab] with any number of spaces, and it would still align.

      Never use tabs except to get to the correct identation level. If there have been 2 "{"s and no "}"s so far, each line should be indented using 2 tabs, and no tabs should appear anywhere else (except maybe an extra X tabs to indicate a line was continued, but don't use them align anything).
    14. Re:More then 80 columns is fine by __david__ · · Score: 1
      Right, what happens if you do this is that the bozo that has tabs=4 sometimes uses tabs and sometimes uses spaces, and then when you try to load it into an editor with 8-character tabs, the indentation is all screwy. Whereas if everybody uses 8-character tabs, which is the usual meaning of ascii character number 9, then this never happens.
      Actually, whats worse is sticking with 8 character tabs and indenting by four characters each time. This seems to be emacs' default mode and it is just horrible. It means absolutely the code won't look right on anything but 8 character tabs. And really, that isn't a standard. Even on old vt100s the tab stops were user settable.

      -David
    15. Re:More then 80 columns is fine by metamatic · · Score: 1
      Right, what happens if you do this is that the bozo that has tabs=4 sometimes uses tabs and sometimes uses spaces, and then when you try to load it into an editor with 8-character tabs, the indentation is all screwy.

      And this, in turn, is why I won't touch Python.

      --
      GCHQ Quantum Insert installed. If only our tongues were made of glass, how much more careful we would be when we speak
    16. Re:More then 80 columns is fine by Mr+Z · · Score: 2, Informative

      To fix the formatting: GNU indent

      To print it nicely when you're done: vgrind

      You're welcome.

      --Joe
    17. Re:More then 80 columns is fine by Scarblac · · Score: 1

      Nothing awakens the Hulk more then looking at code that someone indented with 8 tabs. Yarrrrg!

      I agree that indenting with 8 space tabs is ugly, 3 or 4 looks much nicer.

      However, if you indent by 8, it makes it less attractive to write codes that needs more than two levels of indentation, making it more likely that you'll split off things into subroutines. Which is often a very good idea that needs to be encouraged.

      --
      I believe posters are recognized by their sig. So I made one.
    18. Re:More then 80 columns is fine by Anonymous Coward · · Score: 0

      Right, what happens if you do this is that the bozo that has tabs=4 sometimes uses tabs and sometimes uses spaces?

      Fire him.

    19. Re:More then 80 columns is fine by mellon · · Score: 1

      I'm pretty happy with emacs. Some of my cow orkers use vi. We're highly productive in these environments. I've tried using various IDE editors, and have yet to find one that isn't extremely slow and painful for me to use. Any plan that depends on getting people to agree on what editor is modern and what is a crappy, ancient piece of junk is doomed from the start. When you've brokered a lasting peace in the Middle East, get back to us on this and we'll trust you to finally end the great editor wars.

    20. Re:More then 80 columns is fine by mellon · · Score: 1

      You're right - 8 character tabs aren't a standard. They are, however, what most devices do unless you program them to do something else. Including the VT100, may it rest in peace.

      Personal experience - if you set the tab stops to every 8 characters, you win. If you set them to anything else, you or one of your cow orkers lose. You can play dominance games and pee on each other's source code, or you can get work done. Given that in all likelihood someone's giving you money because you agreed to get work done, if you have any integrity at all you don't have battles like this at work, because you're wasting someone else's money.

    21. Re:More then 80 columns is fine by Tumbleweed · · Score: 1

      In the same way that there will BE no peace in the Middle East, there can be no peace between emacs and vi users. Just as I detest all sides in the Middle East conflict, same thing with emacs and vi. The world would be a better place without all involved, really; then the rest of us could just get on with things.

      *mostly joking*

    22. Re:More then 80 columns is fine by Paul+Crowley · · Score: 1

      Indentation that mixes spaces and tabs in a way that could cause ambiguity (ie consecutive lines such that neither's indentation is a prefix of the other's) is a syntax error in Python.

      All skilled programmers who've never used Python have the reaction you're having. I had it, my friend Jon had it, my Python-loving colleages either side of me felt the same way, and Eric Raymond reports he felt that way too. I see why you imagine that the whitespace thing would be a terrible problem.

      But it just isn't, ever; it's actually a real boon. If you were able to get over your prejudice and try it, you'd make the same discovery.

    23. Re:More then 80 columns is fine by oh · · Score: 1


      some_function(
      parm,
      other_parm,
      one_more_parm
      );

      The closing ); is just my preference, I just find it easier to terminate a vertical list this way. It adds a line, but I find it easier and faster to read then putting the list terminator on the same line as the last element. Feel free to make up your own mind.

      --
      Democracy isn't about no one telling you what to do. It's about everyone telling you what to do.
    24. Re:More then 80 columns is fine by pclminion · · Score: 1
      The original author can display their tab characters as equivalent to 8 or whatever, and you can view it as 4 or whatever. That's the genius of using tabs for indentation.

      If you think indentation should be done with tabs then logically you must oppose the 80-column limitation.

      Think about it. Suppose my tab stops are 2 columns, and I'm tabbed three levels in, and I write a line of code that extends over to column 78. Now, somebody with 4 column tab stops opens my code and suddenly the line is indented by 12 characters instead of 6 and that same line of code now extends over to column 84. There goes your precious 80-column limitation.

      If you like the idea of an 80-column limit on code, then you MUST use spaces to indent, not tabs.

    25. Re:More then 80 columns is fine by Grishnakh · · Score: 1

      The problem is that you can't even get people to agree on using tabs consistently. The only thing you can count on is that most people want to stick with whatever the default behavior is for their editor of choice. And for many editors, they have 8-character tabs, and many people use 4-space indentation. As someone else pointed out, this is the default behavior of emacs, and it's completely annoying.

      Just using tabs to set the indentation is an excellent solution, but one that will never be used because people are too entrenched in nonsensical ways to change.

    26. Re:More then 80 columns is fine by Tumbleweed · · Score: 1

      Well, the conversation here was headed in the direction of 'get everyone to agree on tab width before you start on a project,' so I'm arguing that if you can get people to agree to a tab width, you _should_ be able to get them agree to go the full distance and make everyone happy. Well, except for those poor emacs-using bastards. I'm amazed that, as feature-rich as that thing is, that the tab handling isn't configurable. *shrug*

      Whatever.

    27. Re:More then 80 columns is fine by Grishnakh · · Score: 1

      No, I'm sure emacs has configurable tab handling, just like almost any editor. I do question its default settings though. My point is that the problem isn't the software as much as it is the people. It's nearly impossible to get people to do things differently from the default setting.

    28. Re:More then 80 columns is fine by dfghjk · · Score: 1

      A tab moves to the next 8 column stop. Any other definition is a bastardization used by lazy programmers. Some editors get this right, and in doing so they become incompatible with some programmers' stupid idea that you should indent only with tabs and set tab stops to your preference. If all members of a project agree on what a tab stop is then there would be no issue.

    29. Re:More then 80 columns is fine by dfghjk · · Score: 1

      That's not genious. That's retarded.

      What you want is indentation that's consistent, standardized, and appears the same to everybody.

      You will never get a file that mixes tabs and spaces to look right if people have different tab-stop settings. It's impossible and impossibly stupid to do.

  21. Conventions are for the READER, not the author by rossifer · · Score: 4, Insightful

    What kills me is how few people realize that code conventions are not for their own personal readability of the code they write. Code conventions are for the benefit of the tens and possibly hundreds of people who are going to be reading the code well after you've moved on to another position.

    Also, for all of the people who assert that their convention (braces on the next line/end of previous line) is scientifically backed to be more readable than the alternative: most of the time, it doesn't matter nearly as much as consistency and being able to have the whole team agree.

    I happen to be the "conventions nazi" in my office (I was also the "unit test nazi" until we bought a tool that did it better than I could). I'm not an asshole about this issue because I'm a control freak, I'm an asshole because conventions really matter to the long term future of the project.

    The right way to be the "conventions nazi" is to get everyone into a room, get everyone to agree that consistency matters more than personal preference, then go down the list of issues and get some consensus (voting works well) on each one. Lone holdouts may need frequent reminding of the "consistency over personal preference" point. Don't leave the room until you have a set of conventions that (1) keep the code consistent in important ways (2) isn't so huge that nobody could hope to remember them and (3) can be easily supported by the tools commonly used by team members.

    Our convention is 132 characters on a line. Inner classes and Java/C++ class/method/variable naming conventions make 80 characters simply impractical. After trying it for a while, there were so many broken lines that the code was simply less readable. So we changed the convention and even though I was for 80 characters, I'm fairly happy with the improved readability of the code.

    Regards,
    Ross

    1. Re:Conventions are for the READER, not the author by Elwood+P+Dowd · · Score: 4, Funny

      As a VB coder who frequently gets lost in his own code while he's writing it, I'd like to assert that my code conventions are for my own personal readablity of the code that I write. If I went much over 60 chars per line, I'd have to scroll all the time to see the stuff that just ran under the File Explorer or the Properties Explorer or the control pallette. My usual response to this is to totally forget what function I was working on, and why.

      Oh, my God, I wish I was joking.

      --

      There are no trails. There are no trees out here.
    2. Re:Conventions are for the READER, not the author by samjam · · Score: 1

      If its for the readability of everyone else why not run it through a standard pretty-printer-reformatter thingy on cvs checking and run it through the users own favourite reformatting mode on cvs (or whatever) checkout?

      Sam

    3. Re:Conventions are for the READER, not the author by jc42 · · Score: 2, Interesting

      I've written scripts and/or aliases to do just this on several projects. Somehow, the code-format nazis never seem to appreciate it.

      But it makes a lot of sense to me. Different people have different preferences. Some have poor eyesight or are working on small displays or have to have too many windows open at once, and for them it makes sense to have narrow, vertically-formatted code. OTOH, people always complain about my tiny fonts and wide code, which I do because I find that I can only work on what I can see on the screen at once. Wasting a line to hold just a brace can materially limit what I can work on.

      If someone with vision limitations wants to read my code, I'd encourage them to reformat it however is best for their eyes.

      And in most languages, if your code can't handle this reformatting, there's something wrong with it. Canonicalizing it to a standard format shouldn't effect anything but its surface appearance.

      There are a few languages for which this isn't quite true, of course.

      --
      Those who do study history are doomed to stand helplessly by while everyone else repeats it.
    4. Re:Conventions are for the READER, not the author by rossifer · · Score: 1

      If its for the readability of everyone else why not run it through a standard pretty-printer-reformatter thingy on cvs checking and run it through the users own favourite reformatting mode on cvs (or whatever) checkout?

      I've tried that on two occasions in the past and talked to others who have had their own first hand experiences. Invariably, the reformatters tend to handle some conventions better than others and having everyone adjust their editor's settings to the team's conventions is a lot simpler for everyone. Syntax specific line breaks (try to break before an arithmetic operator but after a comma) tend to be iffy. Also, many of the conventions are not simply where spaces and braces go, but get into how to name things, how much stuff to put on a line, how to organize code in a file, what kinds of things to add extra documentation to, etc. None of which has a darned thing to do with formatting.

      Finally, many of the people who propose this aren't serious about actually setting up their own local conventions while respecting the team-wide conventions. In my experience, the person suggesting this has a persistent belief that their way is better than any other way but if the rest of the team can't see it, they'll be the mature one and offer a compromise position. They don't have any intention of actually following through on researching and setting up such an environment, but they're more than happy to suggest it. In the end, they don't yet accept the value of team-wide conventions and it's a big red flag that you're dealing with an immature developer who still believes there's exactly one way to solve engineering problems.

      You'll be able to adjust with only a little temporary discomfort, so deal with the discomfort and start communicating with the rest of your team like you're all a team. Also, being able to describe your attitude towards conventions as flexible will help during interviews. I've been asked about conventions in the last three interviews I've had and I always ask. The right answer is something similar to: "The team needs to have consistent conventions, but I don't have strong opinions that code should look a particular way."

      Regards,
      Ross

    5. Re:Conventions are for the READER, not the author by renehollan · · Score: 2, Insightful
      I call bull.

      It is well and good to have a sandard format that everyone agrees to read and represents the format in which source code is maintained in the source code repository.

      However, when writing code, it is a real hinderance to be forced to format things in a manner to which one is not accustomed. You spend too much time worrying about how to indent large function call actual parameter lists, long chained pointer indirections (i.e. foo->bar->entryIndex].reference->lookup[lookupInde x * lookupIndexScale + lookupIndexOffset].Value), rather than coding.

      The solution is to use a pretty printer program that is sophisticated enough to understand and generate the source repository form, and automatically reformat to the tastes of most developers.

      People were meant to code, not worry about indentation-nazis.

      The worst part of coding standards is when they are so poorly thought out that they make it impossible or at least very difficult to write certain syntactically-valid programs. This usually crops up when internal function documentation standards do not provide for non-fundemental types for parameters or require that their types be documented fully. It creates havoc with polymorphic impementations of different specific derived instances of an abstract base class: you have to repeat the function parameter type documentation over and over and over. Change the class and you have to update documentation in each implementation file. Code nazis I've encountered retort, "So? Don't use polymorphism. Newbie developers don't understand it anyway." The right answer is to encourage use of Javadoc, doxygen, or other tools to make the synchronization of code and internal documentation easier. C# supports this notion natively.

      But no, instead Mr. Code Nazi effectively takes away one of the most powerful OO concepts because some weenies "don't understand". Tell the weenies to slog fries at the local burger joint until they get a clue.

      The rules by which I like to code are (a) read anything formatted reasonably; (b) format new code I create any damn way I please (within reason -- I have to maintain it too); (c) defer to the style already present when maintaining legacy code.

      For all your code-nazi bluster, you're screwed when you decide to leverage some open source code that uses a different style and there's the possibility you might contribute your changes back to the official code base (you don't have to if you don't distribute your modified version). I suppose you can make "exceptions" for foreign code, but why shackle your own developers and not shackle outsiders? Seams ass-backwards to me. (Of course, the real reason is "because I can and it makes my code-nazi job look important).

      --
      You could've hired me.
    6. Re:Conventions are for the READER, not the author by ekidder · · Score: 1

      How about, instead of having standards people code to, have standard formatting tools. When people check out code, they apply their personal formatting, so things look like they want. When people check things in, they apply the group-standard formatting, so everything looks the same.

    7. Re:Conventions are for the READER, not the author by Metex · · Score: 1

      ok quick question then which convention is easier to read:

      void function ()
      {
      if
      {
      code code
      }
      else
      {
      cod code
      }
      }

      or

      void function () {
      if {
      code code
      }
      else{
      code code
      }
      }

      And yes this is a problem that I have delt with when coding with other people. I can read the first method really well since you just line up the } however I spit fire at seeing the 2nd method.

      --
      Never could figure out why my girl liked my bitch tits, then I found out she was a lesbian.
    8. Re:Conventions are for the READER, not the author by Halfbaked+Plan · · Score: 1

      For all your 'fashion coding' buzzwords, I just say yaaaaaaaaaa!

      --
      resigned
    9. Re:Conventions are for the READER, not the author by MarsDefenseMinister · · Score: 1

      In this day and age there is no reason for someone like you to suffer under a formatting Nazi. Just download a copy of indent or astyle and save yourself a lot of trouble.

      --
      No weapon in the arsenals of the world is so formidable as the will and moral courage of free men.-Ronald Reagan
    10. Re:Conventions are for the READER, not the author by More+Trouble · · Score: 1

      Code conventions are for the benefit of the tens and possibly hundreds of people who are going to be reading the code well after you've moved on to another position.

      And it's even more important if you'd like your code to become the basis of a successful open source project. By "successful," I mean "with code contributed by more than just you." While I think formatting beyond 80 columns reduces readability, there's a lot more to it than that. Everyone in my office adheres to the Indian Hills C Style Guide. And during code review, it's fair game to say "this code is impossible to understand, please write it more clearly or add extensive comments."

      :w

    11. Re:Conventions are for the READER, not the author by Elwood+P+Dowd · · Score: 1

      What a fascinating question. It had never occured to me that this predicament could come up in programming.

      --

      There are no trails. There are no trees out here.
    12. Re:Conventions are for the READER, not the author by ttfkam · · Score: 3, Insightful

      So tell me. How much should I respect you if I am your boss? You've just told me that despite the myriad choices and possibilities available in programming that you cannot adapt to a simple change in bracing style.

      If it takes you more than a week to get accustomed to a new formatting style, you will forgive me if I doubt your ability to adapt to a new compiler or new editor or new operating system or development library.

      And please stop with the strawman of forbidding polymorphism. Yes, there are moronic shops that forbid certain practices that can be instrumental in solving certain problems. But the parent clearly wasn't talking about those instances. This wasn't a discussion of functionality, it was about aesthetics. Deciding about the amount of whitespace, the capitalization patterns, the bracing style, and the line length do not fall under your diatribe.

      And frankly, if you cannot adapt from

      if (1) {
      }

      to

      if (1)
      {
      }

      to

      if ( 1 )
      {
      }

      or from

      write_file()

      to

      writeFile ()

      to

      Write_File( )

      your problems extend far deeper than your code style.

      The question boils down to, "Which formatting style is best?" The answer is simple: "Whatever everyone else on your team is doing." If you cannot adapt to something as simple as this, you cannot be effective in a team. If you cannot be on a team, you are fundamentally useless to 99% of all projects out there. There are better ways to express yourself in code than through bracing style. If formatting style is the best way you can assert your skills and individuality, what does that say about your skills as a programmer overall?

      Have a nice day.

      --

      - I don't need to go outside, my CRT tan'll do me just fine.
    13. Re:Conventions are for the READER, not the author by rossifer · · Score: 1

      The worst part of coding standards is when they are so poorly thought out that they make it impossible or at least very difficult to write certain syntactically-valid programs.

      I agree. To my mind, the only thing worse than no conventions are conventions that get in the way of effective development. Your polymorphism example seems particularly egregious. In order to prevent something similarly annoying, our documentation standard leverages javadoc, which since the 1.2 jdk, allows for the inheritance of method documentation. Our documentation standard further leverages a well-organized code base. You're allowed to refer to documentation in another class if it means your code is clearer and easier to understand.

      People were meant to code, not worry about indentation-nazis.

      Which is why the little effort I do put into that responsibility is in helping people configure their tools to support the conventions automatically. If you have to put a lot of effort into formatting conventions, you're using the wrong conventions and/or tools. Since you've obviously got your panties in a twist over the issue, I suggest you look into a better development environment.

      For all your code-nazi bluster, you're screwed when you decide to leverage some open source code that uses a different style and there's the possibility you might contribute your changes back to the official code base (you don't have to if you don't distribute your modified version). I suppose you can make "exceptions" for foreign code, but why shackle your own developers and not shackle outsiders?

      Contributing to an outside project means you conform to that project's conventions. I use emacs and Eclipse as editing tools. Both allow you to have multiple auto-align rulesets resolved by project (Eclipse) or directory (emacs). I suspect that other editing tools have similar capabilities, even if you have to swap in a different config file and restart the environment. A little self-awareness lets you conform to another project's non-formatting conventions at the same time.

      What conflict were you envisioning again? Arguments like yours call you out as a programmer in desperate need of personal growth and seasoning. If you want to work in a team environment, that is. If you want to work by yourself, it doesn't matter if you insist on doing it your way...

      I suppose you can make "exceptions" for foreign code, but why shackle your own developers and not shackle outsiders?

      You missed the whole point of my posting, but we are on slashdot, so... Conventions (including formatting conventions) aren't for or against the programmer. They're for the people who come later. Asking them to clean up your mess for you doesn't really do anyone any favors.

      (Of course, the real reason is "because I can and it makes my code-nazi job look important).

      If it makes you feel better to believe that, go right ahead.

      I predict that you wouldn't last a month on our team. Your attitudes towards conventions are just a symptom of the underlying attitude problems that would put you at odds with every developer I'd ever want to work with.

      Regards,
      ross

    14. Re:Conventions are for the READER, not the author by slothman32 · · Score: 1

      First I'll give you a hint. Never hire me and if you see me at a company you can fire me without legal recourse from me. I actually gave up a job because of stupid, IMO, conventions.
      Let's say you bosses say I want indents to be 70 spaces. would you find that reasonable? What if there was no chance of you changing their opinion, would you quit or enforce in anyways or just ignore it? That's the problem with conventions, they do help with consistency but if they are incompatible with someone that person, perhaps the best coder ever, can't work there.
      I guess the best way is to use some sort of IDE or something modern that allows the person to change it to their liking. Similar to the "indents are x spaces" in many editors. Only they would see it "wrongly" but it would be better to them. How it is stored in CVS or what the compiler sees would then become irrelevant.
      About you "voting room." What if out of 100 coders 90 want 1 style and 10 another? Should the 10 get screwed for the "good of the team." Democracy doesn't work for everything.

      --
      Why don't you guys have friends or journals?
    15. Re:Conventions are for the READER, not the author by rossifer · · Score: 1

      If reading the second one is problematic for you, your issues are deeper than formatting conventions.

      Most people mentally key off of the indention of a particular line of code, not the braces surrounding it. Despite all anecdotal assertions to the contrary.

      You just like having open braces on their own line. Great. Can you join our team writing code where everyone else is putting the opening brace at the end of the previous line? No? Then you're going to be out of a job in short order.

      We can't afford to cater to every whim of a prima donna. And we don't.

      Regards,
      Ross

    16. Re:Conventions are for the READER, not the author by mike_sucks · · Score: 1

      "The solution is to use a pretty printer program that is sophisticated enough to understand and generate the source repository form, and automatically reformat to the tastes of most developers."

      Yeah, that works fine except that when translating your crack-induced style to the normal form and back again screws up revision control diffs, thereby making them completely useless.

      Also, your little rant about documentation basically boils down limitations in tools. Javadoc since 1.4 (1.3, maybe) automatically provids docs for methods you've overridden but not supplied documentation comments for in the source.

      "The rules by which I like to code are (a) read anything formatted reasonably; (b) format new code I create any damn way I please (within reason -- I have to maintain it too); (c) defer to the style already present when maintaining legacy code."

      a) correct
      b) god, I'd hate to work with a selfish arsehole like you
      c) correct

      "For all your code-nazi bluster, you're screwed when you decide to leverage some open source code that uses a different style and there's the possibility you might contribute your changes back to the official code base"

      What, you're not suggesting copying and pasting the code in are you? What decade do you live in, the _70's_? Up here in the 00's, we have this thing called code reuse. Wonderful things like OO and libraries and oh my! In cases like this, we apply rule (c) that you mentioned above.

      Sounds like someone had a bad day at the office.

      --
      -- "So, what's the deal with Auntie Gerschwitz et all?"
    17. Re:Conventions are for the READER, not the author by mike_sucks · · Score: 1

      Because when you format back and forth, you invariably break diffs generated by revision control software.

      Stuff like:

      foo () {
      some really long line
      }

      becomes:

      foo ()
      {
      some
      really
      long
      line
      }

      becomes:

      foo() {
      some really
      long line
      }

      or whatever.

      It's a pain in the arse.

      --
      -- "So, what's the deal with Auntie Gerschwitz et all?"
    18. Re:Conventions are for the READER, not the author by rossifer · · Score: 1

      if they are incompatible with someone that person, perhaps the best coder ever, can't work there.

      If a person cannot bring themselves to conform to the team's conventions, then yes, they cannot work there.

      Here's the REALLY BIG HINT all over again. If "the best coder ever" can't get along with the rest of the team members, they aren't the best coder for our team.

      The best way is to be adaptable and realize that the exact conventions don't matter. If it takes you more than two days to adapt to new conventions, then you aren't a very good developer.

      About you "voting room." What if out of 100 coders 90 want 1 style and 10 another? Should the 10 get screwed for the "good of the team."

      How is having to produce code consistent with standards different from your own cause you to be "screwed"? Is the only way for you to express your creativity in source code by having your personal conventions? Will you lose your identity if you have to work in a project where the tab indent is different from what you'd prefer?

      In direct answer to your question, the ten developers should not have agreed at the start of the conventions meeting that consistency was more important than individual personal preferences. If they agreed to that, they agreed to compromise on those issues where they would prefer to do it slightly differently.

      Be willing to adapt and compromise or be ready to be alone for the rest of your life.

      Any time you're in a relationship with someone else, whether as a teammate on a software project or in a romantic relationship, you're going to have to compromise from the way you want to do things. Compromise does not mean that you lose your identity. Compromise does not mean that you are always caving in to unreasonable requests (to answer your first strawman).

      But you will have to compromise if you want any relationship to last.

      Regards,
      Ross

    19. Re:Conventions are for the READER, not the author by mike_sucks · · Score: 1

      The second, by far.

      Use indentation, not braces: The braces are probably going to be pushed off the bottom of the window for long functions/methods whatever, and your brace style just make this problem worse.

      --
      -- "So, what's the deal with Auntie Gerschwitz et all?"
    20. Re:Conventions are for the READER, not the author by Anonymous Coward · · Score: 0
      've tried that on two occasions in the past and talked to others who have had their own first hand experiences. Invariably, the reformatters tend to handle some conventions better than others and having everyone adjust their editor's settings to the team's conventions is a lot simpler for everyone.

      I think you're full of crap, or you'd have mentioned it in your first post.

    21. Re:Conventions are for the READER, not the author by rossifer · · Score: 1

      Why? The point of the first post was not to argue all issues around conventions but to explain why they're there. The second post was to respond to an occasionally raised objection by those who really think their way is the right way.

      I tend to avoid this whole line of argument by interviewing for A players. One side effect of being an A player just happens to be an almost automatic ability to adjust to conventions.

      So I rarely if ever hear it any more...

      Regards,
      Ross

    22. Re:Conventions are for the READER, not the author by Anonymous Coward · · Score: 0
      I tend to avoid this whole line of argument by interviewing for A players.

      With the way you keep subtly changing your position with each new objection, I'll bet your "A Players" laugh at you behind your back.

    23. Re:Conventions are for the READER, not the author by Anonymous Coward · · Score: 0
      As a VB coder who frequently gets lost

      But you repeat yourself.

    24. Re:Conventions are for the READER, not the author by Elwood+P+Dowd · · Score: 1

      You say that as if you had made the joke. Rather than me.

      --

      There are no trails. There are no trees out here.
    25. Re:Conventions are for the READER, not the author by irc.goatse.cx+troll · · Score: 3, Interesting

      The first one makes code folding useless.
      I'd paste an example, but the slapdash lameness filter won't let me, so just paste the code into vim, add (expression) after the if statement (not needed, but shows a point), and set these things:

      :set foldenable
      :set foldmarker={,}
      :set foldmethod=marker

      then "zc" while on the if { line and it should collapse all of that block down to one line showing the if statement, indentation level, and how many lines are folded. Now try it on the first method, and it has no idea what the if statement is which now awkwardly sits on top.
      Which ones easier to work with?

      --
      Pain lasts, kid. Its how you know you're alive. Sometimes I think this growing up thing is just pain management-TheMaxx
    26. Re:Conventions are for the READER, not the author by sol9991 · · Score: 1

      i am a java programmer who is forced to make money
      by writing vb com++ and c#.net

      i feel so much shame

    27. Re:Conventions are for the READER, not the author by Anonymous Coward · · Score: 0
      You obviously missed the part where he said:
      The solution is to use a pretty printer program that is sophisticated enough to understand and generate the source repository form, and automatically reformat to the tastes of most developers.
    28. Re:Conventions are for the READER, not the author by ClosedSource · · Score: 1

      Well, it seems you're well informed about the conventional wisdom in this area. The problem is that this idea that consistency aids maintenance has never really been proven.

      For an alternate view, try adopting a convention that everybody on the team hates. If consistency is all that matters, then it should work fine. The problem is that the alpha programmers won't get their way.

    29. Re:Conventions are for the READER, not the author by Anonymous Coward · · Score: 0

      I don't like the first. Too much wasted space, but what I hate more is how a coworker of mine programs:

      void function ()
      { /* Start Function */
      if
      { /* if */
      code code
      } /* end if */
      else
      { /* else */
      cod code
      } /* end else */
      } /* End Function */

      He comments every single brace and almost nothing else.

    30. Re:Conventions are for the READER, not the author by Mr+Z · · Score: 2, Informative

      I find tools like GNU indent to be handy for fixing grossly misformatted code. I don't like what they do to the subtlties of good code formatting.

      For instance, suppose I'm doing the same operation with different parameters. Something like this (with periods to show the spaces):

      some_funky_api (10, . 5, . .11, . 3);
      some_funky_api ( 3, 113, MAGIC, 114);
      some_funky_api ( 0, . 0, . . 0, . 0);
      some_funky_api (33, .33, . .33, .33);

      Now what happens if I run this through the typical code autoformatter? I get something like this:

      some_funky_api (10, 5, 11, 3);
      some_funky_api (3, 113, MAGIC, 114);
      some_funky_api (0, 0, 0, 0);
      some_funky_api (33, 33, 33, 33);

      You see, sometimes you can subtly format your code such that the physical layout highlights the similarites and regularity of the code, and the text that remains highlights the differences. (Also, tools like "rectangular cut-n-paste" work well with code like that....) Automatic reformatters don't see that subtle layer of structure and destroy it.

      That's why I'll only use them as a phase of cleaning up some horribly tab-damaged sh*t.

      --Joe
    31. Re:Conventions are for the READER, not the author by rossifer · · Score: 1

      Well, it seems you're well informed about the conventional wisdom in this area. The problem is that this idea that consistency aids maintenance has never really been proven.

      Actual proof is rarely available when you get into sciences, especially the "soft sciences" including psychology. If you want to get quantitative data on how source code organization may affect ease of perception, you're going to pay for the study yourself or wait for a very long while. Nothing is actually "proved" around statements like this one. So consensus based on anecdotal evidence is used as a proxy for evidence and we keep going.

      In this case, in the experience of people who have had to maintain software projects they did not start, source code that is organized the same way from file to file takes a less time to understand than code which reflects a dozen different styles across the code base. Since the conventional wisdom in this case matches very closely with my personal experience, I'll stay with it until compelling evidence is presented that the conventional wisdom is wrong.

      For an alternate view, try adopting a convention that everybody on the team hates. If consistency is all that matters, then it should work fine. The problem is that the alpha programmers won't get their way.

      Strawman, and not a very good one.

      Apparently, you missed my paragraph on how to select conventions. Conventions are normally adopted under the principle of "least argument". If everybody likes a convention, we use it. If nobody likes a convention, we don't use it. A limited-time discussion followed by a vote works great to fulfill this goal. Second, conventions are not all created equal and if "everybody on the team hates" a convention, odds are that using the proposed convention is actually a bad idea, not just contrary to the desires of the alpha programmers. If you're all using a bad convention (50 spaces per indent), the value of consistency is outweighed by the cost of the poor convention.

      Hire smart people. Then, expect them to work together and trust them to be smart. If your top programmers don't like something, there's probably a good reason behind their objections.

      Regards,
      Ross

    32. Re:Conventions are for the READER, not the author by ClosedSource · · Score: 1

      "If you want to get quantitative data on how source code organization may affect ease of perception, you're going to pay for the study yourself or wait for a very long while."

      The fact that evidence is difficult or expensive to obtain doesn't negate the need for it to prove something. Anecdotal evidence isn't that illuminating, but in my 20+ years of software development experience I haven't found the consistency of names to correlate in any way with the difficulty of understanding code someone else has written.

      "Strawman, and not a very good one."

      After reviewing your entire original post I admit that you never said that consistency was all that mattered the way I "remembered" it. I believe the experiment I proposed was a good one for testing someone's commitment to that argument, but it wasn't exactly yours.

    33. Re:Conventions are for the READER, not the author by Anonymous Coward · · Score: 0

      "I tend to avoid this whole line of argument by interviewing for A players."

      You forgot the "K" before the "A".

    34. Re:Conventions are for the READER, not the author by Anonymous Coward · · Score: 0

      "I predict that you wouldn't last a month on our team. Your attitudes towards conventions are just a symptom of the underlying attitude problems that would put you at odds with every developer I'd ever want to work with."

      In other words, people who disagree with you have "attitude problems" (i.e. they don't share your opinions) and consequently they would be at odds with every developer you'd ever want to work with (i.e. developers that share your opinions). Sounds like a team attitude to me.

    35. Re:Conventions are for the READER, not the author by renehollan · · Score: 1
      Just download a copy of indent or astyle and save yourself a lot of trouble.

      If you reread my comment, that's esentially what I suggest for the published form of code in the source code repository.

      The type of code-nazi to which I refer is the kind that would have people who used automated tools to do this fired (and yes, I've suffered briefly in such shops during hard times), and insist that people manually count spaces.

      The idea is to produce such a layer of overhead that everyone looks "busy" without being productive.

      --
      You could've hired me.
    36. Re:Conventions are for the READER, not the author by renehollan · · Score: 1
      You've just told me that despite the myriad choices and possibilities available in programming that you cannot adapt to a simple change in bracing style.

      No.

      I've said that because of the wide variety of formatting tools available to produce a "standard form", it should not be necessary for an individual to conform to an arbitrary standard.

      More pointedly, how much should I repect a manager and coworkers who can not adapt to my style if I can adapt to theirs?. How do they adapt to foreign code which uses a different style? Reasonable stylistic differences should not matter.

      There is an argument to be made for the format of the "official" version of the source code published to the repository. But, not one of the styles you suggest is inherently better than any of the others and enforcing manual adherence to any of them is simply a power trip -- you do it because you can, or to accomodate those who can't (or won't) adapt to trivially different variations.

      If you twist the argument, and purport to produce a "published form" standard, then you need to address far greater issues than indentation depth and symbol naming conventions: how to break long code lines, what the precendence is between syntactic elements (to know where to break a long line first), etc. Ideally such a standard should cross language boundaries with relative ease.

      Why not apply the same layout rules to function actual argument scope as to basic block scope as to array index scope (particlarly in languages that natively support multidimentional arrays), that is, have a rule for breaking up "lists of things separated by a common syntactic element, and delimited at either end with other syntactic elements"?

      If your shop codes in C, C++, or C#, and you dictate that private members start with lower case names, and public members start with upper case names, what do you say about protected members, for example? Too many shops I've seen punt, and forbid their use simply because their internal standard didn't address them.

      Ultimately, manual source code reformatting is a fool's errand because eventually you will inherit external code not formatted to your standard and will have to understand it and deal with it in the way you received it (so you can contribute or compare with changes in the official distribution tree). If you need to enforce a manual formatting standard, your team is not adaptable or disciplined enough to "do the right thing" on their own.

      --
      You could've hired me.
    37. Re:Conventions are for the READER, not the author by renehollan · · Score: 1
      RSH>The worst part of coding standards is when they are so poorly thought out that they make it impossible or at least very difficult to write certain syntactically-valid programs.

      I agree. To my mind, the only thing worse than no conventions are conventions that get in the way of effective development. Your polymorphism example seems particularly egregious. In order to prevent something similarly annoying, our documentation standard leverages javadoc, which since the 1.2 jdk, allows for the inheritance of method documentation. Our documentation standard further leverages a well-organized code base. You're allowed to refer to documentation in another class if it means your code is clearer and easier to understand.

      This is the correct approach. However, for every one person that encourages that approach, there are at least four (in my 20+ year career) that don't and simply generate manual stylistic overhead requirements. At least half of those forbid the use of automated tools to make the task easier, "because they might be buggy", or "only match 95% what I dictate the standard to be". Again it's fine to have a code publishing standard, but folly to apply it at code editing time unless you want to and your editor supports it. But, I have seen shops with coding standards so capricious and arbitrary that no automatic pretty-printing tool supports them 100% and the person responsible be unwilling to adapt to something reasonably close that was supported by an automated tool.

      Perhaps you are fortunate to not work in such a shop. Currently neither do I (thanks arbitrary deity-of-the-week). But I've seen them: code nazis with nothing better do do that to watch people type in editor windows and yell when you hit one space too many, or apply an automatic reindentation function.

      RSH>People were meant to code, not worry about indentation-nazis.

      Which is why the little effort I do put into that responsibility is in helping people configure their tools to support the conventions automatically. If you have to put a lot of effort into formatting conventions, you're using the wrong conventions and/or tools. Since you've obviously got your panties in a twist over the issue, I suggest you look into a better development environment.

      My objection is amimed at shops that outlaw the use of such tools. Code Nazis I've met actively prevent the use of alternate development environment -- to the point of forbidding installation of emacs even if vi is the "standard editor" and is installed as well.

      RSH>For all your code-nazi bluster, you're screwed when you decide to leverage some open source code that uses a different style and there's the possibility you might contribute your changes back to the official code base (you don't have to if you don't distribute your modified version). I suppose you can make "exceptions" for foreign code, but why shackle your own developers and not shackle outsiders?

      Contributing to an outside project means you conform to that project's conventions...

      Exactly! So, why not treat each individual as an outside project? Standardize on the output, but not the input. Frankly I don't want to work with people who can't adapt to an arbitrary stylistic convention: I'll maintain their code in their style, and they'll maintain mine in mine -- or reformat to and from the repository standard. You give greater deference to outside developers than to your own? Sounds like a power trip to me.

      ...A little self-awareness lets you conform to another project's non-formatting conventions at the same time.

      This presumes that the local Code Nazi let you.

      What conflict were you envisioning again? Arguments like yours call you out as a programmer in desperate need of personal growth and seasoning. If you want to work in a team environment, that is.

      I specifically do not want to work in a team where others have difficulty with minor stylistic conventions. I've bee

      --
      You could've hired me.
    38. Re:Conventions are for the READER, not the author by ttfkam · · Score: 1
      I've said that because of the wide variety of formatting tools available to produce a "standard form", it should not be necessary for an individual to conform to an arbitrary standard.
      So we have a few possibilities. (a) We can put source through the formatter before we start editing and after we finish. (b) We can put an auto-formatter on the source repository. (c) We can get a team meeting and majority rules.

      The first is labor intensive and prone to forgetfulness when someone just wants to put a few patches in. The second is a royally bad idea as what you are checking in is not what you were working on. Most of the time it won't be an issue most likely, but it breaks a fundamental source control rule: test before you commit. To put rigor back in, you have to make the code changes, test it, put it through the formatter, test again, and then commit. You don't want to format at the first step because you're still working on it in your own formatting choice. The only other choice is to test redundantly.
      More pointedly, how much should I repect a manager and coworkers who can not adapt to my style if I can adapt to theirs?. How do they adapt to foreign code which uses a different style? Reasonable stylistic differences should not matter.
      No one said that you had to change. If most of the people on your team prefer your method, then stick with it. I think of source in this case like insurance forms (or some other form).

      You can have no end of formatting choices for those forms. All of the forms can have basically the same information. However, when looking through all of these forms for certain bits of info, if all of the forms are different or if you have four or five different formats, finding that information becomes harder for the human eye/brain. If all of the forms are of the same format, if the information being looked for is in the same location each time, searching is faster, easier, and more reliable.

      This is of course a loose analogy, but let me put this into more concrete terms: the Java source standard.

      lowerFollowedByMixedCase = property
      lowerFollowedByMixed() = method/function
      UpperFollowedByMixed = class
      foo.doSomething() = instance method
      Foo.doSomething() = method at class scope
      Foo.ALL_CAPS = a class constant

      In other words, without knowing anything at all about the code, I can look at any Java code following this standard and know where to look next. I know whether something is an instance variable or a class declaration. This is something that is sorely missed on the C, C++, et al. end of things. No, I'm not saying that mixed case variable naming is the best. I like it, but not everyone does. That's not my point. My point is that with consistency comes the enhanced ability to spot check code that others wrote (and that I wrote six months ago). It allows for faster and easier understanding of code.

      Braces are a minor addendum to this point. Yes, they are relatively unimportant. But they are also easy to adapt to. When in doubt, err on the side of ease of reading.

      Braces can be formatted easily. Many other things that are useful for code comprehension cannot. I'm not talking about more strawmen like "banning protected members because they don't fit the code guidelines." I never said a thing about reducing the toolset available to coders. Your job as a coder is to get it working. Bracing style has NOTHING to do with getting it working whether the brace is on the same line or not. It has to do with consistency and readability. And just as with comments, these things should not be tacked on at the end as an afterthought.

      Switching brace style is basically instantaneous for me. For most others, it may take part of a day. For the really slow ones, it may take a second day. In any case, it takes less time to learn to do this than it takes to use a formatter over and over again. Yes, the formatter only takes a second or two, but you're advocating it's use for every piece of code you work on.
      --

      - I don't need to go outside, my CRT tan'll do me just fine.
    39. Re:Conventions are for the READER, not the author by Nynaeve · · Score: 1

      If the lower brace is pushed off the visible screen, you should probably break some of it out into a separate function.
      The number of lines in any function should be kept as small as possible, about 60 or so, but that's for another "Ask Slashdot". :)

    40. Re:Conventions are for the READER, not the author by mike_sucks · · Score: 1

      Even if they are 60 lines long, they'll fall off the bottom of my 80x40 emacs windows. :)

      --
      -- "So, what's the deal with Auntie Gerschwitz et all?"
    41. Re:Conventions are for the READER, not the author by renehollan · · Score: 1
      So we have a few possibilities. (a) We can put source through the formatter before we start editing and after we finish. (b) We can put an auto-formatter on the source repository. (c) We can get a team meeting and majority rules.

      The first is labor intensive and prone to forgetfulness when someone just wants to put a few patches in. The second is a royally bad idea as what you are checking in is not what you were working on. Most of the time it won't be an issue most likely, but it breaks a fundamental source control rule: test before you commit. To put rigor back in, you have to make the code changes, test it, put it through the formatter, test again, and then commit. You don't want to format at the first step because you're still working on it in your own formatting choice. The only other choice is to test redundantly.

      (a)A few patches generally do not justify reformatting, no. But, it's easy to automatically reformat on checkin and checkout, optionally, with most source code control systems worth their salt. Most developers I know do not care about the style of something to which they're making a minor change. The kicker comes when they have to add several dozen or hundred lines of code (a few functions) quickly. The new code is formatted how they like and reformatted on checkin.

      (b) shouldn't be an issue: If the compiler cares about stylistic issues it's a bad compiler and too fragile to be trusted in general. Test before checkin catches the most common things that might "break the build" but you should still do regular builds out of the repository because it won't catch all. So, you're still covered.

      (c)Majority rules is a bad idea when the majority of developers are inexperienced, as is usually the case. This is precisely what leads to crippling coding standards the run counter to effective development: Manager decided "majority rules" and the majority has chosen something crippled, which is then "etched in stone". It takes a wise manager to poll for concensus and "sanity check" it.

      My point is that with consistency comes the enhanced ability to spot check code that others wrote (and that I wrote six months ago).

      This presumes that most of the code reviewed, maintained, or adapted comes from people who followed a known standard. That is rarely the case over a full project lifecycle. At best, you can apply the standards to a subset of the code which, at first, will be most (if not all) of it, but will become a shrinking part of the code base over the project lifecycle: whole teams will be replaced and will inject their idea of a "better" coding standard.

      Java is a bit different here, because the conventions are more bound to the use of the language (and Javadoc) than C or C++. So, it is much more likely that external contributions might already follow a defacto standard. The trouble starts when one foolishly thinks the same is true of other programming languages, or that it should be.

      Again, there is no "right way", save that which might accidently arise by common convention, or langage "owner" decree. Far better to invest in tools that can reformat to the standard du jure when different styles become an issue. It's a job for machines, not people.

      One area where such "standards" fail misserably is when one has clever table-driven programs. These really are internal implementation languages in their own right, albeit disguised, and generally benefit from styles related to their particular scoping rules. These might conflict with the general styles related to the "outer" language used for the program that ultimately interprets the tables. This is why any style guide should care about issues of scope and attribute rather than elements of a particular language.

      Switching brace style is basically instantaneous for me. For most others, it may take part of a day. For the really slow ones, it may take a second day. In any case, it takes less time to learn to do this than it takes to use a formatter over and over again.

      --
      You could've hired me.
    42. Re:Conventions are for the READER, not the author by julesh · · Score: 1

      As a VB coder [...] If I went much over 60 chars per line

      Last time I used VB, the IDE whined at you if you pressed enter before you had a complete statement (as it tried to compile it and got a syntax error), so formatting to any width other than "a complete statement on each line" was impossible. I take it this has been fixed in more recent versions?

    43. Re:Conventions are for the READER, not the author by Elwood+P+Dowd · · Score: 1

      You have to break lines in half with an _
      underscore.

      All the fucking time.

      --

      There are no trails. There are no trees out here.
    44. Re:Conventions are for the READER, not the author by Kombat · · Score: 1

      I can read the first method really well since you just line up the } however I spit fire at seeing the 2nd method.

      Then you're a poor coder. The second method is 28% more efficient (8 lines vs. 11 lines). Thus, if someone coded using the first convention instead of the second, I might have to scroll the page to see the entire method. Using the second convention, the entire method might fit on one screen, making it easier to read.

      What is gained by putting a '{' on a line all by itself? Does it really need to be on a line all by itself, several times in a given class? What is lost by pulling that '{' up onto the parent line?

      The second convention is clearly superior, due to its easily-calculable enhanced efficiency, and is (in my opinion) easier to read.

      --
      Like woodworking? Build your own picture frames.
    45. Re:Conventions are for the READER, not the author by renehollan · · Score: 1
      Yeah, that works fine except that when translating your crack-induced style to the normal form and back again screws up revision control diffs, thereby making them completely useless.

      Crack-induced? Grasping at straws, are we?

      If the best counter to chosing to put opening braces on a line by themselves, or to indent by a different number of spaces is to call it "crack-induced", then I fail to see why one style is necessarily better than another. Defering to a mob, likely to exert influence in an area smaller than that from which they will inherit code, is not justified by any reasonable measure. If one style is not "better" than another by some objective metric, then why chose it? Furthermore, why is it difficult to adapt to the style in a particular file? Perhaps it is because the mob is unable to cope with more than a single style and insists on restricting others the same way. This is folly, as they almost certainly will inherit code where they lack influence over the style, so the whole exercise is moot and a power trip.

      That said, an argument can be made for a consistent publishing and source code repository style for locally generate code. You prettyprint to the repository style before you check in the first time, and every time after that, so revision control diffs do not break. This requires automated prettyprinting on checkout to a preferred style, but if reformatting to one's style of choice can not be automated, then it is likely quite odd (and this is the only deference to standard on this issue that I will admit).

      god, I'd hate to work with a selfish arsehole like you

      By the same token, I hate to work with a selfish mob that naively thinks that a common style in which to edit is necessary any better than any other reasonably structured one and that is likely to match what they inherit.

      --
      You could've hired me.
    46. Re:Conventions are for the READER, not the author by mike_sucks · · Score: 1

      I said "Crack induced" because that's how you sounded, and that's how you are sounding now.

      "if reformatting to one's style of choice can not be automated, then it is likely quite odd"

      The problem being you need to reformat from your personal choice to whatever is the standard whenever you aren't just editing the code locally - when compiling, committing, diffing, whatever, so that all other interactions with your code match the standard. The first case makes your life difficult because line numbers on debugging symbols stop matching what is in your codebase and what others see, as does the latter because your diffs won't match your code.

      In any case, I would suggest that it is quicker to adapt to the standard style (not that hard) than modifying your complete toolchain (if at all possible) and working around the differences whenever you compare your code with that of other's (for all eternity).

      "By the same token, I hate to work with a selfish mob that naively thinks that a common style in which to edit is necessary any better than any other reasonably structured one and that is likely to match what they inherit."

      Gee, and the selfish mob expect you to do work for the hours they pay you for. How naive.

      a) it's in your own interest
      b) it's in the company's interest
      b) welcome to capitalism, where the good of the Man comes before the good of the you.

      --
      -- "So, what's the deal with Auntie Gerschwitz et all?"
    47. Re:Conventions are for the READER, not the author by Anonymous Coward · · Score: 0

      Although 'Groups'["teams"] certainly have their uses, they are not the fundamental unit of accomplishment, and when allowed to proliferate unchecked, tend to expand to the limit of available resources and then tend to stagnate. - HackNeed

    48. Re:Conventions are for the READER, not the author by andyfaeglasgow · · Score: 1

      Authors who find it difficult to stick to the conventions defined could use a simple tool to convert the code appropriately before submitting it to the repository.

      This is the approach taken by jgrapht.

    49. Re:Conventions are for the READER, not the author by renehollan · · Score: 1
      The problem being you need to reformat from your personal choice to whatever is the standard whenever you aren't just editing the code locally - when compiling, committing, diffing, whatever, so that all other interactions with your code match the standard. The first case makes your life difficult because line numbers on debugging symbols stop matching what is in your codebase and what others see, as does the latter because your diffs won't match your code.

      Now, who's smoking crack?

      When developing, you reformat to your preference, and all debug information matches what you've got -- about the only time this breaks is if you've got external references to precompiled components with a different layout. But, even then, if that code requires your attention during a debug cycle, it's not hard to reformat and recompile. (This does presume that all source is available to you, and a preponderance to "build everything (that matters)" in a build cycle. That is less than ideal, of course, but typical as most shops don't bother with proper dependency checking to be confident enough to not have to build everything all the time).

      There is a tradeoff in managaing code in multiple presentations, and, indeed, sometimes it is not "worth it". However, when adding large blocks of new code, the freedom to lay it out as one likes buys a lot of time.

      When you're ready to checkin, you again reformat to the standard, and generate diffs as appropriate (if necessary). To share context diffs requires only two things: an original version in a known format, and a diff that applies to that format. With originals in standard and personal formats, and a modified version in one of the two formats, generating diffs to either original is trivial.

      I suppose that one could make the argument that all that reformatting takes too long, and without an understanding of the toolchain, this might be true. But to presume that just because something is time consuming for one, or even many, means that it is time consuming for all is folly. Processes which improve productivity by 20% for 8/10 developers on a team are useless when they kill productivity by 90% for the other 2/10 developers who are already an order of magnitude more productive than the rest (and this is typical in a shop). Before: Productivity = 8 * 1 + 2 * 10 = 28. After: Productivity = 8 * 1 * 1.2 + 2 * 10 * (1-0.9) = 9.6 + 2.0 = 11.6. Ideally, you want to be in a situation where you get the 20% boost for the mob, but only take a 5% cut for the rest: 8 * 1 * 1.2 + 2 * 10 * (1-.05) = 9.6 + 19 = 28.6. But, even here, the slightest impediment to your "best" hurts a lot.

      Gee, and the selfish mob expect you to do work for the hours they pay you for. How naive.

      Incorrect.

      A common empoloyer may. Furthermore I don't "work hours". I am either salaried or work on contract.

      The problem does not stem from reasonable alternate formatting styles. The problem stems from a need to very rapidly contribute hundreds or thousands of lines of code to a project without getting bogged down in the details of a particular formatting style, or worse, a style that prevents some syntactically valid programs from being written.

      Perhaps I have been lucky, but I have never had to suffer idiot managers or coworkers for very long. However I have met some real idiots in my day (like people who don't realize that sizeof adds to portability and does not detract from it).

      In any case, I like to have an "out" that permits me to escape standards lunacy where necessary -- shops that insist on a presentation style yet refuse any type of automated tool to help achieve that style for example.

      Draconian dictation of program formatting style is a sign of inflexibility that interferes with getting a job done and tends to go hand in hand with an inability for developers to handle abstract designs and OOD and OOP in general -- the common focus being an incapacity to generalize what "reasonable formatting" is, and so requ

      --
      You could've hired me.
    50. Re:Conventions are for the READER, not the author by Anonymous Coward · · Score: 0

      The question boils down to, "Which formatting style is best?"

      Not really. That implies that the primary goal of formatting is consistency. Your example only illustrates how various forms of expression reduce to the same algorithm. That's fine, it's one of the first things we teach to programming students, but it's not all we're interested in when writing code.

      The more important question by far concerns how to encode meaning. As you point out, formatting is not for the compiler. Instead it serves to aid communication between people.

      This means that if you run my code through a reformatting filter, what comes out will be algorithmically equivalent, but will be stripped of some of the meaning I deliberately encoded into it.

      Okay, some people have careless, illegible indenting styles, just as some people have no taste when choosing symbol names. Others, like me, put a lot of effort into these things, so that when you come to read my code, you can see the morphology and symmetries and know that they were put there to help reinforce its meaning and readability. Of course I'm willing to adapt to local conventions, because they too are intended to enhance meaning. But only if you're a mediocre programmer does it stop there.

    51. Re:Conventions are for the READER, not the author by ttfkam · · Score: 1

      No arguments from me.

      --

      - I don't need to go outside, my CRT tan'll do me just fine.
    52. Re:Conventions are for the READER, not the author by mike_sucks · · Score: 1

      "When developing, you reformat to your preference, and all debug information matches what you've got -- about the only time this breaks is if you've got external references to precompiled components with a different layout."

      Here's some more areas where it breaks:
      - talking to other staff
      - sending a diff to someone else
      - receiving a diff from someone else
      - generating diffs from non-local sources like ViewCVS
      - debug line numbers from other staff/customers

      "But, even then, if that code requires your attention during a debug cycle, it's not hard to reformat and recompile"

      Ah, that would be you who is smoking crack. Nice numbers, BTW. Did the magical productivity fairies leave them under your pillow last night? Wait, wait, you also believe IQ tests are a reasonable measure of intelligence, don't you?

      "Furthermore I don't "work hours". I am either salaried or work on contract."

      Right, so your contract doesn't specify how many hours you are expected to show up and do work? Here's a hint, your salary is determined by your hourly rate multiplied by the number of hours you are expected to work per day/week/whatever. In fact as a salaryman, if you are in the tech industry you're probably going to be required to work overtime without remuneration.

      You know, the last half of your rant makes you sound like some pimple-faced school boy.

      --
      -- "So, what's the deal with Auntie Gerschwitz et all?"
    53. Re:Conventions are for the READER, not the author by Anonymous Coward · · Score: 0

      What kills me is how few people realize that code conventions are not for their own personal readability of the code they write.

      Then you will like my (work) code. It's formattet exactly like you that, completely unreadable to me, and I hate making any changes to it. Unfortunately, that's what I do the most.

      I don't have that problem at home. My personal projects are formatted for MY readability, not some hypotetical programmer who might take over the project after I die.

      All that time wasted (but why do I care, I still get paid), instead of just having the poor man run "indent" or something once he takes over the code, so it matches what he can read. He probably won't prefer what you prefer anyway.

    54. Re:Conventions are for the READER, not the author by renehollan · · Score: 1
      Here's some more areas where it breaks:

      - talking to other staff

      Sigh.

      I am not talking to other staff when, er, I'm not talking to other staff.

      It should be obvious that one trivially reformats to a publication standard to discuss it.

      The whole jist of your argument appears to be "don't work this way because it will reduce your productivity, and see, when you work that way, you are more productive than average." Experience has taught me that, no, it doesn't reduce my productivity just because it might reduce someone else'sm and if you left me alone, I'd be five times more productive still.

      Disbilief of my assertions might be one thing, and understandable, but to ignore the proof when the pudding has been presented, is moronic.

      I am not arguing that it is impossible to deal with a foreign formatting standard. I am arguing however that this (a) slows down implementation (counting spaces and looking up style rules just to open a new basic block), and (b) enough to have a noticible effect on productivity.

      Perhaps you do not find typing speed an implementation bottleneck, but those of us who regularly crank out 20k lines of production quality code a month, do. For an 8 hour day, that's around 30 seconds per line of code. Stopping to worry about style is going to kill that by a noticible margin. At some point, one leaves the design phase and has to implement. The "how" answered, the "picture of the code" clear in one's mind, the last distraction one needs is "does this break style?"

      And yes, I have the world class profitable shipping products under my belt to back those quality, and bravado assertions. You've probably used them if you make telephone calls.

      Take some time to research productivity and quality metrics across professional developers some time: you'll find a one (some would argue as much as two) order of magnitude difference between best and average. Of course, if you've never been "in the zone", you would not believe this possible.

      Right, so your contract doesn't specify how many hours you are expected to show up and do work?

      No. It specifies what is to be done, and when it is to be delivered. If that means 10, 20, 40, 80, or 120 hours a week of work, so be it.

      When salaried, the only metric is "ship what works on time", with the implied requirement "even if this means taking the time to fix other people's fuckups". Teamwork is not "everyone goes to the company-sponsored social event". It's "You drop the ball, I catch it."

      In fact as a salaryman, if you are in the tech industry you're probably going to be required to work overtime without remuneration.

      You don't get it, do you?

      For a hard-core hacker, it isn't about overtime, or salary. Money is nice, of course, but I do what I'd do because I'd do it anyway. So, the concept of "overtime without remuneration" is meaningless -- the pleasure comes from the work. The compensation is a nice side effect that takes care of essential needs.

      Is that an attitude ripe for employer abuse? Of course it is. However, abusive employers and managers soon find that there are plenty of employers out there who are not abusive, and when the time is right, it's "Adios!" The funny thing is that better working conditions have tended to go hand in hand with (substantially) more money. I've never encountered an enjoyable job that, otherwise, paid badly.

      One can argue that "work is not life", but if you spend 30-50% of your time doing something, it better be something that you enjoy doing, and that, ultimately, work is, indeed, a major part of life.

      --
      You could've hired me.
    55. Re:Conventions are for the READER, not the author by mike_sucks · · Score: 1

      "Disbilief of my assertions might be one thing, and understandable, but to ignore the proof when the pudding has been presented, is moronic."

      I'm looking, but so far I haven't seen any such evidence in your argument. Maybe I am a bit dense, can you summarise it for me?

      "I am not arguing that it is impossible to deal with a foreign formatting standard. I am arguing however that this (a) slows down implementation (counting spaces and looking up style rules just to open a new basic block), and (b) enough to have a noticible effect on productivity."

      *This* is where tool support is useful. Set up Emacs/vim/whatever so that it implements in-house style rules. When you commit, checkstyle (or similar) runs and prompts you to fix formatting errors before the changes are accepted in the repo.

      Then, if you are producing a new line of code every thirty seconds over an eight-hour period (which I in no way whatsoever buy into), that means would be producing a new C-style block maybe every few minutes. You would be writing tens of if-then-else per hour, hundreds per day. You would get used to it, quickly. If the project was less than a week, sure that would suck, but for the next week-long project you would be fine.

      Before I continue here, from the arguments you make, it has become clear you have worked on few projects where you had to interact with other people. In essense, it sounds like you would normally start working on a project and stop only when you feel like you have done enough for the day/night/whatever. It sounds like you work in an room, by yourself, without any communication with anyone else except at the start and end of the project.

      It doesn't sound like you have been part of a team working on a product, or part of a team working on a component that gets used by other developers. When doing so, especially when working in parallel and when your code it going to be use by others (or vice-versa) efficient communication is essential. In such projects, over time, it is quicker to get used to a common formatting/style convention then it is to constantly convert beack and forth. Even if you don't use the standard, you will soon get used to it because you'll be constantly reading it and interpreting it.

      If you are not working on such projects, then sure, use whatever style you want. If there is a code convention (many smaller companies/businesses don't have them) then set up your tools to reformat on checkout/diff/commit. Go for it.

      I find it is interesting to note that most open source and free software projects have their own coding conventions and won't accept patches against the codebase unless they are formatted correctly. All of the big ones (Apache, the BSDs, the Linux kernel, GNU, Mozilla) require this. I think you'll find that few, in fact none of the contributors reformat as you suggest. No, I do not have any evidence to back this up, suffice to say I have never heard of anyone actually doing what you suggest. Not once. Never.

      Show me two people who work with a coding style that is different from whatever the standard is and who reformat back and forth, as you suggest. Please. I'd love to talk to them.

      Why do you think it is that, in reality, such people don't exist?

      "No. It specifies what is to be done, and when it is to be delivered. If that means 10, 20, 40, 80, or 120 hours a week of work, so be it."

      I have never seen such a contract, certainly not in Australia, although I conceed that it may be different in other countries. This would suprise me greatly, however because it makes poor business sense. Leaving such things unbounded leaves the employer open to cost blowouts. A devious person could easily pad developement time out by a significant, costly amount.

      "You don't get it, do you?"

      Yes, I do. Hacking is what I do. In my spare time, I hack on my own projects and have contributed to many free software and open source projects (Gnome, Mozilla, Apache, others). I have been lucky enough to have always be

      --
      -- "So, what's the deal with Auntie Gerschwitz et all?"
    56. Re:Conventions are for the READER, not the author by renehollan · · Score: 1
      I'm looking, but so far I haven't seen any such evidence in your argument. Maybe I am a bit dense, can you summarise it for me?

      I didn't think I had to cite every reference... I've noted ratios of productivities within a team. Google for the appropiate documentation to back that up. But, basically, a 10% hit on someone who's 10 times more productive than average hurts a lot more than a 10% hit on someone who's average.

      *This* is where tool support is useful. Set up Emacs/vim/whatever so that it implements in-house style rules. When you commit, checkstyle (or similar) runs and prompts you to fix formatting errors before the changes are accepted in the repo.

      That would be good, yes... if the shop permitted this. However, the shops I've experienced with the most draconian formatting and layout rules also forbid the use of automated tools to support them! The shops with a more relaxed atmosphere, and a "recommended" style, generally encourage their use.

      I remember a shop which required 120 pages of internal documentation for some 6000 lines of new code produced within 2 weeks. Well, doxygen is your friend here, and helped get the work done on time, with the support of all teammates, particularly those who used it before. Management, however, decided that using such a tool was "unproved" and "risky" and the work was to be redone manually, with now slip in schedule and a day left! This, after the fact, with excellent results (printed, and hyperlinked online docs). Needless to say, I buggered out of there pretty damn quick, to the dismay of those who would have liked me on their team (which was not permitted without the approval of one's current manager -- a real biggoted arsehole if I ever met one). Getting paid a nice bundle more, too.

      These same kind of morons who will take a common coding style position and not consider the overhead of conforming to it. In extreme situations, the benefits often do not outweigh the costs. I'm called upon the "save the day" in just those kind of extreme conditions, when someone has, for example (this is a real world example), delivered 8000 lines of multithreaded Java code but was oblivious to the use of the "sychrinized" keyword, and that, gues what, doesn't work, with three days before an integration deadline. The last thing I will worry about is ensuring I adhere to a formatting style -- It's my job to make it work, on time -- never mind that I haven't seriously used Java before.

      Is that how development should be done? No, of course not. In a "perfect" world, we'd have the luxury to take the time to adapt to what ever conventions exist. Unfortunately, development is far from perfect, and the best are usually called upon to clean up the dirtiest mess.

      Your point appears to be that a common style improves communication and therefore productivity. That it does, but it is not the only thing that does so, and carries a burden of it's own. Better developers also adapt to differeing styles when necessary to read them. It's the writing that's a pain when you're in a crunch. When 90% of the work is making sure the i's are dotted and the t's are crossed, something is wrong. And this overhead increases with productivity.

      Before I continue here, from the arguments you make, it has become clear you have worked on few projects where you had to interact with other people. In essense, it sounds like you would normally start working on a project and stop only when you feel like you have done enough for the day/night/whatever. It sounds like you work in an room, by yourself, without any communication with anyone else except at the start and end of the project.

      It doesn't sound like you have been part of a team working on a product, or part of a team working on a component that gets used by other developers.

      Lesse, ADAS+: 100+ developers in three locations; RMU75x: 8-16 developers delivering a test head to BT to teast "each pohone line, every night".

      Once the task boundaries ar

      --
      You could've hired me.
    57. Re:Conventions are for the READER, not the author by Anonymous Coward · · Score: 0

      Yeah, and that REALLY improved readability and made it easy to join / split lines as you wanted to... .
      Is this still the case in VB.net?

    58. Re:Conventions are for the READER, not the author by Elwood+P+Dowd · · Score: 1

      Dunno. I wish that mattered to me.

      --

      There are no trails. There are no trees out here.
    59. Re:Conventions are for the READER, not the author by mike_sucks · · Score: 1

      "But, basically, a 10% hit on someone who's 10 times more productive than average hurts a lot more than a 10% hit on someone who's average."

      That may or may not be the case, but that 10% hit will diminish as you get used to the standard format. Eventually it will be 0%. Also, the more styles you use the faster you adapt to a newer one. I'm pretty comfortable slipping into a new style these days. But if you're contantly reformatting, you're constantly going to be taking a performance hit over the entire length of a project. It's just not worth it.

      "However, the shops I've experienced with the most draconian formatting and layout rules also forbid the use of automated tools to support them!"

      Well that's just completely insane. Did they also forbit the use of compilers and have you enter machine-code directly? I assume you got the hell out of there.

      "It doesn't sound like you have been part of a team working on a product, or part of a team working on a component that gets used by other developers."

      Sigh. Of course I have. Of those projects you listed, you're telling me that someone handed a design down from on high, it was perfect, and each of you shut themselves in your office and worked on your own code and at the end, it was all put together and it all worked? I don't believe it.

      Using XP *demands* that everyone use a common formatting style. From the low-level concepts: Because one half of the pair actually writes the code, the other provides commentary and ideas for a while, then they swap. To the high: No-one "owns" some code: Anyone can come in a fix it. Constant integration and unit testing means you'll be getting and finding bugs all the time, rather than whenever the tree actually builds - so you'll be communicating with other developers *all* the time.

      "The work should be defined and deliniated well enough so that one can work in isolation 80-90% of the time"

      No, I disagree. Developers should know what they are writing and a provided with the support so that they can work on their part 100% of their time.

      But regardless of the actualy percentage spent working on some code it doesn't mean they won't be interacting with other developers during the time you are working on somthing. Especially if you are using code produced by other developers, or vice-versa.

      "What I usually find is that often I have to go back and correct someone else's work."

      Which is annoying, but what does that have to do with source code formatting?

      "See: you have to accomodate multiple styles, even if you have an internal one."

      Yes, thanks for proving my point: You need to accomodate multiple styles. So you may as well get used to working in multiple styles.

      The first rule of any useful sorce code convention is something like: "Use whatever style is currently in use in the source file you are working on". The second is "All new projects must commit source files conforming to these conventions".

      "Most of the people I've enjoyed working with. Are they that rare? Anyone, who's had to adapt a popular open source code base within a project with a different house style."

      I'm sorry, but I simply don't belive you. Very few open source projects run any sort of tool checking for correct formatting upon commit. Thus most of the codebase conforms to the convention in place, but never strictly so. If someone takes a random source file, converts it to their style of choice and makes a change, the diff is going to contain a *lot* of spurious deltas. It just doesn't work. This problem also exists for companies that don't use a tool to check formatting upon commit.

      "How? If anything, the cost is bounded to be fixed and not a function of implementation time in excess of estimate."

      Yes, so your project is going to cost $n and take m hours to complete. So you got paid $n/m per hour. You are "doing hours". This is especially the case when on a salary because you aren't salaried per project. If you aren't working on a projec

      --
      -- "So, what's the deal with Auntie Gerschwitz et all?"
    60. Re:Conventions are for the READER, not the author by renehollan · · Score: 1
      But if you're contantly reformatting, you're constantly going to be taking a performance hit over the entire length of a project. It's just not worth it.

      Not if you have your tools properly set up: any shop that has a mandated repository source code format should provide tools to convert to that format. The tool can count spaces and apply rules better than you can, and won't make a mistake (of course, it won't bend the rules when appropriate either). Editor support is one aspect of the supporting tool set -- you wouldn't suggest a formatting standard not supported by most editors, would you? (Agh! I can see editor wars heating up for lack of support for a given formatting standard -- now that would be ass-backwards).

      Well that's just completely insane. Did they also forbit the use of compilers and have you enter machine-code directly? I assume you got the hell out of there.

      I got out of there, yes, but it took a while. We were explicitly forbidden from developing any tools, on our own time, at home, that might make our lives easier either: the reasoning was that if we were willing to work, we'd be told what to work on.

      But such shops are, sadly, not that rare, and a call for a common formatting standard, without caveats or reservations, results in absurd requirements when used in such a place, like, "We can't leverage or modify Apache for our needs or write a module for it. If Apache wants us to use it, they will defer to our coding style."

      Yes, thanks for proving my point: You need to accomodate multiple styles. So you may as well get used to working in multiple styles.

      Except, that was not your original point, which was to conform to a master style. That is, as I've said, a fool's errand, when one has to deal with legacy or imported code from other projects, internal, or external. It would have been folly, for example, for me to have enforced a coding style for all components of the custom RH-6.2 Linux distro I developed in-house.

      If I have to adapt to alternate styles, I expect my coworkers to do so as well. In fact, I will be less inclined to conform to your style, if you do not extend the same curtesy to me. The justification for a common repository style does not come from mob rule, and, even then, it has limited applicability if your repository caches foreign code.

      Yes, so your project is going to cost $n and take m hours to complete. So you got paid $n/m per hour. You are "doing hours".

      No, I got paid $n, and would have gotten paid $n (for contracted work) even if the project took twice as long (or less, if I agreed to penalty clauses). I may have earned money at a rate of $n/m dollars per hour, but that's not the same thing: the rate was established by my productivity and not by contract. The same holds, although to a lesser degree, when salaried: too low a productivity and I'd be spending many extra hours working.

      I'm sorry, but I simply don't belive you. Very few open source projects run any sort of tool checking for correct formatting upon commit.

      Teradyne, c. 1998: source reformatting on checkin was du rigeur for text versions of Rational Rose UML exports. Of course, Clearcase made this easy to implement (as well as email notifications to "interested" parties on checkin, etc.) and it was extended to other checkins. Clearcase was, of course, an expensive ($1000/floating seat/year) pig of a source code control application, but it had some nice features, nevertheless.

      My original point was that you are paid to do the work, so you're going to do it how they want, or not get paid.

      Not for very long, I won't, if the process adds inefficiency or is designed to compensate for inadequacies of poor staff. Such companies do not do well, in the long run and I have no desire to be part of their downfall.

      "What I usually find is that often I have to go back and correct someone else's work."

      Which is annoying, but what does that have to

      --
      You could've hired me.
  22. we stick to 120 by HunterD · · Score: 1

    Here is the realistic situation. 80 columns was created as a formatting standard because of punchcards. Mosto fthe people I know have moved to 120, with the following justifications:

    A) pretty much all editors support more then 80 columns, and if you want to use an old version of VI that can't do mroe then 80, it's not really yopur right to enforce your unwillingness to stick even remotly code to the state of the art on everyone else.

    B) most programmers have a screen roughly in the 1280x1024 category, and it is a benefit to be able to *use* the extra real estate

    C) 120 works fine for printing in landscape.

    --
    - The unexamined life is not worth leading -
    1. Re:we stick to 120 by ezzzD55J · · Score: 2, Insightful

      Reasonable, however here is my rationale for wanting to stick to something less with code - you can have 2 files open at the same time, visible next to each other, at the same time, with maximum height.. all screen real estate used. I find this really convenient for having two .c files open, where one is calling the other, or a .c file and a .h file, etc..

    2. Re:we stick to 120 by norkakn · · Score: 1

      I stick to 80 also, but I usually use Xemacs to open two files above and below each other. I personally find this easier, but more power to you.

      The reason I use for sticking to 80 is that is it just so much easier to scan through

    3. Re:we stick to 120 by julesh · · Score: 1

      80 columns was created as a formatting standard because of punchcards.

      Actually, I'm pretty sure the origin of the 80 column standard is that that's how many characters you get on A4 paper portrait with 2cm margins and 12pt Courier. (And, I believe, "Letter" paper with 1 inch margins is the same, although perhaps some US hacker will correct me on that one...)

  23. A solution? by dacarr · · Score: 1
    OK. Problem with 80c is that it makes it hard to indent your code. So the solution is obvious. Eschew the [TAB] key and don't indent your code.

    It's still hard to read, but hey, it'll fit in 80 cols in emacs just fine now.

    --
    This sig no verb.
  24. Cry me a river... by antiher0 · · Score: 1

    Yeah yeah... this is gonna sound harsh...

    But really... is the 80 column limit that important to you?

    You know that you can bump up the number of columns on console displays, right?

    Read here :)

    There are also a number of tools available to put code in a form that you find agreeable.

    1. Re:Cry me a river... by Anonymous Coward · · Score: 0

      But I don't know how to double the number of pixels available on a flat panel display. With 1024x768 you really can't go over 80 chars and still be able to work with multiple windows. Sure, if you want to run DOS, 132 chars is no problem, but the advantage of Windows/X/MacOS is to be able to have multiple windows on the screen.

  25. People still print code? by waynegoode · · Score: 1
    People still print code? I gave that up when I got a 17" monitor many years ago and could finally see enough code. Now with my 21" at 1600x1200, I can fit more code on my screen than I can on a page.

    Having said that though, I just started my first project where the 80 columns limit was specified. The customer, who writes some of the code for the project, does still print code. So, I'm finally limiting code to 80 columns.

    1. Re:People still print code? by Dan+Ost · · Score: 2, Insightful

      When looking at another programmer's code, it's very convienent to print it,
      write notes, questions, and corrections on it, and then give it to them. If the
      code doesn't print well, then this becomes more difficult to do. If the code
      is unprintable, then you're reduced to writing notes some place else (email?)
      and referencing line numbers which is far less natural than simply writing
      notes beside the code in question.

      --

      *sigh* back to work...
  26. I miss 80 colums by Marxist+Hacker+42 · · Score: 1

    But on a 1200X768 monitor, 80 columns is only about 1/8th of the screen in a readable font- I prefer 132 column limit these days.

    --
    SJW: a person who perceives an injustice, and while correcting it, commits a greater injustice.
  27. 80 col silliness by Anonymous Coward · · Score: 0, Funny

    80 columns are the devil! Why, my
    Osborne uses 52 columns and the ][e
    uses 40 columns. Everybody should
    reformat everything to 40 columns now,
    lest they jeopardize cross-platform
    compatability :-)

    AND EVERYBODY SHOULD USE ALL CAPS
    BECAUSE NOT ALL MACHINES CAN DISPLAY
    LOWERCASE CHARACTERS!

  28. That assumes... by gidds · · Score: 1
    ...that you're using a monospaced font! Personally, I much prefer to use a proportional font.

    Whoah there, all you folks who are about to reply questioning my eyesight, my coding abilities, or my sanity! Yep, I know what I'm doing. Yep, I've used 'vi' till it's come out of my ears (don't ask), and it's cool for certain types of editing. But I find that monospacing tends to give undue emphasis to small punctuation marks, and generally makes code far harder to read at a glance. I know code doesn't look exactly like English text, but I seem to read them in a similar enough way that similar layout works well for both.

    Of course, I know I'm in a minority, so I don't expect everyone else on the project to do the same. But the important thing is that if the code is well formatted, you should be able to read it in whatever editor you prefer, in whatever font, with whatever other preferences. If you're laying out your code to match a particular editor, IDE, or whatever, then you're adding a dependency, and making it harder to switch in future.

    But then, even with a monospaced font and an 80-character window, what's the major problem with the occasional long line? Any decent editor will scroll or wrap it for you, so following the needs of the code shouldn't cause that much inconvenience. (And if it does, you're probably using the wrong editor!)

    --

    Ceterum censeo subscriptionem esse delendam.

    1. Re:That assumes... by Dan+Ost · · Score: 2, Informative

      You should try Donald Knuth's CWEB environment. It combines coding and
      documentation into a single deliverable. I really like some things about
      it (the pretty printing is beautiful), but haven't made it my default yet.
      Warning: requires a little TeX to take full advantage of the documentation aspect.

      Check it out at http://www-cs-faculty.stanford.edu/~knuth/cweb.htm l

      --

      *sigh* back to work...
    2. Re: That assumes... by gidds · · Score: 1

      Is that the same sort of thing as JavaDoc?

      --

      Ceterum censeo subscriptionem esse delendam.

  29. Readability by rangek · · Score: 4, Informative
    It is well known that beyond a certain width, readability drastically decreases. Here are some more links:

    Some random "web development" site

    Scroll down a bit to get to the chars per line bit

    All of these basically agree that more than 80 chars per line is quite hard to read.

  30. Geeks are too anal by ClosedSource · · Score: 1

    I think this issue is really about how geeks love to create rules for everything and think everyone should follow their lead. Don't we have enough functional bugs in our code to worry about without finding additional ways for code to be defective (layout, column limits, naming conventions, etc.).

    1. Re:Geeks are too anal by tommck · · Score: 1

      THe whole point to coding conventions is to make the code more readable to a group. Thus, making it easier to find those bugs!

      I find very long lines very hard to read. Think of it in terms of statistical analysis... if you graph the lenghts of all the lines and there are serious outliers (like 150 chars), they should be brought closer to the mean :)

      --
      ---- It puts the lotion on its skin or else it gets the hose again. It does this whenever it's told.
    2. Re:Geeks are too anal by ClosedSource · · Score: 1

      Well, we all have our personal preferences.

      Often a coding convention can be quite a distraction from finding bugs because violations of it are usually the "low-hanging fruit" of a code review. Why slog through all that logic stuff when you can contribute to the meeting by pointing out that someone left off the sz prefix for a string variable?

      If you're going to enforce a coding convention, perhaps the best way would be to have a knowledgeable administrative assistant go through the code looking for violations and report back to the team lead. Then after addressing those issues, conduct a code review with the programmers. In that review, only allow comments on logic issues and not on convention violations.

    3. Re:Geeks are too anal by tommck · · Score: 1

      Though everything you said makes sense, it all _supports_ having a coding standard.
      You were saying that people are being too anal and that an 80 character limit is not needed.
      Now it seems that you think someone ELSE needs to be anal about it, but it needs to be done?

      Do you support it or not?

      --
      ---- It puts the lotion on its skin or else it gets the hose again. It does this whenever it's told.
    4. Re:Geeks are too anal by ClosedSource · · Score: 1

      I don't support it and I don't see how anything I've argued supports it either. I simply said that you can minimize some of the negative effects by having someone other than your programming staff enforce it.

      I didn't say anything specific about an 80 character limit either. My point is that too much time energy and money is spent on non-functional "correctness".

      You can take code from one organization and give it to another with different coding standards and suddenly that code is defective. This is a cultural issue and has nothing to do with engineering or science.

    5. Re:Geeks are too anal by Anonymous Coward · · Score: 0

      Actually, most coding conventions come from managers and other "style above function" people (including teachers), and are hated by the geeks.

      Geeks generally don't like rules. However, although you can call the 80 character limit a rule, it's more about readability. It makes it possible to read the entire line at once, without scrolling. Most geeks will follow this "rule" without ever thinking about it, simply because it makes sense. Well, not in a "hard rule" sense, they may cut at 78 or 82 or 95 instead, but they still have limit.

  31. E-mail by Belgand · · Score: 1

    Using 80 columns is still very important (in my mind at least) when it comes to e-mail. Due to the differences in readers, wrap styles and so on it quickly becomes an issue. When was the last time you got something where the replys quickly screwed up and shattered something readable into a mess of short lines and quoted symbols stuck in the middle of sentences?

    A good e-mail program will properly wrap text to fit within these limits (specifically thunderbird comes set by default to wrap to 72 columns). If people are using HTML e-mail though... well, hell, they're already wrong to begin with.

  32. not really by wotevah · · Score: 1

    Um, no: http://www.jwz.org/doc/tabs-vs-spaces.html

    1. Re:not really by Tumbleweed · · Score: 1

      Um, yes. The page you quoted explains the situation adequately, then, DESPITE having the solution, advocates doing the exact wrong thing! Fucking amazing how people just don't get this.

      Tabs ARE a character, and should be TREATED as a character (since they ARE). Therefore, the emacs way is fucking idiotic, and the vi way is correct. I've never advocated one over the other for any other reason, until now (I hate the interfaces of both programs, so it didn't matter to me before now; UI-wise, they both suck pretty badly).

      By using tabs as a character (which they ARE, by definition), you solve this entire situation. If your editor doesn't treat tabs as a character, it's BROKEN, and should be fixed or replaced.

    2. Re:not really by Anonymous Coward · · Score: 0

      TAB is character in the same way as a the terminal bell is one.

    3. Re:not really by wotevah · · Score: 3, Interesting

      There are a few things in your post that you seem to feel strongly about, which are plainly false or wrong, and which made me think twice about replying. But I'll do it anyway.

      First, the emacs interface is not idiotic. It's not idiot-friendly, I give you that. vi's and emacs' interfaces do not suck. They are however tools meant to increase productivity if you spend the effort to learn them. And they do. If you go by the definition that a good UI is one you can just start using, then they don't have a good UI. Their are powerful tools way beyond joe or pico or whatever it is you consider a good UI that is not "broken".

      TAB is a special character. It is not printable, you need to convert it to a series of spaces to do that. Treating it as a character would mean inserting ONE item in the line, not a variable number depending on your current position.

      Finally, think about it for a moment.
      - A file with space indentation will look the same everywhere.
      - A file with TAB indentation will look good only when your TAB width setting happens to match the author's, so when you open such a file you have to figure that out and change your TAB setting first (which gets old really fast).

      The reason for that is that not all code starts on a TAB boundary, some of them may have a few more spaces (for example where wrapping a function call). Which begins to look nasty when your idea of what a TAB is differs from the author's. And don't say that everyone should use the standard 8-space TAB to fix that problem.

      Lots of programs already use TAB for something else, emacs is not the only one. Bash is another one. Any decent command-line interface now uses TAB for auto-completion. I'm sure there are other examples. If TAB were really a character they would just display it instead, I suppose.

    4. Re:not really by More+Trouble · · Score: 2, Informative

      You might be interested in the Unix commands "expand" and "unexpand".

      :w

    5. Re:not really by Anonymous Coward · · Score: 1, Informative

      A file with TAB indentation will look good only when your TAB width setting happens to match the author's, so when you open such a file you have to figure that out and change your TAB setting first (which gets old really fast).

      Not if it's done correctly, i.e. you indent the code to the current indentation level using tabs, and never use them anywhere else.

      You can add extra tabs to indicate a continued line, but you must not try to align it with anything on the previous line. If you need to line up characters on 2 lines, the lines must start with the same number of tabs (i.e. they must be at the same indentation level), and spaces must be used following the initial tabs.

      It takes a bit of effort to follow these rules, but if you do, nobody should ever be able to tell which tab setting you used. Since tabs are only used at the beginning of a line, it doesn't matter whether a tab is expanded to X spaces or moves to the next tab stop.

      IMHO, the worst problem is editors which mix tabs and spaces when indenting, assuming a tab is always 8 characters (such as mcedit when using "fake half tab" mode). If you use 4-space tabs, each pair of consecutive indentation levels end up at the same column; with 2-space tabs, deeper indentation levels are often displayed to the left of higher ones.

    6. Re:not really by raju1kabir · · Score: 1
      TAB is a special character. It is not printable, you need to convert it to a series of spaces to do that. Treating it as a character would mean inserting ONE item in the line, not a variable number depending on your current position.

      By your logic, when someone inserts a carriage return, should we instead insert VT100 control sequences to move the cursor to the beginning of the next line and possibly scroll the screen up? Because that's the equivalent of indenting with spaces.

      Tab is a control character that tells the output driver to do a specific thing: Move the cursor to the next tab stop. The implementation details of this process are unimportant at this level, and by mixing them in with the data stored in the file, you are creating confusion and dooming thousands more to have to put up with files full of those damnable spaces.

      The answers to these problems are simple.

      • Anyone who uses an editor that inserts spaces when tab is pressed (unless this behavior can be, and is, turned off) shall be shot.

      • Anyone who presses the spacebar twice in succession in any context where the space characters will be stored in a file, shall be shot.

      • Anyone using a GUI editor that cannot display the difference between spaces and tabs, shall be shot.

      A few simple rules and harmony is restored. A lot of idiors' corpses to clean up but them's the breaks.

      Lots of programs already use TAB for something else, emacs is not the only one. Bash is another one. Any decent command-line interface now uses TAB for auto-completion.

      So what? Regular expressions use question marks for special purposes. Does that mean we're not allowed to ask questions anymore. An editor is an editor, a shell is a shell. Nobody is using libreadline for a visual editor.

      --
      "Patriotism is your conviction that this country is superior to all other countries because you were born in it." -- GBS
    7. Re:not really by wotevah · · Score: 1
      You can add extra tabs to indicate a continued line, but you must not try to align it with anything on the previous line. If you need to line up characters on 2 lines, the lines must start with the same number of tabs (i.e. they must be at the same indentation level), and spaces must be used following the initial tabs.

      Try that. The code below written with 8-space TABs with the function arguments properly aligned on two lines, will look like this when reading it on a 2-space TAB setting :

      ..myObj = myFunc( argOne, argTwo,
      ......argThree, argFour );
      (just think that dots are spaces).
    8. Re:not really by wotevah · · Score: 1

      The parent post requested that TAB be treated as a character because "it obviously is one". I said no, it is a special character that is treated differently by the display module than say, "A", "B", "C" or " " are. The actual implementation is irrelevant to the scope of my argument, so long as the visual result is a variable set of spaces that replaced the TAB (which it always is). CR is also a special character, I don't see the logic inconsistency you are trying to point at.

      Tab is a control character that tells the output driver to do a specific thing: Move the cursor to the next tab stop. The implementation details of this process are unimportant at this level, and by mixing them in with the data stored in the file, you are creating confusion and dooming thousands more to have to put up with files full of those damnable spaces.

      What's funny is that you explained precisely why TABs are unfitted for code. The fact that their display is dependent on the interpretation of the reader (as I illustrated in a previous post) makes them unfit to display structured code consistently. Space indentation exhibits no such problem.

      "damnable spaces", now that is some misdirected anger. You have a problem with respecting someone else's conventions, seems more like to me. Your other suggestions are just funny.

    9. Re:not really by __david__ · · Score: 1
      I think you missed something. He was saying you indent the lines with a combination of spaces and tabs. Use tabs to get to the same indentation of the last line, and spaces to get the args out underneath the other args:
      [tab][tab]myObj = myFunc( argOne, argTwo,
      [tab][tab]................argThree, argFour );
      "." being a space in this case. After that no matter what tab width you use, the function args will always line up.

      I just wish I could get my emacs to do that style of tabbing, since it really makes the most sense.

      -David
    10. Re:not really by wotevah · · Score: 1

      You're right, I did miss that, thanks for pointing it out.

      But it strikes me as a somewhat contrived rule that you'd have difficulty enforcing as a convention, considering that everybody uses TAB as a way to skip faster through the beginning of the line to where you want to start typing (which I believe was the reason they existed on typewriters who don't have autorepeat like our keyboards do).

    11. Re:not really by __david__ · · Score: 1

      Yes, for style of indenting to work you need really good editor support which is why I don't actually use that technique.

      Have you every used emacs? It's use of the tab key is novel (I think). Tab doesn't insert a tab when you're editing source code. Tab indents the line to where it should be. "Where it should be", of course, is completely customizable. A few other editors have this feature now too, I believe. I used to be annoyed that I couldn't manage that white space by myself but I quickly realized it's much better that way.

      Anyway, if emacs knew how to do that tabbing style then I might consider switching to it, but we do have people at work that use CodeWrite for editing and I don't think it has a similar mode.

      -David

    12. Re:not really by Tet · · Score: 1
      Nobody is using libreadline for a visual editor.

      Actually, vim implements readline-like functionality when you do file management, for example with :r or :e. I think it does this using its own internal routines rather than using libreadline, but the priciple's the same. Overall, though, I agree with your sentiments. When I type a tab in my text editor, I expect it to insert 0x09 into my file. Any other behaviour is simply wrong.

      --
      "The invisible and the non-existent look very much alike." -- Delos B. McKown
    13. Re:not really by Anonymous Coward · · Score: 0

      You're an idiot. When you type the letter "n" in emacs, it treats it as the command "insert character 'n' at point." You can redefine it as you like, and thus we have things like viper-mode.

      Similarly, (depending on the major mode) it treats typing "[TAB]" as a command to intelligently indent the line to the correct position. Thus, it is idempotent, and you can tab from any point on a line. Everybody I know who has used emacs (obviously, you haven't) thinks this behavior is best. Of course, if you want to change the key binding to make typing "[TAB]" mean "insert the tab character at point," you can easily do that as well.

  33. zerg by Lord+Omlette · · Score: 0, Flamebait

    There are plenty of people who write code longer than 80 characters per line. They're called "assholes".

    --
    [o]_O
  34. well-known saying... by Polo · · Score: 3, Funny

    It's well known that the saying "80 column mind" means that you're narrow minded. Google it. :)

  35. Solution by alexo · · Score: 1

    Why argue when you have this?

    1. Re:Solution by rangek · · Score: 1

      What if your program isn't in "C, C++, C#, or Java"? How does this interact with CVS, SVN, or other source control systems?

  36. How old are you? by ttfkam · · Score: 1

    16? With all of the choices available to code with -- languages, libraries, operating systems, compilers, etc. -- your main gripe is bracing style? Are you fucking kidding?

    Let me put it this way. Let's say that I'm a prospective employer. I'm looking for someone with a good head on their shoulders, that works well with a team, and can adapt to new situations. Then I hear you say the above statement. So far, what I know of you is that bracing style is a religious doctrine for you, you will not respect any preferences but your own, you will waste time bitching about a coding style instead of getting work done (the "spit fire" comment), and you expect that a codebase could or should have more than one coding style in it -- that or "my way or the highway."

    Most employers want someone who works well in a team. "Team" usually implies working together toward a common goal. It requires some uniformity in process. But you aren't even willing to be swayed by something as trivial as bracing style. You probably have an enormous opinion of yourself and yet cannot adapt to a perfectly valid and trivially different coding style.

    Nice.

    The sad part is, you're useless to both commercial and Free Software camps. Commercial software won't like you for the above reasons. Free Software projects all have different idioms and coding guidelines. Imagine their chagrin when some hotshot comes in and starts spitting fire simply because of bracing style.

    Grow up. Learn to adapt.

    --

    - I don't need to go outside, my CRT tan'll do me just fine.
    1. Re:How old are you? by ClosedSource · · Score: 1

      You need to go figure out whether you think bracing style is trivial or not. Apparently it is for the individual, but not for a group.

  37. Code is not prose by ttfkam · · Score: 1

    All of those studies you referred to are speaking of prose. If anything, they speak to having 80 column multi-line comments.

    Show me a study that compares code at 50 columns, 80 columns, 132 columns, and 200 columns and you'll get my full attention.

    Also of note: the first link which advocated shorter line lengths is on a page with unlimited line length.

    --

    - I don't need to go outside, my CRT tan'll do me just fine.
    1. Re:Code is not prose by rangek · · Score: 2, Insightful

      All of those studies you referred to are speaking of prose. If anything, they speak to having 80 column multi-line comments. Show me a study that compares code at 50 columns, 80 columns, 132 columns, and 200 columns and you'll get my full attention.

      This is true. But the REASON it is easier to read prose is that your eyes don't have to "carriage return" so far after each line. So a line of code really shouldn't be more than 70-80 characters wide for the same reason.

      So lets say you are using 5 space indents and you want to be able to indent 5 levels comfortably (usually I have found that more than five levels means something is wrong with the code). That is 105 chars per line.

      Fortran95 for example will only swallow upto 132 chars per line. So I could see a few lines hanging out there at a hundred-something. In practice (perl and fortran95), I have never felt the need to go over 132 characters in a line...

      Also of note: the first link which advocated shorter line lengths is on a page with unlimited line length.

      It is not up to HTML to tell you how to display the information per say. With a comfortably sized browser window everything should wrap.

    2. Re:Code is not prose by ttfkam · · Score: 1
      This is true. But the REASON it is easier to read prose is that your eyes don't have to "carriage return" so far after each line. So a line of code really shouldn't be more than 70-80 characters wide for the same reason.
      This is true, but once again, code is not prose. You do not read code like you read prose. No one does. This is not to say that you or I or someone else cannot read code very quickly. But it is not prose. Take Japanese prose versus English prose. What formatting is appropriate? How many characters per line? What stylistic attributes are acceptable for indentation, quoting, bibliographic citations, etc.? You can't make one-to-one correlations. Why? They are different animals. They may share some attributes in common, but in the end, they are not the same.

      Now, back to code. If your shop standardizes on 105 characters for line length, more power to them. I never said it was a bad thing to standardize a shop's code. What I called into question was a universal belief that 80 characters is somehow a holy construct. Once again, show me the study that compares readability of code and not prose, and I will listen with both ears. Until that happens, you are making the ASSUMPTION that since prose is this way, code must be as well. I do not believe this assumption to automatically be true. It may be, but in my experience, an arbritrary 80 character limit can harm readability rather than help it. Now if you had advocated a 80 character guideline -- rather than a hard limit -- I would be more receptive. Then again, if you advocated a "one statement/one line" approach, I wouldn't be against it either.
      It is not up to HTML to tell you how to display the information per say. With a comfortably sized browser window everything should wrap.
      Funny, I thought the whole point to HTML (and CSS) was to format information for display. Some web sites have one sidebar. Others have two. Some have none. If sites are not consistent with width, how can a browser be "comfortably sized." This is an abdication of responsibility. If you're responsible for development of a web site, you are also responsible for making that information as easily absorbed as possible. Often times, it may be at 80 columns (or x pixels or y centimeters), but not always.

      But then, it is this situation that the CSS property "width" was created for. Or <table width="x"> if you still misguidedly code pages that way.
      --

      - I don't need to go outside, my CRT tan'll do me just fine.
    3. Re:Code is not prose by rangek · · Score: 1
      This is true, but once again, code is not prose.

      Yes, yes. But that doesn't invalidate the point that your eyeballs don't like to go zippping from the right hand side of the screen all the way to the left again. That is why I said 105-132 columns seems reasonable, since you don't have to do all the way back to the left if there is indenting (which is one of the major typographic features that differs between code and prose).

      Once again, show me the study that compares readability of code and not prose, and I will listen with both ears. Until that happens, you are making the ASSUMPTION that since prose is this way, code must be as well. I do not believe this assumption to automatically be true.

      I don't think there is such a study. Until there is we have to use SOMETHING to create our guidelines with. There is evidence that the eyes don't like more than 80 characters per line. But code is not prose. One thing that leaps off the "page" about code is the indenting. So if we correct for a reasonable amount of indenting, we get 105 chars per line. Obviously that is a pretty soft number. Lets call it 132, since some compilers have a hard limit there. That's all I am saying.

      Funny, I thought the whole point to HTML (and CSS) was to format information for display.

      HTML does not guarantee how your page looks on different browsers.

    4. Re:Code is not prose by ttfkam · · Score: 1
      I never said that I thought 105-132 columns was unreasonable. I simply said that a 80 column hard limit didn't seem reasonable. You extrapolated that since I was against a 80 column limit, I was against any type of limit. This is not the case.

      In addition, until there is such a study, whatever seems to work for a development group is what they should use. If 105 characters works for them, they should use it. I never stated to the contrary.

      In the end, I think we agree. Personally, I aim for 80 characters, but if the statement cannot easily be broken up and can be understood easier on a longer line, so be it. In other words, as I said in my previous post, I'm okay with guidelines for line length, but I'm against hard limits.

      By the way, what compilers do you use that have line length limitations? Seems pretty lame to me. '\n' is just another character. Then again, so is '\t'. So technically, five indents only raise the number of characters by five. But now I'm just fucking with you. ;-)
      HTML does not guarantee how your page looks on different browsers.
      Pixel for pixel, no it doesn't. Width of blocks via <table width="*"> or CSS's "width" property? HTML most certainly does guarantee this. On text browsers, the console width is the limit. On every browser newer than Netscape 4 -- >95% of the browsers out there -- the CSS property "width" is supported with sufficient correctness to constrain text. The table element covers 99.999%. HTML doesn't need to guarantee how the whole page looks and renders. For the purposes of this conversation, it only needs to guarantee that the texual line width does not exceed a certain value. In this respect, it absolutely guarantees.

      HTML is not supposed to? Fine. I can accept that. CSS is supposed to though. Which brings me back to my original -- and I think completely justified -- point: a page that advocates an 80 column limit should not have its own text width unbounded.
      --

      - I don't need to go outside, my CRT tan'll do me just fine.
    5. Re:Code is not prose by rangek · · Score: 1
      In the end, I think we agree. Personally, I aim for 80 characters, but if the statement cannot easily be broken up and can be understood easier on a longer line, so be it. In other words, as I said in my previous post, I'm okay with guidelines for line length, but I'm against hard limits.

      Good. We totally agree.

      By the way, what compilers do you use that have line length limitations? Seems pretty lame to me. '\n' is just another character.

      I guess I was wrong. Most F77 compilers are limited to 72 characters. Others extended this to 132. I thought 132 was also the limit for F9x, but I was wrong. There is no limit.

      HTML is not supposed to? Fine. I can accept that. CSS is supposed to though.

      True.

      a page that advocates an 80 column limit should not have its own text width unbounded.

      It is kinda silly, I'll admit.

  38. 80 Columns is STILL a reasonable rule by mystran · · Score: 2, Insightful

    The reason why it's good idea to still keep stuff in 80 columns, is that while you CAN fit much more on modern terminals, you might not WANT to. Specifically, I DO format to 80 columns, because that's about as much as fits to my standard ViM window. My resolution is 1280x1024, and I'm using a 8pt font in 96dpi. Oh, and my ViM is fullscreen... The catch is, when the code is split to 80 columns, I can view TWO source files side by side. This also goes with terminals: having two (actually four, one in each "corner") is very nice. So yes, I think that 80 columns per row IS still a good rule.

    --
    Software should be free as in speech, but if we also get some free beer, all the better.
    1. Re:80 Columns is STILL a reasonable rule by Anonymous Coward · · Score: 0

      having 3 monitors is also very nice...

  39. Very much so in hte company I work for by damballah · · Score: 1

    Line wraps are a no-no for us. The 80-col limit is respected because it makes everyone's life easier.

  40. I seem to like 100-110 by Anonymous Coward · · Score: 0

    At least, for code.

    That's the width I find most comfortable for Objective-C, where
    method names can get pretty long, and things get pretty ugly
    sometimes when there are nested method invocations.

    for example:
    [[[textView layoutManager] textStorage] setAttributes:(NSDictionary *)attributes range:[highlight highlightRange]];

    (and that's just what I was able to come up with quickly. It can be longer than that.)

    Such statements can be broken up over separate lines, but that can get ugly too. Sometimes it just is better to let something take up 100-110 characters.

  41. I still follow that limit by Anonymous Coward · · Score: 0

    Both personally and as part of the standard coding conventions at work.

    I want SOME standard for how wide my windows have to be to see it all, and it's a pretty reasonable one.

    Remember, the linux kernel is based on 80 characters and 8 space tabs. "If you're running out of room, your code is nested too deep. Refactor it."

  42. I don't think so by samjam · · Score: 1

    Because the same formatting rules are always used when checking IN to source control

    Jim writes:

    foo ()
    {
    some
    really
    long
    line
    }

    which gets checked in as:

    foo () {
    some really long line
    }

    which Jo checks out as:

    foo() {
    some really
    long line
    }

    modifies to

    foo() {
    some really
    long line
    that works
    }

    but gets checked in as

    foo() {
    some really long line that works
    }

    Any part of the source control tools that pull code from the repository needs to apply the current users rules, this implies the diff tools as well.

    Sam

    1. Re:I don't think so by mike_sucks · · Score: 2, Insightful

      Except that you can't send the diffs to another person, attach them to bug reports, etc.

      And some more reasons not to do automatic reformatting:

      - formatters can't fix aything non-syntax related, like strange variable naming conventions.
      - reformatting makes your environment completely different from everyone else's (including your coworkers and customers). Eg: stack traces you get on one machine are completely different compared to the ones you get.

      Having a code convention (and sticking to it) makes everyone's life easier in the long run.

      --
      -- "So, what's the deal with Auntie Gerschwitz et all?"
    2. Re:I don't think so by samjam · · Score: 1

      First I've heard that re-formatting code can produce a different binary!

      Have you file a bug report against the compiler?

    3. Re:I don't think so by mike_sucks · · Score: 1

      consider:

      foo() {
      some lone line();
      bar()
      }

      vs:

      foo()
      {
      some
      long
      line();
      bar();
      }

      On what lines does bar() appear in both?

      --
      -- "So, what's the deal with Auntie Gerschwitz et all?"
    4. Re:I don't think so by Mr+Z · · Score: 1

      It gets even more important when bar(); is something more like the Linux kernel's "BUG" macro, that expands out with __FILE__ and __LINE__ macros in it.

    5. Re:I don't think so by Kombat · · Score: 1

      On what lines does bar() appear in both?

      In Java, it bar() appears on line 2 of both methods. Line numbers in Java refer to the line on which a statement starts, irrespective of how many lines the statement happens to span.

      --
      Like woodworking? Build your own picture frames.
    6. Re:I don't think so by mike_sucks · · Score: 1

      Yes, but the K&R/GNU (?) style braces of the second example pushes bar() down by one line, so bar() is still on a different line.

      --
      -- "So, what's the deal with Auntie Gerschwitz et all?"
  43. Oh god! by jotaeleemeese · · Score: 1

    Bracing style can be enforced by a fscking script.

    It should not be the task of a programmer to adhere to a pointless punctuaction and bracing style, that is a presentational issue better addressed by automatic tools ( once a program is syntactically correct).

    --
    IANAL but write like a drunk one.
  44. You translate for presentation purposes only. by jotaeleemeese · · Score: 1

    And only finished versions of the code.

    The differences are applied to the original, finished version of the code, not to the one generated for readability.

    --
    IANAL but write like a drunk one.
    1. Re:You translate for presentation purposes only. by mike_sucks · · Score: 1

      No, you are translating for working purposes. As I've pointed out elsehwere, this sucks.

      --
      -- "So, what's the deal with Auntie Gerschwitz et all?"
  45. Are 15-inch monitors dead? by jonadab · · Score: 1

    These days, 17-inch monitors don't cost significantly more than 14-inch ones,
    and 19-inch ones are very reasonably priced. Consequently, it's possible to
    use resolutions higher than 640x480 without being forced to squint. As a
    result, you can fit more than 80 columns in an editor and read it comfortably.

    There are obviously still limits on how wide your code can be without causing
    people problems viewing it, but I would say the limit is a bit more than 80
    characters these days. Probably at least 100, if not 120. In any given
    workplace, you should get your programmers together and agree on a limit.

    --
    Cut that out, or I will ship you to Norilsk in a box.
    1. Re:Are 15-inch monitors dead? by Anonymous Coward · · Score: 0

      Make your next upgrade a computer that's as new as your monitor. Most likely it will come with something new and fancy called Windows. The idea being that you can have multiple windows on the screen at once. Eg. on a 1280x1024 screen, having two windows side by side will make them no wider than 640 each.

    2. Re:Are 15-inch monitors dead? by jonadab · · Score: 1

      > Most likely it will come with something new and fancy called Windows

      Yeah, I used to use that. But even then, I usually kept Emacs filling the
      whole width of the screen. I find that while it's useful to position two
      or three or even four windows vertically above one another, horizontal
      tiling is of less utility than the ability to work with wider content.

      --
      Cut that out, or I will ship you to Norilsk in a box.
  46. Coding conventions are for... by davidwr · · Score: 1

    Coding conventions are for you and those who maintain your code - from now until Doomsday.

    Where practical, I stick to 80 columns so I can email and print upright in the default font.

    With VeryBigMethod->Names(With,LotsOf(Complex[*Paramete rs()]),that->Fillup(aLine))
    or when using coding conventions such as highly-nested "if" statements, this isn't always practical.

    At that point, I shift to whatever will fit on the screen and on a landscape printer, but no more than 132.

    The bottom line:

    Coding conventions as a tool, but when a tool outlives its usefulness, it's time to replace it.

    --
    Knowledge is how to play a game, intelligence is how to win, wisdom is knowing what game to play.
    1. Re:Coding conventions are for... by Anonymous Coward · · Score: 0

      poor guy, you and your ideas will die an
      early death because nowone understands your:

      VeryBigMethod->Names(With,LotsOf(Complex[*Parame te rs()]),that->Fillup(aLine))

      man! keep it simple, break it down! some future
      programming guininess at the age of 6 might
      stumble acrose your code, and you want him to
      understand it ... :)

    2. Re:Coding conventions are for... by Anonymous Coward · · Score: 0

      yeah, a->b(c,d(e[*f()]),g->h(i)) works so much better.

      or would you prefer

      y=g->h(i);
      x=f();
      w=*x;
      u=e[w];
      t=d(u);
      s=a ->b(c,t,y);

  47. Your error by ArchieBunker · · Score: 1

    Is using vi in the first place. For a quick edit use pico, nano or joe. I like nano because you can jump right to a line number.

    --
    Only the State obtains its revenue by coercion. - Murray Rothbard
    1. Re:Your error by pyrrhonist · · Score: 1
      Is using vi in the first place. For a quick edit use pico, nano or joe.

      BLASPHEMER!!!!! Ed is the standard text editor. :)

      I like nano because you can jump right to a line number.

      Oh, like in vi. :)

      --
      Show me on the doll where his noodly appendage touched you.
    2. Re:Your error by darc · · Score: 1

      Pico gives us random endlines. Editing a sensitive config file and ending up with a linebreak because it wrapped, that's bad.

      In vi, jumping to a line number is as easy as hitting colon and typing in the number, and hitting enter. You can even jump relative, for moving around in ASM code, etc.

      Pico, nano, and joe don't come near the power of vi.

      vim's built in regex stuff makes the distinction yet more clear.

      --
      Tired of legitimate data sources? Try UNCYCLOPEDIA
    3. Re:Your error by PotPieMan · · Score: 1

      alias nano='nano -w'

      The -w option turns off line wrapping. Should be the default, IMO.

    4. Re:Your error by Anonymous Coward · · Score: 0

      ... or emacs?

    5. Re:Your error by namilax · · Score: 0

      you can use "nano -w" like the other guy said or just hit alt-W once it's running.

      --
      -- namilax!
  48. 80 Column Limit? by LWATCDR · · Score: 1

    What 80 column limit? I have been writing commercial software for about 20 years now and I have never used an 80 column limit.

    --
    See my blog http://ilovecookes.blogspot.com/ for light hearted technical information.
    1. Re:80 Column Limit? by tcgroat · · Score: 1

      Ask those who were coding a decade or so earlier. More than 80 characters won't fit on a punch-card. That leaves you 72 usable columns, after taking out the continuation character and reserved line number columns. Teletypes and early VDTs had the same limitation. I'm not saying there's anything sacred about 80 columns, just that it originally was a hardware limitation.

  49. It's still a good idea by Anonymous Coward · · Score: 0

    As someone else said, it allows vim (at 1600x1200) with vertical window splitting to simultaneously show 3 (at times 4) whole full-length buffers at once. Oh so useful.

    Also, I have Computer Modern TT set up in vim. Yummy. I've always loved how anything formatted in TeX looked just gorgeous, and now I code in it.

  50. terminals are changing, we need to do something by pixel+fairy · · Score: 1
    80 colums is fine for code on many terminals, but some are even smaller, like the treo (which i am thankfully not an owner of) which has a 40 colum wide terminal. at that length, at least for web/email etc its easier to line wrap. obviously you dont want to do this for code.

    horizontal scrolling? that would be a pain but i cant see any other way. vi with line wrapping could get painfull pretty quickly. think of those long functions indented more than 5 levels. maybe an editor/display that simply has a number counting the tabs or whitespace. could go well with python....

    patent rant mode on

    p.s. heres publishing before some dooky head goes running off to the patent office! yes, its trivial, but the patent office seems to be pretty brain dead these days as to whats obvious...
    #!/usr/bin/perl
    while (<>) {
    if (/^\s+/) {
    $wspace=length($&);
    print "$wspace $'\n";
    } else {
    print "0 $_";
    }
    }
    and yes, using a color instead of line is also obvious.
  51. Dumbest thread ever by Anonymous Coward · · Score: 0

    Stop reading here. There are no useful comments in this whole thread.

    1. Re:Dumbest thread ever by julesh · · Score: 0, Offtopic

      LOL. This was the last comment in the thread :)

  52. My observations... by bziman · · Score: 2, Insightful
    What I've noticed, is that the more efficient coders on the team (myself included) need to be able to look at multiple pieces of code and documentation and applications simultaneously. Therefore, we have vi and terminals set up with an 80 character limit, so we can fit two windows side-by-side on the desktop.

    The more brain-dead coders don't realize that they have a windowing environment, and run with all of their windows maximized, preventing them from taking advantage of any of the benefits thereof. They produce bizarre lines that are over 150 characters wide, and they're slower than hell, because they have to cycle through all of their programs to find the docs or the other files they're working on. It's particularly hard for them when they're using a fancy schmancy editor, so they can't even Alt-Tab through their editing windows.

    Maybe I'm old fashioned, but I know what works, and what doesn't. Over many, many years of coding, I've used dozens of IDEs and operating environments, going way back to Borland Turbo C++ for DOS, using Visual C++, and even Eclipse. After many years of experimenting, I've settled on ViM and the command line for most tasks. It's just easier and more efficient for a trained user.

    1. Re:My observations... by julesh · · Score: 1

      I have used a lot of editors over the years. And I've never used one that doesn't have a short key sequence for cycling through open buffers. It might not be alt-tab, but there is always something. My favourites were Borland's windows IDEs, which used to assign a numerical shortcut keys to the first 10 documents open at any time.

    2. Re:My observations... by ikegami · · Score: 1

      : It's particularly hard for them when they're using a fancy schmancy editor, so they can't even Alt-Tab through their editing windows.

      A quick tip: Try using Ctrl-Tab (or Ctrl-F6) to cycle through an appliation's child windows.

  53. Websurfing... by Anonymous Coward · · Score: 0

    I browse with 80 Character Limit /w lynx. =)

  54. Aaargh!!!! by 4of12 · · Score: 1

    Am I the only one who gets grumpy

    No!

    I like to indent my C code using the GNU style and it does go in a ways sometimes.

    But my co-developers, first they do when they open up an Emacs on our application is to stretch the damn right margin out to fucking infinity.

    Thereafter, everyone must do the same or be confounded with crap due to weird wrapping.

    Email has suffered this way recently, too.

    --
    "Provided by the management for your protection."
  55. Re:huh? (How wide is your term) by MoCycleGeek · · Score: 1

    In Sol 8 the stock vi lets you go up to 163, I tend not to go over 132 so it's safe for me. I've found 132 is safe for many of the stock distributions.

    -M

  56. Damn Good Reason by Daemonic · · Score: 1

    I've got an IBM mainframe over here running MVS that insists on 80 columns.... Not all these old computers are dead.

  57. you insensitive clod by Anonymous Coward · · Score: 0

    ... i still code on a typewriter!

  58. Re: 4-character tabs vs 8-character tabs by Anonymous Coward · · Score: 0
    Right, what happens if you do this is that the bozo that has tabs=4 sometimes uses tabs and sometimes uses spaces

    Try using "expand -t 4" and then edit the file as normal (if you want to convert to an indentation level of 8, try using indent, astyle or cb). However, I should caution you that "unexpand -t 4" does not understand the difference between whitespace and a string literal in C, so you should not use it to convert from spaces back to tabs (it can ruin your day to get random tabs in your printfs). Instead, try using something like "indent -ts4" (warning: indent can produce very ugly results if you don't study the options carefully, and it can also totally screw up your diffs).

    p.s. I normally advocate strict adherence to the 8-character tab standard, but sometimes it's better to just appease your co-workers by pretending to use their 4-character standard Most people these days use 4-space indentation anyway (i.e. tabstop=8 and shiftwidth=4), so there's no real difference other than the encoding method.

  59. indent, then auto refix by Anonymous Coward · · Score: 0

    agreed on team 'indent' style

    set up personal indent style

    set up vim macros
    so that read in file, apply personal indent macros
    edit
    save, insing macro which applys team ident style

  60. Missing poll option by JBMcB · · Score: 1

    Missing poll option:

    I use 480 column windows on my 3840x2400 LCD monitor and Quadro FX3000 video card. 10-point Monaco, baby!

    --
    My Other Computer Is A Data General Nova III.
  61. tab sizes & column widths, oh my! (still going by Tumbleweed · · Score: 1

    Actually, I don't think there should BE a column limitation of any particular size. Just as one would set what indentation display for tabs, so too should they set whatever wrapping (if any) they wish.

    It's like Burger King - I want it my way (only I don't want it to taste like ass), and I want others to have it their way, too. With properly-designed software, this shouldn't even be an issue anymore.

  62. Apple //e by cbr2702 · · Score: 1

    My Apple //e shipped with a native resolution of 40 characters. My grandfather had an 80-column addon card, but as the display is a TV-screen, 80 columns was fuzzy. I still use my //e, as a dumb terminal off my linux box.

    --


    This post written under Gentoo-linux with an SCO IP license.
  63. absolutely! by dfghjk · · Score: 1

    Yes yes! Best argument yet for why super long lines are good. I do that all the time and scrolling is a penalty I happily pay.

    And yes, code and text are entirely different and are read differently. Code works best when kept on a single line as much as possible. The dreadful K&R style so thoughtlessly propagated by typical Unix programmers was chosen strictly because it enabling typesetting to work better in a small book. Looks like crap! What's with the stupid open brace on the same line rather than on its own? It was done simply to make the book cheaper to publish!

  64. Pay attention, class! by Tumbleweed · · Score: 1

    See, kids, this is what happens when you reply to a 12 day old message without first reading and understanding the rest of the thread. Take notes - there will be a test later!