[gmpi] Re: Plugin Factory Update
- From: Jeff McClintock <jeffmcc@xxxxxxxxxx>
- To: gmpi@xxxxxxxxxxxxx
- Date: Wed, 02 Mar 2005 10:57:47 +1300
> That is, either way is fine by me, but I can't really argue in favor
> of the Yoda Way, since no one should be using a compiler that can't
> warn or fail on the if(a = b) typo these days. It used to be a smart
> trick, but with proper tools it's just pointless.
I have to agree. I make an "if(a=b)" mistake only once every 6 months,
and they're not difficult to detect.
To me, code maintenance and ease of debugging etc all rely on good
code readability.
I would even argue, that considering the rate you pay programmers,
code readability is the most important factor.
Jeff
David Olofson wrote:
On Tuesday 01 March 2005 00.09, Tim Hockin wrote:
On Tue, Mar 01, 2005 at 11:49:36AM +1300, Jeff McClintock wrote:
2. Ron.
"when comparing values in an 'if', put the constant value on the
left side, not the right."
I personally find this incredibly hard to read. If there is a
strong swell of support for this, then OK, but I *hate* it.
For some reason, I'm usually doing this in my code, despite GCC with
-Wall -Werror etc refusing to compile an if(a = b) typo. (It has to
be written as "if((value = get_something())) ...".)
That is, either way is fine by me, but I can't really argue in favor
of the Yoda Way, since no one should be using a compiler that can't
warn or fail on the if(a = b) typo these days. It used to be a smart
trick, but with proper tools it's just pointless.
//David Olofson - Programmer, Composer, Open Source Advocate
.- Audiality -----------------------------------------------.
| Free/Open Source audio engine for games and multimedia. |
| MIDI, modular synthesis, real time effects, scripting,... |
`-----------------------------------> http://audiality.org -'
--- http://olofson.net --- http://www.reologica.se ---
----------------------------------------------------------------------
Generalized Music Plugin Interface (GMPI) public discussion list
Participation in this list is contingent upon your abiding by the
following rules: Please stay on topic. You are responsible for your own
words. Please respect your fellow subscribers. Please do not
redistribute anyone else's words without their permission.
Archive: http://www.freelists.org/archives/gmpi
Email gmpi-request@xxxxxxxxxxxxx w/ subject "unsubscribe" to unsubscribe
----------------------------------------------------------------------
Generalized Music Plugin Interface (GMPI) public discussion list
Participation in this list is contingent upon your abiding by the
following rules: Please stay on topic. You are responsible for your own
words. Please respect your fellow subscribers. Please do not
redistribute anyone else's words without their permission.
Archive: http://www.freelists.org/archives/gmpi
Email gmpi-request@xxxxxxxxxxxxx w/ subject "unsubscribe" to unsubscribe
- Follow-Ups:
- [gmpi] The Master Plan
- From: Jeff McClintock
- References:
- [gmpi] Re: Plugin Factory Update
- From: David Olofson
Other related posts:
- » [gmpi] Plugin Factory Update
- » [gmpi] Re: Plugin Factory Update
- » [gmpi] Re: Plugin Factory Update
- » [gmpi] Re: Plugin Factory Update
- » [gmpi] Re: Plugin Factory Update
- » [gmpi] Re: Plugin Factory Update
- » [gmpi] Re: Plugin Factory Update
- » [gmpi] Re: Plugin Factory Update
- » [gmpi] Re: Plugin Factory Update
- » [gmpi] Re: Plugin Factory Update
- » [gmpi] Re: Plugin Factory Update
- » [gmpi] Re: Plugin Factory Update
- » [gmpi] Re: Plugin Factory Update
- » [gmpi] Re: Plugin Factory Update
- » [gmpi] Re: Plugin Factory Update
- » [gmpi] Re: Plugin Factory Update
- » [gmpi] Re: Plugin Factory Update
- » [gmpi] Re: Plugin Factory Update
- » [gmpi] Re: Plugin Factory Update
On Tuesday 01 March 2005 00.09, Tim Hockin wrote:
On Tue, Mar 01, 2005 at 11:49:36AM +1300, Jeff McClintock wrote:
2. Ron. "when comparing values in an 'if', put the constant value on the left side, not the right."
I personally find this incredibly hard to read. If there is a strong swell of support for this, then OK, but I *hate* it.
For some reason, I'm usually doing this in my code, despite GCC with -Wall -Werror etc refusing to compile an if(a = b) typo. (It has to be written as "if((value = get_something())) ...".)
That is, either way is fine by me, but I can't really argue in favor of the Yoda Way, since no one should be using a compiler that can't warn or fail on the if(a = b) typo these days. It used to be a smart trick, but with proper tools it's just pointless.
//David Olofson - Programmer, Composer, Open Source Advocate
.- Audiality -----------------------------------------------. | Free/Open Source audio engine for games and multimedia. | | MIDI, modular synthesis, real time effects, scripting,... | `-----------------------------------> http://audiality.org -' --- http://olofson.net --- http://www.reologica.se ---
---------------------------------------------------------------------- Generalized Music Plugin Interface (GMPI) public discussion list Participation in this list is contingent upon your abiding by the following rules: Please stay on topic. You are responsible for your own words. Please respect your fellow subscribers. Please do not redistribute anyone else's words without their permission.
Archive: http://www.freelists.org/archives/gmpi Email gmpi-request@xxxxxxxxxxxxx w/ subject "unsubscribe" to unsubscribe
- [gmpi] The Master Plan
- From: Jeff McClintock
- [gmpi] Re: Plugin Factory Update
- From: David Olofson