Re: Why?? (prog question)

2009-04-01 Thread William Gordon Rutherdale
Polytropon wrote: Okay, now I understand what you mean. "Consistency" refers to the usage of spacing / tabbing for a given project that is adopted by several programmers. Yes, I agree with that: It's a very bad idea to have many different styles within the same project. . . . When I need to rea

Re: Why?? (prog question)

2009-04-01 Thread William Gordon Rutherdale
Oliver Fromme wrote Of course this is purely a matter of taste and personal preference. My preference is similar to yours, but my main reasoon is to save space. I think it is a ridiculous waste of space if every third line consisted only of a sole brace (opening or closing). To my eye, such li

Re: Why?? (prog question)

2009-04-01 Thread Polytropon
On Tue, 31 Mar 2009 18:53:51 -0400, William Gordon Rutherdale wrote: > Are you serious? Serious question, yes. > You set the standard on a given project. You decide > whether you are using spaces or tabs. If spaces, you decide how many > spaces per indent level. You ask the programmers to

Re: Why?? (prog question)

2009-04-01 Thread Oliver Fromme
Polytropon wrote: > FreeBSD defines additional exit codes to specify the reason for > exiting more precisely in /usr/include/sysexits.h - for your > example, exit(EX_USAGE); would be a good exit code. Actually, no. The purpose of the codes is for communication between SMTP processes (e.g. be

Re: Why?? (prog question)

2009-03-31 Thread William Gordon Rutherdale
Polytropon wrote: On Tue, 31 Mar 2009 07:48:00 -0400, William Gordon Rutherdale wrote: Tabbing is the worst form of indentation. It is *much* better to use spaces consistently. may I ask what exactly you mean by "consistently"? I've seen various opinions about how many spaces make u

Re: Why?? (prog question)

2009-03-31 Thread Gary Kline
On Tue, Mar 31, 2009 at 09:01:42PM +0200, Polytropon wrote: > On Tue, 31 Mar 2009 08:54:17 -0700, Gary Kline wrote: > > > 1. Use the tab character for indentation. You can set its > > >length with your favourite editor (e. g. mcedit: F9, > > >Options, General; joe: ^TD). Don't waste with s

Re: Why?? (prog question)

2009-03-31 Thread Gary Kline
On Tue, Mar 31, 2009 at 07:50:22AM -0400, William Gordon Rutherdale wrote: > This isn't a BSD question. It's just about elementary C. As other > people pointed out, you could have easily caught it anyway just by > turning on warnings. > > -Will > yep, you're right. i did have gcc al

Re: Why?? (prog question)

2009-03-31 Thread Giorgos Keramidas
On Tue, 31 Mar 2009 13:59:16 +0200, Polytropon wrote: > When I would compare both indentation forms, I'd say that tabbing > is the better form because > + you can set your individually preferred tab with using the >settings of your editor, be it 1, 4 or 8, I like using TAB for indentation t

Re: Why?? (prog question)

2009-03-31 Thread Polytropon
On Tue, 31 Mar 2009 19:20:17 +0100, Bruce Cran wrote: > Linux seems to have adopted sysexits.h too, which provides error codes > such as EX_USAGE and EX_CANTCREAT. Good to know this, thanks. I'm not a big Linux user and a much smaller Linux programmer (read: I don't program for Linux), so I wasn'

Re: Why?? (prog question)

2009-03-31 Thread Polytropon
On Tue, 31 Mar 2009 08:54:17 -0700, Gary Kline wrote: > > 1. Use the tab character for indentation. You can set its > >length with your favourite editor (e. g. mcedit: F9, > >Options, General; joe: ^TD). Don't waste with spaces. > > Ja, been doing this since 1978. Does anybody hit

Re: Why?? (prog question)

2009-03-31 Thread Bruce Cran
On Tue, 31 Mar 2009 11:21:22 +0200 Polytropon wrote: > 4. Use the predefined return codes, don't hardcode them. >FreeBSD has EXiT_SUCCESS and EXIT_FAILURE, they're for >maximum compatibility (such as with Linux). There are >more exit codes for differentiation, but they're specific >

Re: Why?? (prog question)

2009-03-31 Thread michael
Wojciech Puchar wrote: Tabbing is the worst form of indentation. It is *much* better to use spaces consistently. stupid discussion and off topic. everybody write code as he/she like, or as a team decided if it's not single person work. only end result matters. you know real programmers

Re: Why?? (prog question)

2009-03-31 Thread Oliver Fromme
Josh Carroll wrote: > [...] > Note also that your main should have an int return type and should > return a value. His main() function _did_ have an int return type (it wasn't declared to be void), but of course it's better style to write int explicitly. By the way, FreeBSD's style(9) recommen

Re: Why?? (prog question)

2009-03-31 Thread Gary Kline
On Tue, Mar 31, 2009 at 11:21:22AM +0200, Polytropon wrote: > I don't want to start a "style debate", but forgive me the > following annotations: > > 1. Use the tab character for indentation. You can set its >length with your favourite editor (e. g. mcedit: F9, >Options, General; joe: ^TD)

Re: Why?? (prog question)

2009-03-31 Thread Wojciech Puchar
Tabbing is the worst form of indentation. It is *much* better to use spaces consistently. stupid discussion and off topic. everybody write code as he/she like, or as a team decided if it's not single person work. only end result matters. ___ free

Re: Why?? (prog question)

2009-03-31 Thread Polytropon
On Tue, 31 Mar 2009 07:48:00 -0400, William Gordon Rutherdale wrote: > Tabbing is the worst form of indentation. It is *much* better to use > spaces consistently. may I ask what exactly you mean by "consistently"? I've seen various opinions about how many spaces make up one indentation level,

Re: Why?? (prog question)

2009-03-31 Thread William Gordon Rutherdale
Polytropon wrote: I don't want to start a "style debate", but forgive me the following annotations: 1. Use the tab character for indentation. You can set its length with your favourite editor (e. g. mcedit: F9, Options, General; joe: ^TD). Don't waste with spaces. 2. The main() function s

Re: Why?? (prog question)

2009-03-31 Thread William Gordon Rutherdale
This isn't a BSD question. It's just about elementary C. As other people pointed out, you could have easily caught it anyway just by turning on warnings. -Will Gary Kline wrote: people, i've been under the weather for days and will probably be for a few more. new and TEMPORARY meds dont l

Re: Why?? (prog question)

2009-03-31 Thread Polytropon
On Tue, 31 Mar 2009 07:48:00 -0400, William Gordon Rutherdale wrote: > Tabbing is the worst form of indentation. It is *much* better to use > spaces consistently. may I ask what exactly you mean by "consistently"? I've seen various opinions about how many spaces make up one indentation level,

Re: Why?? (prog question)

2009-03-31 Thread Polytropon
I don't want to start a "style debate", but forgive me the following annotations: 1. Use the tab character for indentation. You can set its length with your favourite editor (e. g. mcedit: F9, Options, General; joe: ^TD). Don't waste with spaces. 2. The main() function should be declared as

Re: Why?? (prog question)

2009-03-30 Thread Gary Kline
On Mon, Mar 30, 2009 at 11:08:57PM -0400, Josh Carroll wrote: > On Mon, Mar 30, 2009 at 10:57 PM, Gary Kline wrote: > > people, i've been under the weather for days and will probably be for a few > > more. > > new  and TEMPORARY meds dont like me, ugh. > > > > can anybody clue me in why the follo

Re: Why?? (prog question)

2009-03-30 Thread Joshua Gimer
Just 5 minutes too late. :) On Mon, Mar 30, 2009 at 9:13 PM, Joshua Gimer wrote: > main(int argc, char *argv[]) > > On Mon, Mar 30, 2009 at 8:57 PM, Gary Kline wrote: >> people, i've been under the weather for days and will probably be for a few >> more. >> new  and TEMPORARY meds dont like me,

Re: Why?? (prog question)

2009-03-30 Thread Joshua Gimer
main(int argc, char *argv[]) On Mon, Mar 30, 2009 at 8:57 PM, Gary Kline wrote: > people, i've been under the weather for days and will probably be for a few > more. > new  and TEMPORARY meds dont like me, ugh. > > can anybody clue me in why the followin joinline program fails to catch if > arg

Re: Why?? (prog question)

2009-03-30 Thread Josh Carroll
On Mon, Mar 30, 2009 at 10:57 PM, Gary Kline wrote: > people, i've been under the weather for days and will probably be for a few > more. > new  and TEMPORARY meds dont like me, ugh. > > can anybody clue me in why the followin joinline program fails to catch if > argc == 1? > > > /* >  * simple

Why?? (prog question)

2009-03-30 Thread Gary Kline
people, i've been under the weather for days and will probably be for a few more. new and TEMPORARY meds dont like me, ugh. can anybody clue me in why the followin joinline program fails to catch if argc == 1? /* * simple prog to join all | very nearly all lines of a text file that * make