Re: Paying developers to get features faster
From: Barry Margolin (barmar_at_alum.mit.edu)
Date: 01/24/04
- Previous message: JWMeritt: "artice: What keeps information security professionals up at night?"
- In reply to:(deleted message) Brad Olin: "Re: Paying developers to get features faster"
- Next in thread: Matt Palmer: "Re: Paying developers to get features faster"
- Reply: Matt Palmer: "Re: Paying developers to get features faster"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Date: Sat, 24 Jan 2004 01:56:45 GMT
In article <k33310hjf6f2j8k3qmbtfsvg242tps7cm2@4ax.com>,
Brad Olin <bwo@bwo1.com> wrote:
> >I might be thinking silly here but why not write
> >
> ><var> = <expression>;
> >if (<var>) ....
> >
>
> Actually, it should have been coded as...
>
> if ((<var> = <exp>) != 0)
>
> and your solution should be coded as...
>
> <var> = <exp>;
> if (<var> != 0)
>
> The ANSI C language assumes a non-zero compare by default. All you are
> trying to do here is to remove the assumption and confirm your compare
> statement. There are strict C compilers (not gcc) that would complain
> about your solution. They are a pain in the but to work with, but
> probably worth it in the long run.
Why? The style:
if (<var>) ...
is *extremely* common. Any compiler that warns about it will produce
volumes of warnings for thousands of perfectly fine programs. Any C
programmer who considers this poor style is way out of the mainstream.
I can't imagine these C compilers being very popular.
-- Barry Margolin, barmar@alum.mit.edu Arlington, MA *** PLEASE post questions in newsgroups, not directly to me ***
- Previous message: JWMeritt: "artice: What keeps information security professionals up at night?"
- In reply to:(deleted message) Brad Olin: "Re: Paying developers to get features faster"
- Next in thread: Matt Palmer: "Re: Paying developers to get features faster"
- Reply: Matt Palmer: "Re: Paying developers to get features faster"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Relevant Pages
|
|