Re: [Htmlparser-developer] tabs
Brought to you by:
derrickoswald
From: Derrick O. <Der...@ro...> - 2003-08-27 11:21:03
|
Tabs are an issue because of the ambiguity. A space is a space. A tab can be anything. The original intent of tabs (in typewriters) was to allow quick columnar alignment. This obviously doesn't work in electronic documents where the interpretation is dependant on the program used. Try opening a file formatted with a tabstop setting of 4 in a program (like notepad) that has a hard-coded tabstop spacing of 8. Some think that tabs conserve disk space (one tab is worth 8 spaces right) but hard disk space is pennies a megabyte and compression programs handle lots of spaces very nicely for transmission. I just think they are an anachronism that's long since lost it's usefulness. The Sun "Code Conventions for the Java Programming Language" available at http://java.sun.com/docs/codeconv is a good basis from which to start. I'm adjusting it a bit to account for open source, cvs and htmlparser specifics. I disagree with some of it's suggestions though, like: Four spaces should be used as the unit of indentation. The exact construction of the indentation (spaces vs. tabs) is unspecified. Tabs must be set exactly every 8 spaces (not 4). I mean this is just sloppy. It should be: Four spaces should be used as the unit of indentation. The use of tabs, vertical tab, form-feed, carriage-return and other control characters, other than newline, to control displayed formatting is forbidden. I hope to provide a rationale for where I have differed within the document. Derrick Somik Raha wrote: >Hi Derrick, > Hmm.. If you mean that Eclipse will auto-convert tabs to spaces, maybe I >misunderstood. As long as one does not have to press space four times... > > Bytway, just curious as to why tabs are a problem in the first place.. > > > >>I'm working on a Java Coding Standards document. >> >> > > What do you think of the Sun coding standard? > >Cheers, >Somik >----- Original Message ----- >From: "Derrick Oswald" <Der...@ro...> >To: <htm...@li...> >Sent: Tuesday, August 26, 2003 9:09 PM >Subject: Re: [Htmlparser-developer] tabs > > > > >>Somik, >> >>The (rather meager) response to an earlier poll indicated that Eclipse >>was the most popular by far, followed by a few NetBeans and JBuilder users. >> >> >>Replacing tabs with spaces is automatic in modern editors and IDEs. For >>Eclipse, you need to make the settings in the Java/Editor Typing tab. >>You also need to make the setting in the Java/Code Formatter Style tab. >>For Netbeans use Tools-Options-Editing-Editor Settings-Java Editor-Java >>Indentation Engine-...-Expand Tabs To Spaces-True. I don't know how to >>do it in JBuilder, but I know it can be done. >> >>I'm working on a Java Coding Standards document. >> >>Derrick >> >> |