[computer-go] C++ parameter passing
Chris Fant
chrisfant at gmail.com
Thu Aug 10 05:35:31 PDT 2006
For some high quality apps/tools written in assembly, check out
http://grc.com. Dude is a stud. Everything he does is in assembly.
On 8/10/06, Don Dailey <drd at mit.edu> wrote:
> I know this may sound funny but one of the cleanest programs I did was
> written in assembler. I like oop but I made a clean program without
> it. The project was the old Rexchess program, the whole engine and
> thinking part was in assembler and the user interface (which I thought
> was horrible but strangely enough I got nothing but praise for it) was
> done in Pascal. We are going back a few decades!
>
> - Don
>
>
>
> On Thu, 2006-08-10 at 06:14 +0200, Chrilly wrote:
> > >Yes, it's a bad smell. This is a method on a BitBoard, which is
> > iterating through the points in that set, and xoring out the
> > corresponding elements of zobrist_numbers from the Zobrist has stored
> > in state. >Since it has to access fields within this BitBoard, I put
> > it in the BitBoard class. It would be better OOD to use an iterator of
> > some kind, but I'm obsessed with speed this week.
> >
> > If you are obsessed with speed, than make no classes at all. Good old
> > C style is the fastest. Classes have an overhead. But the main point
> > is, a class structure usually makes for this application things more
> > complicated without having a real benefit. Usually one has only one
> > array of zobrist_numbers. One can define this array globally and there
> > is no need to pass them as a parameter. I think the basic rule is: If
> > one is sure to have only one instantiation and also no sort of
> > class-hierarchy, one should avoid classes.
> > One can structure C-style code in the same way than classes. E.g. by
> > putting all Hash-Related code in one file, by naming conventions... In
> > my experience, one can make a mess in any programming language and
> > programming style and one can write also clear programms in any
> > programming language including Assemblers. The mess depends primarly
> > on one ones head and the age of programm. Over time every programm
> > gets messy.
> > The worst programming project I have worked ever was in Ada. Due to an
> > unclear and overambitious specifications it was a complete horror. It
> > was an error-tolerant Operating system. But only the user had do be
> > tolerant for the errors of the system. The project was cancelled after
> > spending about 1000 person years. I think clear specifications - (at
> > least in one ones head) - are much more important than a specific
> > programming style. Additionally one should always implement the most
> > simple solution which meets the criterion. KISS. Handtalk is a nice
> > example of this. Small, strong, stable. It does not matter that it was
> > written in Assembler. Actually I think that its like this not although
> > but because its written in Assembler. Assembler is more cumbersome
> > than C/Java.. and one thinks twice before one implements a complicated
> > idea.
> >
> > Even if one parallizes the programm it is in my experience better to
> > parallize by using processes and not by threads. If one has a cluster
> > one has to use processes anyway. But the main point is, that with
> > processes there are clear defined communication points and one can not
> > overwrite some variables in another process. So even for parallization
> > there is only one instance of basic structures.
> >
> > Chrilly
> >
> > _______________________________________________
> > computer-go mailing list
> > computer-go at computer-go.org
> > http://www.computer-go.org/mailman/listinfo/computer-go/
>
> _______________________________________________
> computer-go mailing list
> computer-go at computer-go.org
> http://www.computer-go.org/mailman/listinfo/computer-go/
>
More information about the computer-go
mailing list