Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Any idea's on how long it takes to learn C++, then create a chessmonster

Author: David Rasmussen

Date: 09:56:50 12/11/01

Go up one level in this thread


On December 11, 2001 at 11:47:19, David Hanley wrote:

>On December 11, 2001 at 03:07:36, David Rasmussen wrote:
>
>>On December 10, 2001 at 15:40:09, David Hanley wrote:
>>
>>>
>>>Robert.
>>>
>>>Everyone had their chess program written in C/C++.
>>>
>>>I'd say use something else.  C/C++ is really a high-level assembler.  It
>>
>>No it isn't. Especially not C++.
>
>Yes.  C++ is assembler with objects.

Not at all. Templates and generic programming alone is a revolution, that is
unique to C++, and has nothing to do with assembler. It is a general idea that
could be applied to all other languages. And object orientation is not as
important for application programmers in C++ as people want it to be. Library
writers is another matter entirely. The STL is very strong because of templates
and object orientation. But many programs (including chess programs) does not
necesarily have to be OO, even though they use the STL, which is.

>It's really not suitable(IMO) for writing
>programs of any size, unless execution time is much more important than
>programmer time and being bug free.

I've heard that statement many times. First of all, I don't agree that is
necesarily true, and also, it is very hard to determine which of the pros and
cons of the languages in question is most important.

>I've been on many commercial projects using
>C/C++ and i'm aware of what happens.  A lot of time ends up getting spent on
>things like finding corrupt pointers, trying to figure out who deallocates what,
>etc.
>

With bad programming, all languages can fail. But I agree that minute details
can sometimes take up a lot of the development time. Still, it is not an
inherent feature of C++. One can always encapsulate data in very safe types
(smart pointers, bounds checking simple types etc.).

>>Smalltalk, CommonLisp and SML are all nice languages in their own respect, but
>>there is no reason to choose any of those instead of C++.
>
>Well, yes there is.  The vast majority of programs of any size can be written in
>these languages much more quickly and compactly, and there's a lot of features

I disagree.

>built in to help keep programs bug free.  Things like garbage collection alone
>buy you quite a bit.
>

Sure, but the GC is not important for chess programs, usually. There is seldom a
lot of memory allocation going on.

>>
>>A good C++ programmer knowing tried and true C++ techniques and idioms will know
>>when to use what style and techniques and know that, if it is what the project
>>calls for, a C++ program can be expressed roughly as short and simple as with
>>any of the languages you mention above, but usually with much more flexibility
>>of style and performance.
>
>It sounds to me like you're just regurgitating part of strovsup's book, without
>knowing any of the languages in question very well, and i'm including c++ in my
>statement.
>

Maybe you're not listenling hard enough. Either way, you don't really know
anything about how much I now about various languages. I have written large
projects in most of the languages I mention, like compilers and chess programs.
Besides, I haven't read any of Stroustrup's books. What makes your statements
more valid than mine? Are you a better programmer than I am? Do you know more
about the languages in question? Do you know more languages?

>>
>>A beginner (and many "experts") should read the book "Accelerated C++" by Koenig
>>and Moo,
>
>Oh, i see, koenig's book.  Koenig is a c++ evalgelist; his book is toitally
>one-sided.  Getting koenig's opinion about outher languages is like asking a
>ford salesman about toyotas.
>

What does it matter if he is one-sided (which I can't read from "AC++" that he
is, as he is not talking at all about any other languages)? I wasn't mentioning
him for any language war purposes. I was stating what book people should (at
least) read, if they want to program C++.

You seem quite the evangelist yourself.

/David



This page took 0.01 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.