A Question of Style
-
PIEBALDconsult wrote:
With SPACEs you know what you're getting.
But at what expense: four spaces is 8 bytes nowadays, one tab used to be a single byte. No wonder the latest and hottest machines keep resembling a TRS-80. :rolleyes:
Luc Pattyn [Forum Guidelines] [My Articles]
I use ListBoxes for line-oriented text, and PictureBoxes for pictures, not drawings.
I considered buying a 1TB hard drive last week, my current 200GB is nearly full of whitespace. At this point I write code just to delineate the whitespace. :-D
-
I considered buying a 1TB hard drive last week, my current 200GB is nearly full of whitespace. At this point I write code just to delineate the whitespace. :-D
PIEBALDconsult wrote:
delineate the whitespace.
I see. That's like movies aired to keep commercials apart. :)
Luc Pattyn [Forum Guidelines] [My Articles]
I use ListBoxes for line-oriented text, and PictureBoxes for pictures, not drawings.
-
And in all the years I used EDT I never considered writing macroes to do that. :doh:
Neither did I, EDT was just great at that time. :)
Luc Pattyn [Forum Guidelines] [My Articles]
I use ListBoxes for line-oriented text, and PictureBoxes for pictures, not drawings.
-
Neither did I, EDT was just great at that time. :)
Luc Pattyn [Forum Guidelines] [My Articles]
I use ListBoxes for line-oriented text, and PictureBoxes for pictures, not drawings.
I just did try it. Actually I found that EDT has some built-in support, but I couldn't get it to work. Maybe LSE does it better.
-
About the only thing it does well.
Need software developed? Offering C# development all over the United States, ERL GLOBAL, Inc is the only call you will have to make.
Happiness in intelligent people is the rarest thing I know. -- Ernest Hemingway
Most of this sig is for Google, not ego. -
I just did try it. Actually I found that EDT has some built-in support, but I couldn't get it to work. Maybe LSE does it better.
I've never really used LSE, I trust it does everything EDT did/does. :)
Luc Pattyn [Forum Guidelines] [My Articles]
I use ListBoxes for line-oriented text, and PictureBoxes for pictures, not drawings.
-
Uuuuuhhhh... so? :confused:
-
I've never really used LSE, I trust it does everything EDT did/does. :)
Luc Pattyn [Forum Guidelines] [My Articles]
I use ListBoxes for line-oriented text, and PictureBoxes for pictures, not drawings.
Every time I've accidently gotten into it I've had to Ctrl-C out because I couldn't figure out the right way. :sigh:
-
Every time I've accidently gotten into it I've had to Ctrl-C out because I couldn't figure out the right way. :sigh:
Doh. Don't they offer their letter-sized binders full of fancy manuals anymore? :doh:
Luc Pattyn [Forum Guidelines] [My Articles]
I use ListBoxes for line-oriented text, and PictureBoxes for pictures, not drawings.
-
The backspace key. Spaces are great for non-modern and cross platform editors where the actual tab may not align correctly allowing properly formatted code to be the same in all editors. However, if you are exclusively using one editor it would be silly to not use tabs. There is nothing worse than having to hit the backspace key n-4 times.
Need software developed? Offering C# development all over the United States, ERL GLOBAL, Inc is the only call you will have to make.
Happiness in intelligent people is the rarest thing I know. -- Ernest Hemingway
Most of this sig is for Google, not ego.Isn't that for people who make mistakes? ;P Another plus for spaces is that I use more than one tool for viewing code. When I am manually scanning documents in a folder, I use Total Commander's viewer for really quick perusal, but it doesn't support configurable tabs. But sometimes I am editing with an IDE. Other times with TextPad. And then I switch to my VirtualBox Ubuntu session and use whatever the hell I find on that thing. Forgetting other people (hey, what geek actually cares about others?), using spaces ensures my own accesses to a file are as consistent as possible.
Don't let my name fool you. That's my job.
-
What, if any, is the practical reason for preferring spaces over tabs? I use tabs because when I need to increase or decrease an indent, it's only a single character that must be added or deleted. I noticed that the Google Guidelines disallow tabs, and use only spaces. What have they got against tabs?
so if you like to do the following:
switch (foo) { case fooEasy: return 77; case fooVeryHardIndeed: return 88; default: return 11; }
different tab settings screw you up royally. In other words, tabs at the beginning of the line are ok, tabs on the middle of the text are not, but such a rule would be to complicated :) Second, there is "movement through tabs". Moving the caret right over a tab - does it move one space, or one tab? I prefer the current "visualize as spaces" for consistency (another in-depth discussion). If you do that, tabs become mere space savers, which is pointless today.
-
Doh. Don't they offer their letter-sized binders full of fancy manuals anymore? :doh:
Luc Pattyn [Forum Guidelines] [My Articles]
I use ListBoxes for line-oriented text, and PictureBoxes for pictures, not drawings.
I've downloaded a bunch of PDFs, LSE is part of DECset now (with CMS and MMS), so it's in there I expect. I didn't see one for EDT.
-
The backspace key. Spaces are great for non-modern and cross platform editors where the actual tab may not align correctly allowing properly formatted code to be the same in all editors. However, if you are exclusively using one editor it would be silly to not use tabs. There is nothing worse than having to hit the backspace key n-4 times.
Need software developed? Offering C# development all over the United States, ERL GLOBAL, Inc is the only call you will have to make.
Happiness in intelligent people is the rarest thing I know. -- Ernest Hemingway
Most of this sig is for Google, not ego.If you are using Visual Studio, you don't have to hit backspace multiple times...that's the beauty of shift+tab. You get the advantage of readable code in any editor, with the ease of formatting tabs.
-
so if you like to do the following:
switch (foo) { case fooEasy: return 77; case fooVeryHardIndeed: return 88; default: return 11; }
different tab settings screw you up royally. In other words, tabs at the beginning of the line are ok, tabs on the middle of the text are not, but such a rule would be to complicated :) Second, there is "movement through tabs". Moving the caret right over a tab - does it move one space, or one tab? I prefer the current "visualize as spaces" for consistency (another in-depth discussion). If you do that, tabs become mere space savers, which is pointless today.
I also recall helping a fellow student debug a COBOL program (1989, VAX/VMS, VT100), it turned out he had a TAB within some string data and couldn't figure why the system (I forget whether or not it was a run-time error) said it didn't have enough characters.
-
The backspace key. Spaces are great for non-modern and cross platform editors where the actual tab may not align correctly allowing properly formatted code to be the same in all editors. However, if you are exclusively using one editor it would be silly to not use tabs. There is nothing worse than having to hit the backspace key n-4 times.
Need software developed? Offering C# development all over the United States, ERL GLOBAL, Inc is the only call you will have to make.
Happiness in intelligent people is the rarest thing I know. -- Ernest Hemingway
Most of this sig is for Google, not ego.That is why there is a "Format Document" command (Under Edit | Advanced in VS, and in context menu in NetBeans) - so you can forget about spaces and tabs: do whatever you like to the source, than reformat entire file :-D And in multi-user environments (was Google mentioned?) spaces are the only common denominator between all editors' interpretations of what is a tab.
-
What, if any, is the practical reason for preferring spaces over tabs? I use tabs because when I need to increase or decrease an indent, it's only a single character that must be added or deleted. I noticed that the Google Guidelines disallow tabs, and use only spaces. What have they got against tabs?
At first I used tabs, but then I switched to spaces because I had to write some tables (arrays of structs actually) inside a source file which had multiple columns and a lot of rows, and tabs just made that more difficult IMO.
There is sufficient light for those who desire to see, and there is sufficient darkness for those of a contrary disposition. Blaise Pascal
-
What, if any, is the practical reason for preferring spaces over tabs? I use tabs because when I need to increase or decrease an indent, it's only a single character that must be added or deleted. I noticed that the Google Guidelines disallow tabs, and use only spaces. What have they got against tabs?
If the decision is up to me I prefer tabs (and tab size 4). The reason is that in any decent editor it's possible to configure the tab size so everyone can view and edit the source code with their own preferred tab size. Most document viewers have the same possibility, e.g. the viewer and compare tool in ClearCase. Naturally, if I encounter source code I have to edit and the indentation is based on spaces, I continue to use spaces in order not to mess up the source code. At my current assignment the coding guidelines states that spaces should be used and the "indentation size" is 2(!) spaces. In my opinion that indentation size is too small and makes the source code hard to read and follow. However, I only use tabs for indentation and possibly preceding comments at the end of a line. In all other cases I use spaces.
"It's supposed to be hard, otherwise anybody could do it!" - selfquote
"High speed never compensates for wrong direction!" - unknown -
Must admit, I prefer tabs, so I can indent 4 spaces, my colleague can indent 2 spaces - without changing source. All is well if using the same editor - but sometimes using notepad etc. stuffs up the tabs
If I knew then what I know today, then I'd know the same now as I did then - then what would be the point? .\\axxx (That's an 'M')
TheArtistFormallyKnownAsMaxxx wrote:
I can indent 4 spaces, my colleague can indent 2 spaces
Different indents in the same source? :~
-
TheArtistFormallyKnownAsMaxxx wrote:
I can indent 4 spaces, my colleague can indent 2 spaces
Different indents in the same source? :~
Yeah, because the editor interprets the tab to mean different things for different people. The underlying file consistently has 1 tab for an indent.
-
Yeah, because the editor interprets the tab to mean different things for different people. The underlying file consistently has 1 tab for an indent.
:doh: I was thinking of tabs expanded to spaces.