It's interesting that you opppse OOP to performance. What I would say is:emadsen wrote:Hey Lucas. I just started rewriting MadChess using procedural code. To date, I've written it using object-oriented code, which I know performs worse. But I wanted to establish a benchmark using a familiar coding style, which I have: ~2250 ELO.If you were restarting from scratch, what would you do differently?
I'm still coding using C# but eliminating the OO abstractions and focusing on performance instead of code readability. I'm still using mailbox board representation because, quite frankly, I don't understand bitboards and all their clever bit-shifting. And I don't want to copy-paste code I don't understand.
Maybe one of these days I'll graduate to pure C and bitboards- and actually understand the code . For now, I'll just make MadChess procedural.
1. equivalent code in procedural or OO form should have roughly equivalent performance
2. OO is often misused, and most programmers drank too much OOP kool-aid, which results in absolutly stupid and crappy OO models which make the probpem far. more complicated than it should be. and result in unmaintainable and inefficient code.
It's not OOP itself that results in poor performance. It's misused OO, which causes bad design decisions, hence inefficient and unmaintainable code.
The are problems for which OOP is the rigjt way, for example GUI toolkits.
Here is the perfect example of what you should NOT do (this guy is high on OO kool-aid):
http://sharpchess.com/?page=50%20Develo ... ct%20Model
Trying to fit a class hierarchy on everything is akin to trying to fit squares in round holes. That's why Java is the worse programming language ever created. It has deformed the minds of an entire generation of programmers to think that everything should be an object, which is an apparently clever looking, but really completely idiotic idea.