Author: Matt Taylor
Date: 12:13:29 02/26/03
Go up one level in this thread
On February 26, 2003 at 15:04:55, Dann Corbit wrote:
>On February 24, 2003 at 23:04:36, Omid David Tabibi wrote:
>
>>On February 24, 2003 at 18:44:30, Dann Corbit wrote:
>>
>>>On February 24, 2003 at 18:21:53, Uri Blass wrote:
>>>
>>>>On February 24, 2003 at 18:00:25, Uri Blass wrote:
>>>>
>>>>>I see that I did not include it in the right order and now I have no problem.
>>>>>
>>>>>Uri
>>>>
>>>>Almost
>>>>
>>>>The only small problem is that I get slightly slower times(less than 1%
>>>>difference but I do not like it)
>>>>
>>>>344.90 seconds against 346.86 seconds and also the time in the middle has the
>>>>same pattern.
>>>>
>>>>I think that the exe is simply slightly slower than the previous exe because I
>>>>usually get more similiar results with the same code.
>>>
>>>C++ offers no real performance boost.
>>>
>>>For either C or C++ with the MS VC++ compiler, simply select the option that
>>>says "Inline any suitable function" and you will get the same sort of inline
>>>benefit.
>>>
>>>Unless you check not to allow structured exception handling, you should see a
>>>small *decrease* in performance.
>>>
>>>The only real reason to use C++ instead of C is for the better abstraction level
>>>that is possible.
>>
>>Another two reasons:
>>declare variables wherever you want
>
>A blessing and a cursing. And when it must be done, C can do it with a new
>block:
>
>C++
> /* ... */
> foo = bar();
> int temp;
> temp = calculate_stuff();
>
>C
> /* ... */
> foo = bar();
> {
> int temp;
> temp = calculate_stuff();
> }
>
>>use bool/true/false instead of BOOL/TRUE/FALSE
>
>typedef enum tag_bool {false=0 /* default, but shows intent */, true } bool;
>
>I must admit it does look better when we aren't screaming.
There's still NULL. I don't really have any preference, personally.
It is very true that declaring variables can be as much a curse. When pouring
over large pieces of code, it makes it difficult to locate the declartion of a
variable. For short-lived variables it is nice, but as you said you can always
start a new block. I have a lot of old C programs with debug code inside that
starts an arbitrary block so it can declare new, short-lived variables.
-Matt
This page took 0 seconds to execute
Last modified: Thu, 15 Apr 21 08:11:13 -0700
Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.