digitalmars.D.bugs - Tabs & spaces
- The Dr ... who? (6/6) Jun 12 2004 Walter
- Walter (11/16) Jun 13 2004 when
- Ant (3/15) Jun 13 2004 you are stuck in the past, sorry.
- Walter (7/15) Jun 13 2004 TTY
- Ant (8/26) Jun 13 2004 They are also living in the past ;)
- Walter (24/36) Jun 13 2004 printer,
- Regan Heath (20/66) Jun 13 2004 I don't think I understand the problem here.. I use MSVC, I set my tabs ...
- Matthew (26/93) Jun 13 2004 Walter uses an indentation scheme that I'm familiar with via (g)vim. Bas...
- Regan Heath (24/156) Jun 13 2004 So you're saying it mixes spaces and tabs on a single line? i.e.
- Matthew (32/189) Jun 13 2004 If, translating your invisible spaces for ., you mean
- Walter (9/17) Jun 14 2004 intolerably
- Regan Heath (9/40) Jun 14 2004 Yep, that is what I mean't.
- Walter (15/17) Jun 13 2004 [Raising hand]
- Matthew (17/34) Jun 13 2004 Isn't that exactly the point? Qwerty sucks. You think that all-spaces su...
- Lars Ivar Igesund (2/2) Jun 14 2004 Tabs in source code is evil (IMNSHO).
- stonecobra (9/12) Jun 14 2004 Caring about this issue is evil, IMHO. Whoever wrote the code wrote the...
- Matthew (15/24) Jun 14 2004 ... and?
- stonecobra (15/59) Jun 14 2004 http://www.unixguide.net/freebsd/faq/16.19.shtml
- Ant (10/11) Jun 14 2004 You're right, but this is the 3rd or 4th time this subject comes up
- Walter (4/5) Jun 14 2004 Thanks for the spot on target reference. I read Parkinson's books as a k...
- Regan Heath (13/47) Jun 14 2004 You do, this is exactly my point also.
- Matthew (7/37) Jun 14 2004 the
- Regan Heath (9/16) Jun 14 2004 Un-tabbifying is not the soln, using \t instead of 4 spaces is. If you
- Regan Heath (6/7) Jun 14 2004 IMHO they're better than spaces.
- Regan Heath (15/35) Jun 14 2004 :)
- Walter (5/7) Jun 13 2004 Despite most programmers mixing the two (including me), your technique o...
- Regan Heath (7/16) Jun 14 2004 You've got me backwards.. I specifically said I use spaces to line thing...
- Walter (3/17) Jun 15 2004 Ok, my mistake.
- Matthew (12/50) Jun 13 2004 Aren't you just backing up my argument that you untabify your source bef...
-
Stewart Gordon
(58/66)
Jun 14 2004
- Regan Heath (19/80) Jun 14 2004 or anyone can, trivially, with a small program.
- Stewart Gordon (18/55) Jun 15 2004 Well, there are plenty of programs out there that aren't small. D is
- Regan Heath (10/61) Jun 15 2004 I think you have missunderstood. What I mean't here was that even if you...
- Derek (12/40) Jun 14 2004 Hmmm...actually I don't. I never use them anymore. Haven't for many, man...
- Regan Heath (12/53) Jun 14 2004 I see what you're saying.. what were you trying to line up?
- The Dr ... who? (8/25) Jun 13 2004 Well, yeah, we know, but ...
- Vathix (9/25) Jun 13 2004 PITA
- Regan Heath (12/43) Jun 13 2004 I agree. I use a tab width of 4 for the same reasons.
- Ant (10/16) Jun 13 2004 I would say use tabs only.
- Andy Friesen (6/12) Jun 13 2004 It's things like these that keep me from ever using hard tabs for
- Stephen Waits (11/11) Jun 15 2004 Oh no.. a holy war has ensued.
- Stephen Waits (24/28) Jun 15 2004 Following up with an example (printf call intentionally contrived):
- Brad Anderson (4/15) Jun 18 2004 After reading the posts in this thread, I've come to the only logical
Walter I get your tab scheme - Vim's softtabs / smarttabs - but it's just a PITA when viewed with any other tools whose default tabs are not 8, or which have been set to another tab setting. Is there a good reason why you (and anyone writing for Phobos) can't change to just spaces only?
Jun 12 2004
"The Dr ... who?" <thedr who.com> wrote in message news:cagnmh$1md2$1 digitaldaemon.com...I get your tab scheme - Vim's softtabs / smarttabs - but it's just a PITAwhenviewed with any other tools whose default tabs are not 8, or which havebeen setto another tab setting.Printers, the linux command prompt, the windows command prompt, the DOS command prompt, the RT-11 command prompt, TOPS-10 command prompt, every TTY I've used from ASR-33 to VT-100, html browsers, etc., all have tab stops at 8. Programs that default to anything other than 8 should be abandoned. Programs that allow tab stops to be customized should be flogged.Is there a good reason why you (and anyone writing for Phobos) can'tchange tojust spaces only?Habit <g>.
Jun 13 2004
In article <caiaqb$ti1$1 digitaldaemon.com>, Walter says..."The Dr ... who?" <thedr who.com> wrote in message news:cagnmh$1md2$1 digitaldaemon.com...you are stuck in the past, sorry. AntI get your tab scheme - Vim's softtabs / smarttabs - but it's just a PITAwhenviewed with any other tools whose default tabs are not 8, or which havebeen setto another tab setting.Printers, the linux command prompt, the windows command prompt, the DOS command prompt, the RT-11 command prompt, TOPS-10 command prompt, every TTY I've used from ASR-33 to VT-100, html browsers, etc., all have tab stops at 8. Programs that default to anything other than 8 should be abandoned. Programs that allow tab stops to be customized should be flogged.
Jun 13 2004
"Ant" <Ant_member pathlink.com> wrote in message news:caihjb$1714$1 digitaldaemon.com...In article <caiaqb$ti1$1 digitaldaemon.com>, Walter says...TTYPrinters, the linux command prompt, the windows command prompt, the DOS command prompt, the RT-11 command prompt, TOPS-10 command prompt, everyatI've used from ASR-33 to VT-100, html browsers, etc., all have tab stopsSorry, I'm using the latest Microsoft Explorer, the latest HP laser printer, the latest Windows XP, and Red Hat Linux 9. All have 8 character tab stops wired in <g>.8. Programs that default to anything other than 8 should be abandoned. Programs that allow tab stops to be customized should be flogged.you are stuck in the past, sorry.
Jun 13 2004
On Sun, 13 Jun 2004 18:47:21 -0700, Walter wrote:"Ant" <Ant_member pathlink.com> wrote in message news:caihjb$1714$1 digitaldaemon.com...They are also living in the past ;) printer? printer? who prints things anymore? that's 20th century ;) But, that list doesn't contain a code editor. All posters on this thread use tabs. inclusive the original poster that asked for spaces! all of them redefine the tab stops. AntIn article <caiaqb$ti1$1 digitaldaemon.com>, Walter says...TTYPrinters, the linux command prompt, the windows command prompt, the DOS command prompt, the RT-11 command prompt, TOPS-10 command prompt, everyatI've used from ASR-33 to VT-100, html browsers, etc., all have tab stopsSorry, I'm using the latest Microsoft Explorer, the latest HP laser printer, the latest Windows XP, and Red Hat Linux 9. All have 8 character tab stops wired in <g>.8. Programs that default to anything other than 8 should be abandoned. Programs that allow tab stops to be customized should be flogged.you are stuck in the past, sorry.
Jun 13 2004
"Ant" <duitoolkit yahoo.ca> wrote in message news:pan.2004.06.14.02.07.52.929078 yahoo.ca...On Sun, 13 Jun 2004 18:47:21 -0700, Walter wrote:printer,you are stuck in the past, sorry.Sorry, I'm using the latest Microsoft Explorer, the latest HP laserstopsthe latest Windows XP, and Red Hat Linux 9. All have 8 character tabI use microEmacs. Tabs are fixed at 8 <g>. But seriously, if you use non-8 character tabs, the code won't print without using a special print program (when I want to print code, I don't want to look up the printer driver and try to figure out what arcane way to reset the tab stops, print, then set it back, I just want to print it), it won't look right in the source level debugger, it won't work as <pre></pre> in html pages, it won't 'type' to the screen on command prompt, etc. I don't want to run it through a perl script just so I can look at it. Non-8 tabs always going to be out of step with the way everything works. The code will always format like **** when emailed to someone who can't print it without special settings, etc. It might be fine for closely held source, but for widely distributed source, tabs need to kowtow to the default on practically every piece of hardware and software that displays ascii text. I know lots of code editors that have soft tab settings. But as soon as you leave that environment, every other program or hardware that displays text will go awry with the result. Distributed source code should be context-free, i.e. it shouldn't need to come with an external set of instructions saying what format it is in. And nobody ever bothers giving such instructions, so the inevitable result is the code looks like **** when brought up in an editor.wired in <g>.They are also living in the past ;) printer? printer? who prints things anymore? that's 20th century ;) But, that list doesn't contain a code editor. All posters on this thread use tabs. inclusive the original poster that asked for spaces! all of them redefine the tab stops.
Jun 13 2004
On Sun, 13 Jun 2004 22:05:32 -0700, Walter <newshound digitalmars.com> wrote:"Ant" <duitoolkit yahoo.ca> wrote in message news:pan.2004.06.14.02.07.52.929078 yahoo.ca...I don't think I understand the problem here.. I use MSVC, I set my tabs to 4 spaces, meaning that when I press TAB it inserts the \t char into my source file and displays it as 4 spaces. So if I open my source in notepad it reads \t and displays it as 8 spaces. It does not look like **** it looks fine, it simply has more horizontal space. From what you're saying if I print it in MSVC it will look like it does in notepad? or are you saying something else? If I need something in the code to line up under all situations i.e. comments on table columns etc, I will use spaces. I know for a fact that a space will take up 1 characters worth of space all the time, everywhere. What I *never* do is use both spaces AND tabs on one line, as this will never look right except under the same conditions as I wrote it. This is assuming they don't display it using non fixed-width fonts, in which case it doesn't matter what you do it won't line up, ever. Regan -- Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/On Sun, 13 Jun 2004 18:47:21 -0700, Walter wrote:printer,you are stuck in the past, sorry.Sorry, I'm using the latest Microsoft Explorer, the latest HP laserstopsthe latest Windows XP, and Red Hat Linux 9. All have 8 character tabI use microEmacs. Tabs are fixed at 8 <g>. But seriously, if you use non-8 character tabs, the code won't print without using a special print program (when I want to print code, I don't want to look up the printer driver and try to figure out what arcane way to reset the tab stops, print, then set it back, I just want to print it), it won't look right in the source level debugger, it won't work as <pre></pre> in html pages, it won't 'type' to the screen on command prompt, etc. I don't want to run it through a perl script just so I can look at it. Non-8 tabs always going to be out of step with the way everything works. The code will always format like **** when emailed to someone who can't print it without special settings, etc. It might be fine for closely held source, but for widely distributed source, tabs need to kowtow to the default on practically every piece of hardware and software that displays ascii text. I know lots of code editors that have soft tab settings. But as soon as you leave that environment, every other program or hardware that displays text will go awry with the result. Distributed source code should be context-free, i.e. it shouldn't need to come with an external set of instructions saying what format it is in. And nobody ever bothers giving such instructions, so the inevitable result is the code looks like **** when brought up in an editor.wired in <g>.They are also living in the past ;) printer? printer? who prints things anymore? that's 20th century ;) But, that list doesn't contain a code editor. All posters on this thread use tabs. inclusive the original poster that asked for spaces! all of them redefine the tab stops.
Jun 13 2004
"Regan Heath" <regan netwin.co.nz> wrote in message news:opr9kj2ig85a2sq9 digitalmars.com...On Sun, 13 Jun 2004 22:05:32 -0700, Walter <newshound digitalmars.com> wrote:Walter uses an indentation scheme that I'm familiar with via (g)vim. Basically, if the indent is odd (i.e. 1st, 3rd, 5th), then the editor inserts 4 spaces. For even indents (2nd, 4th, etc.) then it inserts a single hard tab. Since such editors use tabstop=8, it all looks dandy. Also, any device which does not redefine the tabstop from 8 will also display correctly. That's the source of Walter's talking about printers, etc. The problem is that the choice of 8 spaces per tabstop is one of those horrible decisions we're perpetually stuck with. Many editors have provided the ability to redefine the tabstop from 8 to a smaller value. This is most often 4, but I've seen 3, 2, 1 and even 5! Anyway, whatever the size, these programs are all, strictly, wrong. So Walter is quite correct that he's correct. <g> However, most of us use such "wrong" editors, and so when one opens up a 4(space)/8(tab) document with, say, 4 spaces, the indentation is shot to hell, and the code looks RS. Since vim allows you to elect to use all spaces, rather than mixed space+tab, and makes backspace still act as if you've deleted a tab (rather than needing to do three more backspaces, like you do in some other dumb ass editors), I cannot believe emacs does not have the same facility. Therefore, it would cost Walter nothing to change to all spaces, and would mean that anyone - either D-philes like us, or "not so sure"s - looking at the code would see all the high quality splendour that is big-W's codified splendour. Failing that, he could attain the same spell-binding of his readers by just including an untabification step in the release of Phobos. Again, virtually no effort, and a manifest gain."Ant" <duitoolkit yahoo.ca> wrote in message news:pan.2004.06.14.02.07.52.929078 yahoo.ca...I don't think I understand the problem here.. I use MSVC, I set my tabs to 4 spaces, meaning that when I press TAB it inserts the \t char into my source file and displays it as 4 spaces. So if I open my source in notepad it reads \t and displays it as 8 spaces. It does not look like **** it looks fine, it simply has more horizontal space. From what you're saying if I print it in MSVC it will look like it does in notepad? or are you saying something else? If I need something in the code to line up under all situations i.e. comments on table columns etc, I will use spaces. I know for a fact that a space will take up 1 characters worth of space all the time, everywhere. What I *never* do is use both spaces AND tabs on one line, as this will never look right except under the same conditions as I wrote it. This is assuming they don't display it using non fixed-width fonts, in which case it doesn't matter what you do it won't line up, ever.On Sun, 13 Jun 2004 18:47:21 -0700, Walter wrote:printer,you are stuck in the past, sorry.Sorry, I'm using the latest Microsoft Explorer, the latest HP laserstopsthe latest Windows XP, and Red Hat Linux 9. All have 8 character tabI use microEmacs. Tabs are fixed at 8 <g>. But seriously, if you use non-8 character tabs, the code won't print without using a special print program (when I want to print code, I don't want to look up the printer driver and try to figure out what arcane way to reset the tab stops, print, then set it back, I just want to print it), it won't look right in the source level debugger, it won't work as <pre></pre> in html pages, it won't 'type' to the screen on command prompt, etc. I don't want to run it through a perl script just so I can look at it. Non-8 tabs always going to be out of step with the way everything works. The code will always format like **** when emailed to someone who can't print it without special settings, etc. It might be fine for closely held source, but for widely distributed source, tabs need to kowtow to the default on practically every piece of hardware and software that displays ascii text. I know lots of code editors that have soft tab settings. But as soon as you leave that environment, every other program or hardware that displays text will go awry with the result. Distributed source code should be context-free, i.e. it shouldn't need to come with an external set of instructions saying what format it is in. And nobody ever bothers giving such instructions, so the inevitable result is the code looks like **** when brought up in an editor.wired in <g>.They are also living in the past ;) printer? printer? who prints things anymore? that's 20th century ;) But, that list doesn't contain a code editor. All posters on this thread use tabs. inclusive the original poster that asked for spaces! all of them redefine the tab stops.
Jun 13 2004
On Mon, 14 Jun 2004 15:31:45 +1000, Matthew <admin stlsoft.dot.dot.dot.dot.org> wrote:"Regan Heath" <regan netwin.co.nz> wrote in message news:opr9kj2ig85a2sq9 digitalmars.com...So you're saying it mixes spaces and tabs on a single line? i.e. I pressed tab once \tI pressed tab twice \t I pressed tab 3 times \t\tI pressed tab 4 times \t\t I pressed tab 5 times yes? If so, yuck! no wonder there is a problem! What crack addled chimpanzee decided that was a good idea??!On Sun, 13 Jun 2004 22:05:32 -0700, Walter <newshound digitalmars.com> wrote:Walter uses an indentation scheme that I'm familiar with via (g)vim. Basically, if the indent is odd (i.e. 1st, 3rd, 5th), then the editor inserts 4 spaces. For even indents (2nd, 4th, etc.) then it inserts a single hard tab."Ant" <duitoolkit yahoo.ca> wrote in message news:pan.2004.06.14.02.07.52.929078 yahoo.ca...tabOn Sun, 13 Jun 2004 18:47:21 -0700, Walter wrote:printer,you are stuck in the past, sorry.Sorry, I'm using the latest Microsoft Explorer, the latest HP laserthe latest Windows XP, and Red Hat Linux 9. All have 8 characterstopswant toI use microEmacs. Tabs are fixed at 8 <g>. But seriously, if you use non-8 character tabs, the code won't print without using a special print program (when I want to print code, I don'twired in <g>.They are also living in the past ;) printer? printer? who prints things anymore? that's 20th century ;) But, that list doesn't contain a code editor. All posters on this thread use tabs. inclusive the original poster that asked for spaces! all of them redefine the tab stops.look up the printer driver and try to figure out what arcane way toresetthe tab stops, print, then set it back, I just want to print it), it won't look right in the source level debugger, it won't work as <pre></pre>inhtml pages, it won't 'type' to the screen on command prompt, etc. Idon'twant to run it through a perl script just so I can look at it. Non-8tabsalways going to be out of step with the way everything works. The code will always format like **** when emailed to someone who can't print it without special settings, etc. It might be fine for closely held source, butforwidely distributed source, tabs need to kowtow to the default on practically every piece of hardware and software that displays ascii text. I know lots of code editors that have soft tab settings. But as soonasyou leave that environment, every other program or hardware that displays text will go awry with the result. Distributed source code should be context-free, i.e. it shouldn'tneed tocome with an external set of instructions saying what format it is in. And nobody ever bothers giving such instructions, so the inevitableresult isthe code looks like **** when brought up in an editor.I don't think I understand the problem here.. I use MSVC, I set my tabs to 4 spaces, meaning that when I press TAB it inserts the \t char into my source file and displays it as 4 spaces. So if I open my source in notepad it reads \t and displays it as 8 spaces. It does not look like **** it looks fine, it simply has more horizontal space. From what you're saying if I print it in MSVC it will look like it does in notepad? or are you saying something else? If I need something in the code to line up under all situations i.e. comments on table columns etc, I will use spaces. I know for a fact that a space will take up 1 characters worth of space all the time, everywhere. What I *never* do is use both spaces AND tabs on one line, as this will never look right except under the same conditions as I wrote it. This is assuming they don't display it using non fixed-width fonts, in which case it doesn't matter what you do it won't line up, ever.Since such editors use tabstop=8, it all looks dandy. Also, any device which does not redefine the tabstop from 8 will also display correctly. That's the source of Walter's talking about printers, etc.So you cannot tell a printer to use a different tabstop?The problem is that the choice of 8 spaces per tabstop is one of those horrible decisions we're perpetually stuck with.Hindsight is 20-20.Many editors have provided the ability to redefine the tabstop from 8 to a smaller value. This is most often 4, but I've seen 3, 2, 1 and even 5! Anyway, whatever the size, these programs are all, strictly, wrong. So Walter is quite correct that he's correct. <g>These programs are only strictly wrong if they are supposed to be WYSIWYG editors. If not, then there is nothing wrong with displaying a tab as 4 spaces, and saving it in the file as a single tab. I prefer WYTIWYG (what you type is what you get) and I'll display it however you tell me to editors.However, most of us use such "wrong" editors, and so when one opens up a 4(space)/8(tab) document with, say, 4 spaces, the indentation is shot to hell, and the code looks RS.Indeed.Since vim allows you to elect to use all spaces, rather than mixed space+tab, and makes backspace still act as if you've deleted a tab (rather than needing to do three more backspaces, like you do in some other dumb ass editors), I cannot believe emacs does not have the same facility. Therefore, it would cost Walter nothing to change to all spaces, and would mean that anyone - either D-philes like us, or "not so sure"s - looking at the code would see all the high quality splendour that is big-W's codified splendour.LOL. flattery will get you no-where methinks.Failing that, he could attain the same spell-binding of his readers by just including an untabification step in the release of Phobos. Again, virtually no effort, and a manifest gain.Either soln sounds good.. Walter? Regan. -- Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/
Jun 13 2004
"Regan Heath" <regan netwin.co.nz> wrote in message news:opr9klqrto5a2sq9 digitalmars.com...On Mon, 14 Jun 2004 15:31:45 +1000, Matthew <admin stlsoft.dot.dot.dot.dot.org> wrote:If, translating your invisible spaces for ., you mean ....I pressed tab once \tI pressed tab twice \t....I pressed tab 3 times \t\tI pressed tab 4 times \t\t....I pressed tab 5 times then yes"Regan Heath" <regan netwin.co.nz> wrote in message news:opr9kj2ig85a2sq9 digitalmars.com...So you're saying it mixes spaces and tabs on a single line? i.e. I pressed tab once \tI pressed tab twice \t I pressed tab 3 times \t\tI pressed tab 4 times \t\t I pressed tab 5 times yes?On Sun, 13 Jun 2004 22:05:32 -0700, Walter <newshound digitalmars.com> wrote:Walter uses an indentation scheme that I'm familiar with via (g)vim. Basically, if the indent is odd (i.e. 1st, 3rd, 5th), then the editor inserts 4 spaces. For even indents (2nd, 4th, etc.) then it inserts a single hard tab."Ant" <duitoolkit yahoo.ca> wrote in message news:pan.2004.06.14.02.07.52.929078 yahoo.ca...tabOn Sun, 13 Jun 2004 18:47:21 -0700, Walter wrote:printer,you are stuck in the past, sorry.Sorry, I'm using the latest Microsoft Explorer, the latest HP laserthe latest Windows XP, and Red Hat Linux 9. All have 8 characterstopswant toI use microEmacs. Tabs are fixed at 8 <g>. But seriously, if you use non-8 character tabs, the code won't print without using a special print program (when I want to print code, I don'twired in <g>.They are also living in the past ;) printer? printer? who prints things anymore? that's 20th century ;) But, that list doesn't contain a code editor. All posters on this thread use tabs. inclusive the original poster that asked for spaces! all of them redefine the tab stops.look up the printer driver and try to figure out what arcane way toresetthe tab stops, print, then set it back, I just want to print it), it won't look right in the source level debugger, it won't work as <pre></pre>inhtml pages, it won't 'type' to the screen on command prompt, etc. Idon'twant to run it through a perl script just so I can look at it. Non-8tabsalways going to be out of step with the way everything works. The code will always format like **** when emailed to someone who can't print it without special settings, etc. It might be fine for closely held source, butforwidely distributed source, tabs need to kowtow to the default on practically every piece of hardware and software that displays ascii text. I know lots of code editors that have soft tab settings. But as soonasyou leave that environment, every other program or hardware that displays text will go awry with the result. Distributed source code should be context-free, i.e. it shouldn'tneed tocome with an external set of instructions saying what format it is in. And nobody ever bothers giving such instructions, so the inevitableresult isthe code looks like **** when brought up in an editor.I don't think I understand the problem here.. I use MSVC, I set my tabs to 4 spaces, meaning that when I press TAB it inserts the \t char into my source file and displays it as 4 spaces. So if I open my source in notepad it reads \t and displays it as 8 spaces. It does not look like **** it looks fine, it simply has more horizontal space. From what you're saying if I print it in MSVC it will look like it does in notepad? or are you saying something else? If I need something in the code to line up under all situations i.e. comments on table columns etc, I will use spaces. I know for a fact that a space will take up 1 characters worth of space all the time, everywhere. What I *never* do is use both spaces AND tabs on one line, as this will never look right except under the same conditions as I wrote it. This is assuming they don't display it using non fixed-width fonts, in which case it doesn't matter what you do it won't line up, ever.If so, yuck! no wonder there is a problem! What crack addled chimpanzee decided that was a good idea??!LOL!!! That's a fantastic one. I must remember that. <G> I've been meaning to put up a web page with "SE Abuses" for ages. I think you've inspired me to put it on again. Or maybe we can just pick the juciest for an Appendix in the D book? :)I imagine you can, but that's not the point. In this regard, Walter has a good point. It's just his remedy that I don't likeSince such editors use tabstop=8, it all looks dandy. Also, any device which does not redefine the tabstop from 8 will also display correctly. That's the source of Walter's talking about printers, etc.So you cannot tell a printer to use a different tabstop?:)The problem is that the choice of 8 spaces per tabstop is one of those horrible decisions we're perpetually stuck with.Hindsight is 20-20.And sarcasm will get me the door! But sarcasm flows in the veins of Englishmen. I constantly forget to put in the requisite ";)" and it gets me in all kind of trouble. (I recently offended just about every giant of the C++ with my, ahem, ahem, "wit". That was not a pleasant exercise in genuflectory recanting. Thankfully most of the D ng grok that I talk crap most of the time and ignore it. You're all more like my wife than you'd imagine ...) Anyway, Walter knows that I think his code looks like it's as rough as a badger's arse, but that I also acknowledge that he has the upperhand in the argument, given the fact that the stuff he does with it damned impressive. I reckon I'm pretty typical as a developer in thinking everyone else's style is intolerably ugly. Several times in the past I've been instrumental in writing coding standards for clients - I have my mature concessional head on at such times <g> - and it's always the source of huge controversy. It's kind of amusing that there's always more attention, and _much_ more heat, on the coding standards than on the source control standards, or release procedures. Fools are we all. :)Many editors have provided the ability to redefine the tabstop from 8 to a smaller value. This is most often 4, but I've seen 3, 2, 1 and even 5! Anyway, whatever the size, these programs are all, strictly, wrong. So Walter is quite correct that he's correct. <g>These programs are only strictly wrong if they are supposed to be WYSIWYG editors. If not, then there is nothing wrong with displaying a tab as 4 spaces, and saving it in the file as a single tab. I prefer WYTIWYG (what you type is what you get) and I'll display it however you tell me to editors.However, most of us use such "wrong" editors, and so when one opens up a 4(space)/8(tab) document with, say, 4 spaces, the indentation is shot to hell, and the code looks RS.Indeed.Since vim allows you to elect to use all spaces, rather than mixed space+tab, and makes backspace still act as if you've deleted a tab (rather than needing to do three more backspaces, like you do in some other dumb ass editors), I cannot believe emacs does not have the same facility. Therefore, it would cost Walter nothing to change to all spaces, and would mean that anyone - either D-philes like us, or "not so sure"s - looking at the code would see all the high quality splendour that is big-W's codified splendour.LOL. flattery will get you no-where methinks.Failing that, he could attain the same spell-binding of his readers by just including an untabification step in the release of Phobos. Again, virtually no effort, and a manifest gain.Either soln sounds good.. Walter? Regan. -- Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/
Jun 13 2004
"Matthew" <admin stlsoft.dot.dot.dot.dot.org> wrote in message news:cajh25$2p8d$1 digitaldaemon.com...I reckon I'm pretty typical as a developer in thinking everyone else's style isintolerablyugly.Yup. That's the norm.Several times in the past I've been instrumental in writing coding standards for clients - I have my mature concessional head on at suchtimes <g> -and it's always the source of huge controversy. It's kind of amusing thatthere'salways more attention, and _much_ more heat, on the coding standards thanon thesource control standards, or release procedures. Fools are we all. :)I have engaged in this discussion primarilly tongue-in-cheek, in case nobody noticed <g>.
Jun 14 2004
On Mon, 14 Jun 2004 16:36:45 +1000, Matthew <admin stlsoft.dot.dot.dot.dot.org> wrote:Yep, that is what I mean't.If, translating your invisible spaces for ., you mean ....I pressed tab once \tI pressed tab twice \t....I pressed tab 3 times \t\tI pressed tab 4 times \t\t....I pressed tab 5 times then yesWalter uses an indentation scheme that I'm familiar with via (g)vim. Basically, if the indent is odd (i.e. 1st, 3rd, 5th), then the editor inserts 4 spaces. For even indents (2nd, 4th, etc.) then it inserts a single hard tab.So you're saying it mixes spaces and tabs on a single line? i.e. I pressed tab once \tI pressed tab twice \t I pressed tab 3 times \t\tI pressed tab 4 times \t\t I pressed tab 5 times yes?It's one of my favourites.. I have some others, but they're not really for public consumption.If so, yuck! no wonder there is a problem! What crack addled chimpanzee decided that was a good idea??!LOL!!! That's a fantastic one. I must remember that. <G>I've been meaning to put up a web page with "SE Abuses" for ages. I think you've inspired me to put it on again. Or maybe we can just pick the juciest for an Appendix in the D book? :)"SE Abuses" == ? Regan -- Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/
Jun 14 2004
"Regan Heath" <regan netwin.co.nz> wrote in message news:opr9klqrto5a2sq9 digitalmars.com...If so, yuck! no wonder there is a problem! What crack addled chimpanzee decided that was a good idea??![Raising hand] -- crack addled chimpanzee P.S. Adding a tab-to-space converter for release raises the spectre of having same-only-different versions of the source, something that isn't worth it. P.P.S. "So you cannot tell a printer to use a different tabstop?" Sure I can. If I can find where I put the documention on it. And for my source debugger, and Explorer, and the command prompt, and the linux printer driver, and on and on, and for everyone else who wants to look at the code as well. No thanks. Switching tab stops is like using a Dvorak keyboard. Sure, qwerty sucks, but it sucks worse to be unable to type on any keyboard but your own - and like your friend will let you install a Dvorak driver on his laptop so you can check your email <g>.
Jun 13 2004
"Walter" <newshound digitalmars.com> wrote in message news:cajhs4$2qca$1 digitaldaemon.com..."Regan Heath" <regan netwin.co.nz> wrote in message news:opr9klqrto5a2sq9 digitalmars.com...Isn't that exactly the point? Qwerty sucks. You think that all-spaces sucks. But it's the only way to get unambiguous and maximal compatiblity. Anyway, I'm wiling away too much time on an issue I don't actually care about. (Fancy that!?). So I'll shut up. As the signature says ... -- Matthew Wilson Author: "Imperfect C++", Addison-Wesley, 2004 (http://www.imperfectcplusplus.com) Contributing editor, C/C++ Users Journal (http://www.synesis.com.au/articles.html#columns) STLSoft moderator (http://www.stlsoft.org) " I fold like a cheap hooker who got hit in the stomach by a fat guy with sores on his face" -- Joey -------------------------------------------------------------------------------If so, yuck! no wonder there is a problem! What crack addled chimpanzee decided that was a good idea??![Raising hand] -- crack addled chimpanzee P.S. Adding a tab-to-space converter for release raises the spectre of having same-only-different versions of the source, something that isn't worth it. P.P.S. "So you cannot tell a printer to use a different tabstop?" Sure I can. If I can find where I put the documention on it. And for my source debugger, and Explorer, and the command prompt, and the linux printer driver, and on and on, and for everyone else who wants to look at the code as well. No thanks. Switching tab stops is like using a Dvorak keyboard. Sure, qwerty sucks, but it sucks worse to be unable to type on any keyboard but your own - and like your friend will let you install a Dvorak driver on his laptop so you can check your email <g>.
Jun 13 2004
Tabs in source code is evil (IMNSHO). Lars Ivar Igesund
Jun 14 2004
Caring about this issue is evil, IMHO. Whoever wrote the code wrote the code, you are welcome to write code the way you do. Code talks... My, what a lovely bikeshed you have :) Can we worry about D here, instead of coding standards? Even if Walter were to untabify, he would untabify at 8 spaces per tab, which all of you would dislike. Why not just live with the code that was written for you? Scott Lars Ivar Igesund wrote:Tabs in source code is evil (IMNSHO). Lars Ivar Igesund
Jun 14 2004
"stonecobra" <scott stonecobra.com> wrote in message news:cakh8a$1b5u$1 digitaldaemon.com...Caring about this issue is evil, IMHO. Whoever wrote the code wrote the code, you are welcome to write code the way you do. Code talks...... and?My, what a lovely bikeshed you have :)Over my head.Can we worry about D here, instead of coding standards?Not caring about coding standards at all. Caring about how D looks, both to people that need to use it on a day to day basis but already like it, and to people who may have reasons to look for things to criticise in it.Even if Walter were to untabify, he would untabify at 8 spaces per tab, which all of you would dislike.You've clearly not understood the issue. If he untabified at 8sp per tab, we would be very happy indeed.Why not just live with the code that was written for you?We will, whether it looks nice and is readily comprehended or not. I raised the issue to ease the task, in a small way, for many people. Cumulatively there will be a lot of time spent arsing around trying to get the D sources into a form that is readable. Almost all of that time will be better spent writing D libraries, or D programs. Or do you not think readibility is a factor in understanding?
Jun 14 2004
Matthew wrote:"stonecobra" <scott stonecobra.com> wrote in message news:cakh8a$1b5u$1 digitaldaemon.com...bull%$&* (all posts on this subject) walks.Caring about this issue is evil, IMHO. Whoever wrote the code wrote the code, you are welcome to write code the way you do. Code talks...... and?http://www.unixguide.net/freebsd/faq/16.19.shtmlMy, what a lovely bikeshed you have :)Over my head.How is this not a coding standard?Can we worry about D here, instead of coding standards?Not caring about coding standards at all. Caring about how D looks, both to people that need to use it on a day to day basis but already like it, and to people who may have reasons to look for things to criticise in it.I do understand the issue, but the people with 4 spaces/tab editors that use tabs to code with will be unhappy because the code is indented too much.Even if Walter were to untabify, he would untabify at 8 spaces per tab, which all of you would dislike.You've clearly not understood the issue. If he untabified at 8sp per tab, we would be very happy indeed.I do think readability is a factor in understanding, which is why I prefer the VisualBasic way, where the editor re-writes every line of code to comply to a readability standard, whether you like it or not. But I am not going to tell people how to code to some common readability standard, especially when they are clearly against it and unlikely to change. Hence the bikeshed comment. I apologize everyone, this will be my last post on the subject of tabs and spaces. Scott SandersWhy not just live with the code that was written for you?We will, whether it looks nice and is readily comprehended or not. I raised the issue to ease the task, in a small way, for many people. Cumulatively there will be a lot of time spent arsing around trying to get the D sources into a form that is readable. Almost all of that time will be better spent writing D libraries, or D programs. Or do you not think readibility is a factor in understanding?
Jun 14 2004
In article <cakqm0$1pmr$1 digitaldaemon.com>, stonecobra says...http://www.unixguide.net/freebsd/faq/16.19.shtmlYou're right, but this is the 3rd or 4th time this subject comes up and only people with the wrong idea speak up. This time I thought I could strait things up ;) however Matthew and Walter are right. on shared projects a minimum set of rules is beneficial. for example: Linux contributions should use 8 spaces tabs (and 25x80) and they explain why: With 8 spaces tabs you will notice when or code is getting too complex. Ant
Jun 14 2004
"stonecobra" <scott stonecobra.com> wrote in message news:cakqm0$1pmr$1 digitaldaemon.com...http://www.unixguide.net/freebsd/faq/16.19.shtmlThanks for the spot on target reference. I read Parkinson's books as a kid, but I'd forgotten that one.
Jun 14 2004
On Mon, 14 Jun 2004 11:25:12 -0700, stonecobra <scott stonecobra.com> wrote:You do, this is exactly my point also.I do understand the issue, but the people with 4 spaces/tab editors that use tabs to code with will be unhappy because the code is indented too much.Even if Walter were to untabify, he would untabify at 8 spaces per tab, which all of you would dislike.You've clearly not understood the issue. If he untabified at 8sp per tab, we would be very happy indeed.Sorry, this is evil, evil, and a 3rd time evil. The same was done in Frontpage the html editor, the problem with it was, that it got re-written to use MS only methods which do not work in other web servers. And it removed all my cgi replaceable tokens. So it was basically useless. So I use TextPad.I do think readability is a factor in understanding, which is why I prefer the VisualBasic way, where the editor re-writes every line of code to comply to a readability standard, whether you like it or not.Why not just live with the code that was written for you?We will, whether it looks nice and is readily comprehended or not. I raised the issue to ease the task, in a small way, for many people. Cumulatively there will be a lot of time spent arsing around trying to get the D sources into a form that is readable. Almost all of that time will be better spent writing D libraries, or D programs. Or do you not think readibility is a factor in understanding?But I am not going to tell people how to code to some common readability standard, especially when they are clearly against it and unlikely to change. Hence the bikeshed comment. I apologize everyone, this will be my last post on the subject of tabs and spaces.Don't appologise, your opinion is valid. -- Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/
Jun 14 2004
Wrong. Go back to the earlier post describing the indentation scheme, and work it out again.I do understand the issue, but the people with 4 spaces/tab editors that use tabs to code with will be unhappy because the code is indented too much.Even if Walter were to untabify, he would untabify at 8 spaces per tab, which all of you would dislike.You've clearly not understood the issue. If he untabified at 8sp per tab, we would be very happy indeed.theWhy not just live with the code that was written for you?We will, whether it looks nice and is readily comprehended or not. I raisedwillissue to ease the task, in a small way, for many people. Cumulatively therethatbe a lot of time spent arsing around trying to get the D sources into a formlibraries, oris readable. Almost all of that time will be better spent writing DI shall try and emulate your reticence. ;)D programs. Or do you not think readibility is a factor in understanding?I do think readability is a factor in understanding, which is why I prefer the VisualBasic way, where the editor re-writes every line of code to comply to a readability standard, whether you like it or not. But I am not going to tell people how to code to some common readability standard, especially when they are clearly against it and unlikely to change. Hence the bikeshed comment. I apologize everyone, this will be my last post on the subject of tabs and spaces.
Jun 14 2004
On Mon, 14 Jun 2004 08:44:14 -0700, stonecobra <scott stonecobra.com> wrote:Caring about this issue is evil, IMHO. Whoever wrote the code wrote the code, you are welcome to write code the way you do. Code talks... My, what a lovely bikeshed you have :) Can we worry about D here, instead of coding standards? Even if Walter were to untabify, he would untabify at 8 spaces per tab, which all of you would dislike.Un-tabbifying is not the soln, using \t instead of 4 spaces is. If you have \t then your editor can decide how to display it. If you have \t you can easily convert every odd one into 4 spaces to print it, etc..Why not just live with the code that was written for you?Sure, but, it'd be nice to be able to read it as well. Regan -- Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/
Jun 14 2004
On Mon, 14 Jun 2004 10:05:32 +0100, Lars Ivar Igesund <larsivar igesund.net> wrote:Tabs in source code is evil (IMNSHO).IMHO they're better than spaces. Regan -- Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/
Jun 14 2004
On Sun, 13 Jun 2004 23:52:23 -0700, Walter <newshound digitalmars.com> wrote:"Regan Heath" <regan netwin.co.nz> wrote in message news:opr9klqrto5a2sq9 digitalmars.com...:)If so, yuck! no wonder there is a problem! What crack addled chimpanzee decided that was a good idea??![Raising hand] -- crack addled chimpanzeeP.S. Adding a tab-to-space converter for release raises the spectre of having same-only-different versions of the source, something that isn't worth it.I agree.P.P.S. "So you cannot tell a printer to use a different tabstop?" Sure I can. If I can find where I put the documention on it. And for my source debugger, and Explorer, and the command prompt, and the linux printer driver, and on and on, and for everyone else who wants to look at the code as well. No thanks. Switching tab stops is like using a Dvorak keyboard. Sure, qwerty sucks, but it sucks worse to be unable to type on any keyboard but your own - and like your friend will let you install a Dvorak driver on his laptop so you can check your email <g>.Sad but true. So basically you should give up your 'dvorak' text editor and use a broken one like the rest of us? IMO not mixing tabs and spaces, and using an editor that displays tabs as x spaces gives you the most flexibility, and everyone else the most flexibility, to be honest how often do you print source code? Representing a tab as 4 spaces in one instance and as a \t in the other just seems wrong to me. It's a gut reaction. Regan. -- Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/
Jun 14 2004
"Regan Heath" <regan netwin.co.nz> wrote in message news:opr9kj2ig85a2sq9 digitalmars.com...What I *never* do is use both spaces AND tabs on one line, as this will never look right except under the same conditions as I wrote it.Despite most programmers mixing the two (including me), your technique only works for leading tabs. Using tabs to line up, say, right hand comments (a common style) fails even if you eshew spaces.
Jun 13 2004
On Sun, 13 Jun 2004 23:34:15 -0700, Walter <newshound digitalmars.com> wrote:"Regan Heath" <regan netwin.co.nz> wrote in message news:opr9kj2ig85a2sq9 digitalmars.com...You've got me backwards.. I specifically said I use spaces to line things up. Regan. -- Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/What I *never* do is use both spaces AND tabs on one line, as this will never look right except under the same conditions as I wrote it.Despite most programmers mixing the two (including me), your technique only works for leading tabs. Using tabs to line up, say, right hand comments (a common style) fails even if you eshew spaces.
Jun 14 2004
"Regan Heath" <regan netwin.co.nz> wrote in message news:opr9lt690b5a2sq9 digitalmars.com...On Sun, 13 Jun 2004 23:34:15 -0700, Walter <newshound digitalmars.com> wrote:Ok, my mistake."Regan Heath" <regan netwin.co.nz> wrote in message news:opr9kj2ig85a2sq9 digitalmars.com...You've got me backwards.. I specifically said I use spaces to line things up.What I *never* do is use both spaces AND tabs on one line, as this will never look right except under the same conditions as I wrote it.Despite most programmers mixing the two (including me), your technique only works for leading tabs. Using tabs to line up, say, right hand comments (a common style) fails even if you eshew spaces.
Jun 15 2004
"Walter" <newshound digitalmars.com> wrote in message news:cajbos$2ggr$1 digitaldaemon.com..."Ant" <duitoolkit yahoo.ca> wrote in message news:pan.2004.06.14.02.07.52.929078 yahoo.ca...Aren't you just backing up my argument that you untabify your source before bundling. As it stands, it's not context-free, since it assumes tabstops are 8. There's no good saying that others are wrong, since there's a proliferation of editors that use soft tabs, set to the "scientifically optimal" 4. If you want your code to appear correctly irrespective of context, it needs to be untabified. Otherwise, you're going to look like Betamax, and everyone else'll be seeing your code through the eyes of VHS. Of course, I could just remember to untabify (with -t8) the DMD source every time I download. But I already think it's amazing quality, it's others you should be concerned with. =POn Sun, 13 Jun 2004 18:47:21 -0700, Walter wrote:printer,you are stuck in the past, sorry.Sorry, I'm using the latest Microsoft Explorer, the latest HP laserstopsthe latest Windows XP, and Red Hat Linux 9. All have 8 character tabI use microEmacs. Tabs are fixed at 8 <g>. But seriously, if you use non-8 character tabs, the code won't print without using a special print program (when I want to print code, I don't want to look up the printer driver and try to figure out what arcane way to reset the tab stops, print, then set it back, I just want to print it), it won't look right in the source level debugger, it won't work as <pre></pre> in html pages, it won't 'type' to the screen on command prompt, etc. I don't want to run it through a perl script just so I can look at it. Non-8 tabs always going to be out of step with the way everything works. The code will always format like **** when emailed to someone who can't print it without special settings, etc. It might be fine for closely held source, but for widely distributed source, tabs need to kowtow to the default on practically every piece of hardware and software that displays ascii text. I know lots of code editors that have soft tab settings. But as soon as you leave that environment, every other program or hardware that displays text will go awry with the result. Distributed source code should be context-free, i.e. it shouldn't need to come with an external set of instructions saying what format it is in. And nobody ever bothers giving such instructions, so the inevitable result is the code looks like **** when brought up in an editor.wired in <g>.They are also living in the past ;) printer? printer? who prints things anymore? that's 20th century ;) But, that list doesn't contain a code editor. All posters on this thread use tabs. inclusive the original poster that asked for spaces! all of them redefine the tab stops.
Jun 13 2004
Matthew wrote: <snip>Aren't you just backing up my argument that you untabify your source before bundling. As it stands, it's not context-free, since it assumes tabstops are 8. There's no good saying that others are wrong, since there's a proliferation of editors that use soft tabs, set to the "scientifically optimal" 4. If you want your code to appear correctly irrespective of context, it needs to be untabified.<snip> Yes, most coding environments do seem to be set to a tab size of 4. Indeed, I would somehow doubt there to be any universal standard here. If anything, then I guess someone decided 8 would be a good number for his/her/its purposes, and various people followed suit. OTOH, programmers felt that 8 was too wide, and the 4-space tab caught on in that community. I don't know about the old Fortraners, when they had to indent every statement by 8 chars anyway.... There are three options being discussed here... 1. Tabs only Pros: - disk space efficient - easy and painless to type - when viewed in an editor with customisable tab sizes, appears at the size the user finds most comfortable Cons: - when viewed at bigger tab size, long, deeply indented lines are more likely to fall off the screen 2. Spaces only Pros: - consistent display - some editors can auto-convert tabs to spaces, making this form easy to produce - layout preserved in situations where tab chars may not be transmitted/rendered properly Cons: - take up more disk space - tedious to type in primitive editors (e.g. Notepad) - harder to maintain by others who prefer tabs, if their tab width is different (e.g. two-space indentation seems to tend to come out of Emacs users....) 3. Tabs with space half-indentation Pros: - finer, more 'comfortable' indentation than some tab width hard-coded in certain contexts - less tedious than all-space indenting in Notepad - slightly more compact on disk than all-space indenting Cons: - looks a mess/hard to follow in environments having different tab width OK, so option 2 has the most cons, but the first is fairly minor and the rest are somewhat dependent on other factors. And I imagine most programmers don't edit their code in Notepad, which isn't very suited to the task anyway. The con of 1 isn't all that serious when you consider that people aren't all going to be viewing at the same window width anyway. OTOH, when I try to maintain code written in technique 3, I invariably find myself 'tidying' the indentation so that it makes sense in my comfort settings. NTS, I prefer 1, and tend to release code with the tabs still in place. But if I'm putting code on a web page, then I change them to spaces. When posting code to a newsgroup I don't seem to be consistent, and I'm not sure how different newsreaders handle tab chars.... Stewart. -- My e-mail is valid but not my primary mailbox, aside from its being the unfortunate victim of intensive mail-bombing at the moment. Please keep replies on the 'group where everyone may benefit.
Jun 14 2004
On Mon, 14 Jun 2004 12:17:26 +0100, Stewart Gordon <smjg_1998 yahoo.com> wrote:Matthew wrote: <snip>or anyone can, trivially, with a small program.Aren't you just backing up my argument that you untabify your source before bundling. As it stands, it's not context-free, since it assumes tabstops are 8. There's no good saying that others are wrong, since there's a proliferation of editors that use soft tabs, set to the "scientifically optimal" 4. If you want your code to appear correctly irrespective of context, it needs to be untabified.<snip> Yes, most coding environments do seem to be set to a tab size of 4. Indeed, I would somehow doubt there to be any universal standard here. If anything, then I guess someone decided 8 would be a good number for his/her/its purposes, and various people followed suit. OTOH, programmers felt that 8 was too wide, and the 4-space tab caught on in that community. I don't know about the old Fortraners, when they had to indent every statement by 8 chars anyway.... There are three options being discussed here... 1. Tabs only Pros: - disk space efficient - easy and painless to type - when viewed in an editor with customisable tab sizes, appears at the size the user finds most comfortable Cons: - when viewed at bigger tab size, long, deeply indented lines are more likely to fall off the screen 2. Spaces only Pros: - consistent display - some editors can auto-convert tabs to spaces, making this form easy to produce- layout preserved in situations where tab chars may not be transmitted/rendered properly Cons: - take up more disk space - tedious to type in primitive editors (e.g. Notepad) - harder to maintain by others who prefer tabs, if their tab width is different (e.g. two-space indentation seems to tend to come out of Emacs users....) 3. Tabs with space half-indentation Pros: - finer, more 'comfortable' indentation than some tab width hard-coded in certain contextsdo you mean "in an editor with hard coded tabstops of 8 spaces it looks nicer than tabs does"?- less tedious than all-space indenting in Notepadthis is also a con, if you re-word it as.. - slightly more tedious than all-tab indenting in notepad.- slightly more compact on disk than all-space indentingthis is also a con, if you re-word it as.. - slightly less compact on disk than all-tab indenting.Cons: - looks a mess/hard to follow in environments having different tab widthThese lists are excellent. It's important to nore that if "tabs only" is used it does not mean you cannot use spaces where you want/need to. I do this in msdev to align specific things like comments on columns to a static array of data etc. They stay aligned regardless of the tabstop as I do not mix spaces and tabs in doing it.OK, so option 2 has the most cons, but the first is fairly minor and the rest are somewhat dependent on other factors. And I imagine most programmers don't edit their code in Notepad, which isn't very suited to the task anyway. The con of 1 isn't all that serious when you consider that people aren't all going to be viewing at the same window width anyway. OTOH, when I try to maintain code written in technique 3, I invariably find myself 'tidying' the indentation so that it makes sense in my comfort settings. NTS, I prefer 1, and tend to release code with the tabs still in place.This is my preference also.But if I'm putting code on a web page, then I change them to spaces. When posting code to a newsgroup I don't seem to be consistent, and I'm not sure how different newsreaders handle tab chars...Regan. -- Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/
Jun 14 2004
Regan Heath wrote: <snip>Well, there are plenty of programs out there that aren't small. D is supposed to be suited to million-line projects according to the docs.2. Spaces only Pros: - consistent display - some editors can auto-convert tabs to spaces, making this form easy to produceor anyone can, trivially, with a small program.Yes. But also situations where code is merely displayed and/or transmitted, rather than edited, under the same constraint.- layout preserved in situations where tab chars may not be transmitted/rendered properly Cons: - take up more disk space - tedious to type in primitive editors (e.g. Notepad) - harder to maintain by others who prefer tabs, if their tab width is different (e.g. two-space indentation seems to tend to come out of Emacs users....) 3. Tabs with space half-indentation Pros: - finer, more 'comfortable' indentation than some tab width hard-coded in certain contextsdo you mean "in an editor with hard coded tabstops of 8 spaces it looks nicer than tabs does"?Yes, I was kind of thinking that myself. I guess that, on average, the number of spaces would outweigh the halving of the number of tab characters.... <snip>- less tedious than all-space indenting in Notepadthis is also a con, if you re-word it as.. - slightly more tedious than all-tab indenting in notepad.- slightly more compact on disk than all-space indentingthis is also a con, if you re-word it as.. - slightly less compact on disk than all-tab indenting.It's important to nore that if "tabs only" is used it does not mean you cannot use spaces where you want/need to. I do this in msdev to align specific things like comments on columns to a static array of data etc. They stay aligned regardless of the tabstop as I do not mix spaces and tabs in doing it.<snip> Yes, there's giving code a tabular layout. And boxed comments. Not to mention my tendency to indent subsequent lines of a statement by 2 spaces. Stewart. -- My e-mail is valid but not my primary mailbox, aside from its being the unfortunate victim of intensive mail-bombing at the moment. Please keep replies on the 'group where everyone may benefit.
Jun 15 2004
On Tue, 15 Jun 2004 11:54:28 +0100, Stewart Gordon <smjg_1998 yahoo.com> wrote:Regan Heath wrote: <snip>I think you have missunderstood. What I mean't here was that even if your editor couldn't convert it (tabs to spaces), you could write an app to do it for you. Thus you could produce an all spaces form easily.Well, there are plenty of programs out there that aren't small. D is supposed to be suited to million-line projects according to the docs.2. Spaces only Pros: - consistent display - some editors can auto-convert tabs to spaces, making this form easy to produceor anyone can, trivially, with a small program.True. This is Walters main argument for this tab/space style I believe.Yes. But also situations where code is merely displayed and/or transmitted, rather than edited, under the same constraint.- layout preserved in situations where tab chars may not be transmitted/rendered properly Cons: - take up more disk space - tedious to type in primitive editors (e.g. Notepad) - harder to maintain by others who prefer tabs, if their tab width is different (e.g. two-space indentation seems to tend to come out of Emacs users....) 3. Tabs with space half-indentation Pros: - finer, more 'comfortable' indentation than some tab width hard-coded in certain contextsdo you mean "in an editor with hard coded tabstops of 8 spaces it looks nicer than tabs does"?This would be my preffered coding style also. Regan. -- Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/Yes, I was kind of thinking that myself. I guess that, on average, the number of spaces would outweigh the halving of the number of tab characters.... <snip>- less tedious than all-space indenting in Notepadthis is also a con, if you re-word it as.. - slightly more tedious than all-tab indenting in notepad.- slightly more compact on disk than all-space indentingthis is also a con, if you re-word it as.. - slightly less compact on disk than all-tab indenting.It's important to nore that if "tabs only" is used it does not mean you cannot use spaces where you want/need to. I do this in msdev to align specific things like comments on columns to a static array of data etc. They stay aligned regardless of the tabstop as I do not mix spaces and tabs in doing it.<snip> Yes, there's giving code a tabular layout. And boxed comments. Not to mention my tendency to indent subsequent lines of a statement by 2 spaces.
Jun 15 2004
On Sun, 13 Jun 2004 22:07:52 -0400, Ant wrote:On Sun, 13 Jun 2004 18:47:21 -0700, Walter wrote:Hmmm...actually I don't. I never use them anymore. Haven't for many, many years now. The SPACE character is a fixed width but the TAB is variable, depending on many factors. The default is nearly always 8 spaces, but as that can be changed by nearly every (modern) editor and printing program, I gave up trying to keep code lined up using tabs."Ant" <Ant_member pathlink.com> wrote in message news:caihjb$1714$1 digitaldaemon.com...They are also living in the past ;) printer? printer? who prints things anymore? that's 20th century ;) But, that list doesn't contain a code editor. All posters on this thread use tabs.In article <caiaqb$ti1$1 digitaldaemon.com>, Walter says...TTYPrinters, the linux command prompt, the windows command prompt, the DOS command prompt, the RT-11 command prompt, TOPS-10 command prompt, everyatI've used from ASR-33 to VT-100, html browsers, etc., all have tab stopsSorry, I'm using the latest Microsoft Explorer, the latest HP laser printer, the latest Windows XP, and Red Hat Linux 9. All have 8 character tab stops wired in <g>.8. Programs that default to anything other than 8 should be abandoned. Programs that allow tab stops to be customized should be flogged.you are stuck in the past, sorry.inclusive the original poster that asked for spaces! all of them redefine the tab stops.The editors I use (EmEditor and Code-genie) automatically insert the right number of spaces when I press the TAB key. Oh well, its good to have a variety of opinions. Keeps the mind active. -- Derek Melbourne, Australia
Jun 14 2004
On Mon, 14 Jun 2004 22:43:41 +1000, Derek <derek psyc.ward> wrote:I see what you're saying.. what were you trying to line up? I use tabs, and my code lines up all the time regardless of the tabstop used. The reason it lines up is that I never mix tabs and spaces. I can send someone an example if they want, it might help show what I mean. In the somewhat rare event that I need to line something up with something else specifically i.e. comments on static table data, I use spaces so that it will always line up no matter what tabstop is used.Hmmm...actually I don't. I never use them anymore. Haven't for many, many years now. The SPACE character is a fixed width but the TAB is variable, depending on many factors. The default is nearly always 8 spaces, but as that can be changed by nearly every (modern) editor and printing program, I gave up trying to keep code lined up using tabs."Ant" <Ant_member pathlink.com> wrote in message news:caihjb$1714$1 digitaldaemon.com...They are also living in the past ;) printer? printer? who prints things anymore? that's 20th century ;) But, that list doesn't contain a code editor. All posters on this thread use tabs.In article <caiaqb$ti1$1 digitaldaemon.com>, Walter says...TTYPrinters, the linux command prompt, the windows command prompt, theDOScommand prompt, the RT-11 command prompt, TOPS-10 command prompt,everyatI've used from ASR-33 to VT-100, html browsers, etc., all have tabstopsSorry, I'm using the latest Microsoft Explorer, the latest HP laser printer, the latest Windows XP, and Red Hat Linux 9. All have 8 character tab stops wired in <g>.8. Programs that default to anything other than 8 should beabandoned.Programs that allow tab stops to be customized should be flogged.you are stuck in the past, sorry.We're spoilt for choice. Regan -- Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/inclusive the original poster that asked for spaces! all of them redefine the tab stops.The editors I use (EmEditor and Code-genie) automatically insert the right number of spaces when I press the TAB key. Oh well, its good to have a variety of opinions. Keeps the mind active.
Jun 14 2004
"Walter" <newshound digitalmars.com> wrote in message news:caiaqb$ti1$1 digitaldaemon.com..."The Dr ... who?" <thedr who.com> wrote in message news:cagnmh$1md2$1 digitaldaemon.com...Well, yeah, we know, but ...I get your tab scheme - Vim's softtabs / smarttabs - but it's just a PITAwhenviewed with any other tools whose default tabs are not 8, or which havebeen setto another tab setting.Printers, the linux command prompt, the windows command prompt, the DOS command prompt, the RT-11 command prompt, TOPS-10 command prompt, every TTY I've used from ASR-33 to VT-100, html browsers, etc., all have tab stops at 8.Programs that default to anything other than 8 should be abandoned.... they are out there, and they are legion, and your code looks crapola in them.Programs that allow tab stops to be customized should be flogged.as aboveSure. My habit is to use hard tabs, with tabstops set at four. But before I release stuff I run scripts - http://synsoft.org/perl.html; the tabstop can be set with -t<tabstop> - to untabify everything en masse. It's a 0.1% effort thing.Is there a good reason why you (and anyone writing for Phobos) can'tchange tojust spaces only?Habit <g>.
Jun 13 2004
"Walter" <newshound digitalmars.com> wrote in message news:caiaqb$ti1$1 digitaldaemon.com..."The Dr ... who?" <thedr who.com> wrote in message news:cagnmh$1md2$1 digitaldaemon.com...PITAI get your tab scheme - Vim's softtabs / smarttabs - but it's just awhenTTYviewed with any other tools whose default tabs are not 8, or which havebeen setto another tab setting.Printers, the linux command prompt, the windows command prompt, the DOS command prompt, the RT-11 command prompt, TOPS-10 command prompt, everyI've used from ASR-33 to VT-100, html browsers, etc., all have tab stopsat8. Programs that default to anything other than 8 should be abandoned. Programs that allow tab stops to be customized should be flogged.I like having my tab width set to 3 spaces. I can see more code on the screen horizontally and still see the indentation well. I think that tabs should be used for indentation and spaces used for alignment, so that it looks fine to everyone's settings.Is there a good reason why you (and anyone writing for Phobos) can'tchange tojust spaces only?Habit <g>.
Jun 13 2004
On Sun, 13 Jun 2004 17:49:00 -0400, Vathix <vathixSpamFix dprogramming.com> wrote:"Walter" <newshound digitalmars.com> wrote in message news:caiaqb$ti1$1 digitaldaemon.com...I agree. I use a tab width of 4 for the same reasons. If you convert tabs to spaces then I cannot choose how to view your code, I am stuck viewing it how you want it. If you want something to be aligned regardless of tab sizes, then use spaces. If the code editor does not use a fixed width font, then all bets are off anyway where alignment is concerned. Regan -- Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/"The Dr ... who?" <thedr who.com> wrote in message news:cagnmh$1md2$1 digitaldaemon.com...PITAI get your tab scheme - Vim's softtabs / smarttabs - but it's just awhenTTYviewed with any other tools whose default tabs are not 8, or whichhave been setto another tab setting.Printers, the linux command prompt, the windows command prompt, the DOS command prompt, the RT-11 command prompt, TOPS-10 command prompt, everyI've used from ASR-33 to VT-100, html browsers, etc., all have tab stopsat8. Programs that default to anything other than 8 should be abandoned. Programs that allow tab stops to be customized should be flogged.I like having my tab width set to 3 spaces. I can see more code on the screen horizontally and still see the indentation well. I think that tabs should be used for indentation and spaces used for alignment, so that it looks fine to everyone's settings.Is there a good reason why you (and anyone writing for Phobos) can'tchange tojust spaces only?Habit <g>.
Jun 13 2004
In article <cagnmh$1md2$1 digitaldaemon.com>, The Dr ... who? says...Walter I get your tab scheme - Vim's softtabs / smarttabs - but it's just a PITA when viewed with any other tools whose default tabs are not 8, or which have been set to another tab setting. Is there a good reason why you (and anyone writing for Phobos) can't change to just spaces only?I would say use tabs only. If tabs and spaces are not mixed you'll have no problems. there are some disadvantages on using spaces for indentation. if tabs only are used you can set the indentation width to whatever you like. just to let every body know that tabs are better then spaces for indentation people migth have the wrong impression after your post. if Walter decides phobos must have indentation with spaces we all loose (but it's a small thing). Ant
Jun 13 2004
The Dr ... who? wrote:I get your tab scheme - Vim's softtabs / smarttabs - but it's just a PITA when viewed with any other tools whose default tabs are not 8, or which have been set to another tab setting. Is there a good reason why you (and anyone writing for Phobos) can't change to just spaces only?It's things like these that keep me from ever using hard tabs for anything, particularly in Python where the actual meaning of the code will get slaughtered along with the pretty formatting if anything should go awry. :) -- andy
Jun 13 2004
Oh no.. a holy war has ensued. There's a braindead simple solution to this. Here it is: FOLLOW THESE RULES: =================== 1. USE TABS FOR INDENTATION 2. USE SPACES FOR ALIGNMENT Follow those two rules and everyone will be happy when they view your code, regardless of their chosen tab display size (2, 3, 4, 8, ...). I've trained my team to work like this. It's painless, and every guy is happy, AND our code looks great. --Steve
Jun 15 2004
Stephen Waits wrote:FOLLOW THESE RULES: =================== 1. USE TABS FOR INDENTATION 2. USE SPACES FOR ALIGNMENTFollowing up with an example (printf call intentionally contrived): void func() { int x; // x-value float y = 0.0f; // y-value printf( "x = %d, y = %f\n", x, y ); } And here it is again, substitute tab characters with '^' and space characters with '_'. void_func() { ^int___x;_________//_x-value ^float_y_=_0.0f;__//_y-value ^printf( ^_______"x_=_%d,_y_=_%f\n", ^_______x,_y ^______); } Such a simple solution. Easy to do, produces great looking code. --Steve
Jun 15 2004
After reading the posts in this thread, I've come to the only logical conclusion one can make. You guys need better recreational pharmaceuticals. BA The Dr ... who? wrote:Walter I get your tab scheme - Vim's softtabs / smarttabs - but it's just a PITA when viewed with any other tools whose default tabs are not 8, or which have been set to another tab setting. Is there a good reason why you (and anyone writing for Phobos) can't change to just spaces only?
Jun 18 2004