Prev: integer
Next: shared memory question
From: Eric Sosman on 26 Feb 2010 17:49 On 2/26/2010 5:45 PM, Eric Sosman wrote: > [...] pi spaces. This is easily approximated by making the tab > key operate probabilistically, advancing to a three- or four- > space position with probabilities 0.142 and 0.858, respectively. > [...] You've heard of "fencepost errors?" This is a "newspost error." -- Eric Sosman esosman(a)ieee-dot-org.invalid
From: Richard Heathfield on 26 Feb 2010 18:03 Keith Thompson wrote: > Richard Heathfield <rjh(a)see.sig.invalid> writes: >> Tim Streater wrote: >> <snip> >> >>> Trouble with tabs is, what is a tab? >> A quick way of inserting exactly two spaces into the source. > > The One True Tabstop Width is 8. You, sirrah, are no Scotsman! <snip> -- Richard Heathfield <http://www.cpax.org.uk> Email: -http://www. +rjh@ "Usenet is a strange place" - dmr 29 July 1999 Sig line vacant - apply within
From: Stephen Sprunk on 26 Feb 2010 18:11 On 26 Feb 2010 11:53, Ben Pfaff wrote: > (Doesn't it take *forever* to reformat a large source tree, by > the way? It took a few minutes here just to run "wc" on the .c > files in a Linux kernel tree, and I imagine that "indent" is > slower than "wc".) Last time I checked, the vast majority of wc's runtime was opening, reading, and closing files, i.e. the parts that make the disk's head skip all over the place, not actually counting lines. indent does a little bit more with the data than wc does, but on a tolerably fast machine I suspect that the extra work would just fill in (a few of) the CPU cycles wc wastes while waiting for the disk... S -- Stephen Sprunk "God does not play dice." --Albert Einstein CCIE #3723 "God is an inveterate gambler, and He throws the K5SSS dice at every possible opportunity." --Stephen Hawking
From: Stephen Sprunk on 26 Feb 2010 18:16 On 26 Feb 2010 09:12, Tim Streater wrote: > On 26/02/2010 14:51, Richard Heathfield wrote: >> Tim Streater wrote: >>> Trouble with tabs is, what is a tab? >> >> A quick way of inserting exactly two spaces into the source. > > Since I don't know what tab setting you had when you handed me the code, > I think s/exactly two/a random number of/ applies here. That's a problem with _mixing tabs and spaces_, which is Evil(tm). If you use a tab character (inserted by pressing the tab key) for each level of indentation, each programmer can set the tab stops in his editor however he wants and it will look correct for everyone. (That introduces a new problem if you want to limit to 80 columns, but that can be remedied by saying "80 columns with X-character tabs".) S -- Stephen Sprunk "God does not play dice." --Albert Einstein CCIE #3723 "God is an inveterate gambler, and He throws the K5SSS dice at every possible opportunity." --Stephen Hawking
From: Phil Carmody on 26 Feb 2010 18:26
Julienne Walker <happyfrosty(a)hotmail.com> writes: >> 4. Does anyone care where the pointer * is? I prefer keeping to next to the >> type, rather than next to the variable name. >> >> EG. I like: char* firstName; and not so much: char *firstName; > > Just make sure you're consistent and nobody will care. :-) Horrifically wrong. Just make sure you're consistent with everyone else, and nobody will care. Phil |