Brian Havard wrote:> > I've noticed that throughout the code there's quite a variety of formatting > styles, especially the size of TAB characters (4 or 8) and size of indents > (2 or 4). Is there any agreed standard for new code now?As far as I can see, tab is 8 spaces, and indent is 2 spaces, throughout the Vorbis code.> Oh, and whoever wrote the ogg code must get an electric shock every time he > hits the spacebar. It's full of spaceless lines like > "for(packets=0;;packets++)if(pl[packets]==-1)break;" > Ew! :)That was my reaction at first, as well... But now I find myself not hitting the long one, unless really necessary, as well. Still don't think it's readable, though. But we can use gnu indent, to change between "Monty readable code" and "human readable code", of course |-) (No flames please; this was a joke ;-) Cheers, Segher --- >8 ---- List archives: http://www.xiph.org/archives/ Ogg project homepage: http://www.xiph.org/ogg/ To unsubscribe from this list, send a message to 'vorbis-dev-request@xiph.org' containing only the word 'unsubscribe' in the body. No subject is needed. Unsubscribe messages sent to the list will be ignored/filtered.
I've noticed that throughout the code there's quite a variety of formatting styles, especially the size of TAB characters (4 or 8) and size of indents (2 or 4). Is there any agreed standard for new code now? Oh, and whoever wrote the ogg code must get an electric shock every time he hits the spacebar. It's full of spaceless lines like "for(packets=0;;packets++)if(pl[packets]==-1)break;" Ew! :) -- ______________________________________________________________________________ | Brian Havard | "He is not the messiah! | | brianh@kheldar.apana.org.au | He's a very naughty boy!" - Life of Brian | ------------------------------------------------------------------------------ --- >8 ---- List archives: http://www.xiph.org/archives/ Ogg project homepage: http://www.xiph.org/ogg/ To unsubscribe from this list, send a message to 'vorbis-dev-request@xiph.org' containing only the word 'unsubscribe' in the body. No subject is needed. Unsubscribe messages sent to the list will be ignored/filtered.
"Brian Havard" <brianh@kheldar.apana.org.au> writes:> Oh, and whoever wrote the ogg code must get an electric shock every time he > hits the spacebar. It's full of spaceless lines like > "for(packets=0;;packets++)if(pl[packets]==-1)break;" > Ew! :)I don't have any right to complain, but I think this format leaves a lot to be desired (unless you happen to be a compiler front-end). Is there any thought or hope of a switch to something like the gnu or linux (or any other) styles? (I guess I could create a "vorbis" style for emacs cc-mode. :-) --Mike -- [O]ne of the features of the Internet [...] is that small groups of people can greatly disturb large organizations. --Charles C. Mann --- >8 ---- List archives: http://www.xiph.org/archives/ Ogg project homepage: http://www.xiph.org/ogg/ To unsubscribe from this list, send a message to 'vorbis-dev-request@xiph.org' containing only the word 'unsubscribe' in the body. No subject is needed. Unsubscribe messages sent to the list will be ignored/filtered.
Jack Moffitt <jack@icecast.org> writes:> > I don't have any right to complain, but I think this format leaves a lot to be > > desired (unless you happen to be a compiler front-end). > > If you could see monty's screen, you'd know why it's like that.Well, if it turns out to be a one-line Braille display or something, I'm going to feel like a real ass... --Mike -- [O]ne of the features of the Internet [...] is that small groups of people can greatly disturb large organizations. --Charles C. Mann --- >8 ---- List archives: http://www.xiph.org/archives/ Ogg project homepage: http://www.xiph.org/ogg/ To unsubscribe from this list, send a message to 'vorbis-dev-request@xiph.org' containing only the word 'unsubscribe' in the body. No subject is needed. Unsubscribe messages sent to the list will be ignored/filtered.
maybe it wouldn't be a bad idea to apply a code reformatter like astyle? On Sat, 30 Dec 2000, Brian Havard wrote:> Date: Sat, 30 Dec 2000 18:42:52 +1000 (EST) > To: "vorbis-dev@xiph.org" <vorbis-dev@xiph.org> > From: "Brian Havard" <brianh@kheldar.apana.org.au> > Reply-To: vorbis-dev@xiph.org > Sender: owner-vorbis-dev@xiph.org > Subject: [vorbis-dev] Whitespace standard? > > I've noticed that throughout the code there's quite a variety of > formatting > styles, especially the size of TAB characters (4 or 8) and size of > indents > (2 or 4). Is there any agreed standard for new code now? > > Oh, and whoever wrote the ogg code must get an electric shock every time > he > hits the spacebar. It's full of spaceless lines like > "for(packets=0;;packets++)if(pl[packets]==-1)break;" > Ew! :) > > -- > >______________________________________________________________________________> | Brian Havard | "He is not the messiah! > | > | brianh@kheldar.apana.org.au | He's a very naughty boy!" - Life of > Brian | > >------------------------------------------------------------------------------> > > --- >8 ---- > List archives: http://www.xiph.org/archives/ > Ogg project homepage: http://www.xiph.org/ogg/ > To unsubscribe from this list, send a message to > 'vorbis-dev-request@xiph.org' > containing only the word 'unsubscribe' in the body. No subject is > needed. > Unsubscribe messages sent to the list will be ignored/filtered.--- >8 ---- List archives: http://www.xiph.org/archives/ Ogg project homepage: http://www.xiph.org/ogg/ To unsubscribe from this list, send a message to 'vorbis-dev-request@xiph.org' containing only the word 'unsubscribe' in the body. No subject is needed. Unsubscribe messages sent to the list will be ignored/filtered.
According to Brian Havard (sometime around Sat, Dec 30, 2000 at 06:42:52PM +1000):> I've noticed that throughout the code there's quite a variety of formatting > styles, especially the size of TAB characters (4 or 8) and size of indents > (2 or 4). Is there any agreed standard for new code now? > > Oh, and whoever wrote the ogg code must get an electric shock every time he > hits the spacebar. It's full of spaceless lines like > "for(packets=0;;packets++)if(pl[packets]==-1)break;" > Ew! :)Let's standardize on some options to indent(1) -- even though this messes up some things (just look at my comments table in ogg123 before and after a run through indent and you'll see what I mean), it makes code much more readable overall. -- Kenneth Arnold <ken@arnoldnet.net> / kcarnold / Linux user #180115 http://arnoldnet.net/~kcarnold/ <HR NOSHADE> <UL> <LI>application/pgp-signature attachment: stored </UL> -------------- next part -------------- A non-text attachment was scrubbed... Name: part Type: application/octet-stream Size: 233 bytes Desc: not available Url : http://lists.xiph.org/pipermail/vorbis-dev/attachments/20001230/49cbaccb/part-0001.obj
xiphmont@xiph.org (Monty) writes:> My 'style' is K&R standard except that I dislike spacing things out so > far that what could fit on one line takes up half the screen. I like > having as much functionality as possible visible together. I don't > intentionally obfuscate, it's just a religious distinction. > > Feel free to write new code in whatever way you like. Don't reformat > existing code, please.I can survive, I guess, except for one thing. The project really *needs* a standard for tab stops. (I'm talking about "what does a tab char represent", as opposed to C indentation style.) My preference would be mod 8, but mod 4 or even 2 would be acceptible so long as it's uniform throughout the code. An example of this problem can be seen in encoder_example.c, lines 117-127. Most of the file is mod 8, but it looks like someone added these lines with a mod 4 setting. The result is a file that can't be viewed correctly no matter how you set your tabs, as far as I can see. (To be fair, I should mention that I think Jack disagrees with me on this.) --Mike -- [O]ne of the features of the Internet [...] is that small groups of people can greatly disturb large organizations. --Charles C. Mann --- >8 ---- List archives: http://www.xiph.org/archives/ Ogg project homepage: http://www.xiph.org/ogg/ To unsubscribe from this list, send a message to 'vorbis-dev-request@xiph.org' containing only the word 'unsubscribe' in the body. No subject is needed. Unsubscribe messages sent to the list will be ignored/filtered.
xiphmont@xiph.org (Monty) writes:> > > > I don't have any right to complain, but I think this format leaves a lot to be > > > > desired (unless you happen to be a compiler front-end). > > I resemble that remark.Heh heh. I tend to look at source code as a work of art, to be judged by several design criteria, first and foremost human understandability.> No, a DEC Hinote that serves as an X head. Too slow for anything else. > CRT flicker makes my head hurt.Me, too. I've got my current screen going at 100Hz, but it doesn't solve the whole problem. I think it's also color-focusing problems, for me. Defocusing gives me an instant headache. Choosing a color that only uses two primaries (like yellow) seems to help some. The best monitor I ever had was one of those old Sparcstation monochrome monitors--hi res, hi refresh, razor sharp. --Mike -- [O]ne of the features of the Internet [...] is that small groups of people can greatly disturb large organizations. --Charles C. Mann --- >8 ---- List archives: http://www.xiph.org/archives/ Ogg project homepage: http://www.xiph.org/ogg/ To unsubscribe from this list, send a message to 'vorbis-dev-request@xiph.org' containing only the word 'unsubscribe' in the body. No subject is needed. Unsubscribe messages sent to the list will be ignored/filtered.
On 31 Dec 2000 17:32:10 -0600, Mike Coleman wrote:>xiphmont@xiph.org (Monty) writes: >> My 'style' is K&R standard except that I dislike spacing things out so >> far that what could fit on one line takes up half the screen. I like >> having as much functionality as possible visible together. I don't >> intentionally obfuscate, it's just a religious distinction.Does this mean you view your source in 4pt font too? You get lots of functionality visible that way :)>> Feel free to write new code in whatever way you like. Don't reformat >> existing code, please. > >I can survive, I guess, except for one thing. The project really *needs* a >standard for tab stops. (I'm talking about "what does a tab char represent", >as opposed to C indentation style.) My preference would be mod 8, but mod 4 >or even 2 would be acceptible so long as it's uniform throughout the code. > >An example of this problem can be seen in encoder_example.c, lines 117-127. >Most of the file is mod 8, but it looks like someone added these lines with a >mod 4 setting. The result is a file that can't be viewed correctly no matter >how you set your tabs, as far as I can see.Yep, this bugs me the most too and was the main reason I started this thread, I just couldn't remember where I'd seen it. My preference is to avoid using TAB characters altogether, that way there's no possible ambiguity. If they must be used they should be mod 8. -- ______________________________________________________________________________ | Brian Havard | "He is not the messiah! | | brianh@kheldar.apana.org.au | He's a very naughty boy!" - Life of Brian | ------------------------------------------------------------------------------ --- >8 ---- List archives: http://www.xiph.org/archives/ Ogg project homepage: http://www.xiph.org/ogg/ To unsubscribe from this list, send a message to 'vorbis-dev-request@xiph.org' containing only the word 'unsubscribe' in the body. No subject is needed. Unsubscribe messages sent to the list will be ignored/filtered.