Email address obfuscation in effect -- please
click here to turn it off.
[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
- To: EMAIL:PROTECTED, MLUG Members <EMAIL:PROTECTED>
- Subject: Re: [MLUG] Quick programming question on style
- From: Vern Green <EMAIL:PROTECTED>
- Date: Fri, 3 Jun 2005 07:50:45 -0700
- Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=s3W8OKxIKMmUh7IfQ9cvQCKDhWrZnRY0NgW7+IAi1fvpKSM/xXh/G+eUJnlYO0QlRWNr2VQZ1DzXs65/XxjL6x9Qle+61nt5AeGjQp+j9WzelruwmE3LuH2+X+1ljn6PoXniZDIVCq9v2G+MAiL4h+LYF1Yp5QdNuxV7fJVmzFk=
- In-reply-to: <EMAIL:PROTECTED>
- References: <EMAIL:PROTECTED> <EMAIL:PROTECTED>
- Reply-to: Vern Green <EMAIL:PROTECTED>, MLUG Members <EMAIL:PROTECTED>
- Sender: EMAIL:PROTECTED
> 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