MLUG: Re: [MLUG] Quick programming question on style
Re: [MLUG] Quick programming question on style
Email address obfuscation in effect -- please click here to turn it off.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
> Do it right the first time.
> 
> > if (testcase == 1) {
> >
> > or
> >
> > if (testcase == 1)
> > {

Sometimes in the coding specifications they require you to program it
like the first example. I know in Chapter 4 of the PEAR standards
specifies it that way. I have a project I am working on for a major
aerospace firm that requires this type of coding.



On 6/3/05, Dave Lloyd <EMAIL:PROTECTED> wrote:
> On Fri, 3 Jun 2005, McIntosh Jason wrote:
> 
> > Had to drop an email and ask about this.
> >
> > If you, as a programmer, see something like the following - is it bad, good,
> > "spaghetti", ignore it, or what?
> >
> >
> > ----------
> >
> > if (mydate.save())
> > {
> > }else {
> > }
> > -----------
> 
> Looks like you do something and either
> 1. ignore the return values.
> 2. expect it to never return.
> 
> In either case, I think doing the above is in poor taste.  Of course,
> it's not nearly as obfuscated as they come.  I'd try to find out what
> we're doing and the right way to handle the unexpected situation.  If
> there's one thing that I've learned from mucking about in various UNIX
> kernels, it's that if you figure something will never fail, it will and
> it will fail at about 2AM the night before a customer's acceptance test
> is supposed to finish.
> 
> Do it right the first time.
> 
> > if (testcase == 1) {
> >
> > or
> >
> > if (testcase == 1)
> > {
> 
> I like the first better, but I think it's a style thing.  I think it's
> probably more important to be consistent.
> 
> 
> --dlloyd
> _______________________________________________
> members mailing list
> EMAIL:PROTECTED
> http://mlug.missouri.edu/mailman/listinfo/members
> 


-- 
Thanks
F Vernon Green

_______________________________________________
members mailing list
EMAIL:PROTECTED
http://mlug.missouri.edu/mailman/listinfo/members