Thread: [Htmlparser-developer] Re: Htmlparser-developer digest, Vol 1 #255 - 1 msg
Brought to you by:
derrickoswald
From: Fernando M. <fn...@ne...> - 2003-08-26 03:39:47
|
Hi, What do you think about set a complete conding standards? Not only spaces but comments, functions, for's, if's etc. My $0.02. Regards, -fmac > Message: 1 > Date: Mon, 25 Aug 2003 22:55:34 -0400 > From: Derrick Oswald <Der...@ro...> > To: htm...@li... > Subject: [Htmlparser-developer] tabs > Reply-To: htm...@li... > > > I'm thinking of making a gratuitous change to nearly all the htmlparser > source files -- replace tabs with spaces. > > I've been using a tabstop of 4 and my guess is some others have been > using 8. This is too much in my opinion, but the point is there seems to > be too much ambiguity in the repository at the moment about whether to > use tabs or not and how many spaces they represent and hence how much > indent is applied when entering a block of code. Maybe it's my fault. > I've been a 4 space person ever since moving away from the old DOS text > screens, where it was two spaces, and only because screen real-estate > was so precious. So the code I've inserted must look horrendous for > those with an 8 spacing. > > How about arbitrarily dictating that no tabs are allowed, and the indent > is 4? Just set a standard and adhere to it. > > I know every editor in use has a 'replace tabs with spaces' option and > it's just a matter of some people turning that feature on. I can > correct the existing files in a few minutes (correctly adding the number > of spaces to get to the next tabs stop, not just globally substituting > spaces for tabs). > > I know this is a religious issue, so I'll gladly offer to convince > anyone my way is correct and theirs is wrong, and trump anyone's code > drop with one that doesn't contain tabs until they give up. Harrumph! > > Derrick |
From: Somik R. <so...@ya...> - 2003-08-27 00:32:15
|
Hi Folks, For what its worth, tabs are an incredibly useful and standard way of formatting code. A lot of folks use Eclipse, and pressing the tab key every so many seconds comes really naturally. It also reduces the risk of RSI (pressing space four times as opposed to tab once). Note that the space key is a big killer - it really hurts your thumb in the long run. A state-of-the-art ergonomic keyboard that I am trying to adjust to takes the space key away from the thumb. (Does this reason sound silly? Look at your fingers, do you feel any pain in your thumbs? Or your shoulder or your neck? Do you want to avoid surgery?) It would also be good to know what IDE most developers on this project use. I would personally prefer to maintain the tabs, and follow the Sun Microsystems java coding standard. http://java.sun.com/docs/codeconv/html/CodeConvTOC.doc.html There are pieces of code where the braces are not consistent. I agree with Fernando - we should have an "official" coding standard that is clearly communicated on the site. Finally, the coding standard is for active developers who must feel comfortable with it. My views are secondary to the active developers, as I have ceased to contribute beyond an occasional code-cleanup. Regards Somik I n d u s t r i a l L o g i c , I n c . Somik Raha Extreme Programmer & Coach http://industriallogic.com http://industrialxp.org 866-540-8336 (toll free) 510-540-8336 (phone) .. the major danger in vertical thinking is not that of being trapped by the obvious but of failing to realize that one may be trapped by the obvious. It is not a matter of avoiding vertical thinking but of using it and at the same time being aware that it might be necessary to escape from a particular way of looking at a situation. --- Edward De Bono in Lateral Thinking, Chapter 16, Analogies |
From: Derrick O. <Der...@ro...> - 2003-08-27 01:10:13
|
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 Somik Raha wrote: >Hi Folks, > >For what its worth, tabs are an incredibly useful and standard way of >formatting code. A lot of folks use Eclipse, and pressing the tab key every >so many seconds comes really naturally. It also reduces the risk of RSI >(pressing space four times as opposed to tab once). Note that the space key >is a big killer - it really hurts your thumb in the long run. A >state-of-the-art ergonomic keyboard that I am trying to adjust to takes the >space key away from the thumb. (Does this reason sound silly? Look at your >fingers, do you feel any pain in your thumbs? Or your shoulder or your neck? >Do you want to avoid surgery?) > >It would also be good to know what IDE most developers on this project use. > >I would personally prefer to maintain the tabs, and follow the Sun >Microsystems java coding standard. >http://java.sun.com/docs/codeconv/html/CodeConvTOC.doc.html > >There are pieces of code where the braces are not consistent. > >I agree with Fernando - we should have an "official" coding standard that is >clearly communicated on the site. > >Finally, the coding standard is for active developers who must feel >comfortable with it. My views are secondary to the active developers, as I >have ceased to contribute beyond an occasional code-cleanup. > >Regards >Somik > > I n d u s t r i a l L o g i c , I n c . >Somik Raha >Extreme Programmer & Coach >http://industriallogic.com >http://industrialxp.org >866-540-8336 (toll free) >510-540-8336 (phone) > >.. the major danger in vertical thinking is not that of being trapped >by the obvious but of failing to realize that one may be trapped by >the obvious. It is not a matter of avoiding vertical thinking but of >using it and at the same time being aware that it might be >necessary to escape from a particular way of looking at a situation. > >--- Edward De Bono in Lateral Thinking, Chapter 16, Analogies > > > > >------------------------------------------------------- >This sf.net email is sponsored by:ThinkGeek >Welcome to geek heaven. >http://thinkgeek.com/sf >_______________________________________________ >Htmlparser-developer mailing list >Htm...@li... >https://lists.sourceforge.net/lists/listinfo/htmlparser-developer > > > |
From: Somik R. <so...@ya...> - 2003-08-27 02:11:18
|
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 > > Somik Raha wrote: > > >Hi Folks, > > > >For what its worth, tabs are an incredibly useful and standard way of > >formatting code. A lot of folks use Eclipse, and pressing the tab key every > >so many seconds comes really naturally. It also reduces the risk of RSI > >(pressing space four times as opposed to tab once). Note that the space key > >is a big killer - it really hurts your thumb in the long run. A > >state-of-the-art ergonomic keyboard that I am trying to adjust to takes the > >space key away from the thumb. (Does this reason sound silly? Look at your > >fingers, do you feel any pain in your thumbs? Or your shoulder or your neck? > >Do you want to avoid surgery?) > > > >It would also be good to know what IDE most developers on this project use. > > > >I would personally prefer to maintain the tabs, and follow the Sun > >Microsystems java coding standard. > >http://java.sun.com/docs/codeconv/html/CodeConvTOC.doc.html > > > >There are pieces of code where the braces are not consistent. > > > >I agree with Fernando - we should have an "official" coding standard that is > >clearly communicated on the site. > > > >Finally, the coding standard is for active developers who must feel > >comfortable with it. My views are secondary to the active developers, as I > >have ceased to contribute beyond an occasional code-cleanup. > > > >Regards > >Somik > > > > I n d u s t r i a l L o g i c , I n c . > >Somik Raha > >Extreme Programmer & Coach > >http://industriallogic.com > >http://industrialxp.org > >866-540-8336 (toll free) > >510-540-8336 (phone) > > > >.. the major danger in vertical thinking is not that of being trapped > >by the obvious but of failing to realize that one may be trapped by > >the obvious. It is not a matter of avoiding vertical thinking but of > >using it and at the same time being aware that it might be > >necessary to escape from a particular way of looking at a situation. > > > >--- Edward De Bono in Lateral Thinking, Chapter 16, Analogies > > > > > > > > > >------------------------------------------------------- > >This sf.net email is sponsored by:ThinkGeek > >Welcome to geek heaven. > >http://thinkgeek.com/sf > >_______________________________________________ > >Htmlparser-developer mailing list > >Htm...@li... > >https://lists.sourceforge.net/lists/listinfo/htmlparser-developer > > > > > > > > > > > ------------------------------------------------------- > This sf.net email is sponsored by:ThinkGeek > Welcome to geek heaven. > http://thinkgeek.com/sf > _______________________________________________ > Htmlparser-developer mailing list > Htm...@li... > https://lists.sourceforge.net/lists/listinfo/htmlparser-developer |
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 >> >> |