Page 1 of 5

Where's the joy in writing a chess engine?

Posted: Tue Sep 19, 2017 8:29 pm
by Tony P.
I have a conjecture that I'd like to check with the forum residents.

Namely, writing an engine can only be enjoyed by someone who already does software development as a job.

The thing is that the actual development is too stressful for an uninitiated person. Algorithm design in terms of pseudocode is much easier than making code actually work fast and as intended on real-life hardware. The latter is a huge problem that constrains one's fantasy.

Thus I suppose that coding an engine can only be enjoyable if one is already very disciplined at debugging and testing and has a very strong mindset that's not ruined by numerous bugs that inevitably happen (and, to make things worse, in chess programming, bugs tend to harm the engine's strength subtly instead of making it crash).

The reason why there are people who enjoy this utterly stressful hobby is perhaps that their main jobs are even more stressful and this hobby is something that sounds familiar but provides 'relative relaxation' because bugs in toy software like non-commercial chess engines don't have a monetary impact and thus don't place responsibility.

Even then, it puzzles me that some people like to have a hobby that reminds them of their jobs. I'd rather have a hobby that's orthogonal to the job, to forget about the job at least for a while.

Or am I missing something?

Anyway, thanks a lot to engine authors for suffering in order to provide us, mere mortals, with entertainment :!:

Re: Where's the joy in writing a chess engine?

Posted: Tue Sep 19, 2017 8:51 pm
by Robert Pope
Tony P. wrote:I have a conjecture that I'd like to check with the forum residents.

Namely, writing an engine can only be enjoyed by someone who already does software development as a job.
Seriously flawed assumption, as seen by the numerous authors who aren't professional software developers. Presumably, at least some of us don't dislike it, or we wouldn't do it.
The thing is that the actual development is too stressful for an uninitiated person. Algorithm design in terms of pseudocode is much easier than making code actually work fast and as intended on real-life hardware. The latter is a huge problem that constrains one's fantasy.
This has some truth in it. I am sure I do a number of things that a professional programmer would spot as basic flaws. That doesn't keep me from being able to enjoy developing a program, though. It might limit how strong it ever gets.
The reason why there are people who enjoy this utterly stressful hobby is perhaps that their main jobs are even more stressful and this hobby is something that sounds familiar but provides 'relative relaxation' because bugs in toy software like non-commercial chess engines don't have a monetary impact and thus don't place responsibility.

Even then, it puzzles me that some people like to have a hobby that reminds them of their jobs. I'd rather have a hobby that's orthogonal to the job, to forget about the job at least for a while.

Or am I missing something?
Often, people have jobs because that is what they like to do. So I don't think it is surprising when they continue to apply those interests after they get off work.

Re: Where's the joy in writing a chess engine?

Posted: Tue Sep 19, 2017 8:56 pm
by Robert Pope
I guess I forgot to answer the "where's the joy" part of your question.

I enjoy logic and figuring things out. I also enjoy programming computers, so it turns out I also enjoy using computers to create things and to figure things out. Chess, as a giant puzzle, lends itself well to that idea.

Re: Where's the joy in writing a chess engine?

Posted: Tue Sep 19, 2017 9:04 pm
by hgm
I am not a professional software developer; My job was in experimental physics research, although I occasionally also did some computational physics. I learned to program as a student, and I always liked it. I noticed that I had a tendecy to balance job and hobby; when at work I was setting up experimental equipment, I liked to program at home; when I was doing calculations, I build electronic equipment at home.

Building an engine is not especially difficult, once you know how to debug it. Sometimes you have to be a bit tenacious.

Re: Where's the joy in writing a chess engine?

Posted: Tue Sep 19, 2017 9:06 pm
by Tony P.
Thanks for the explanations, it's good to have you both as counterexamples ITT!

I wonder why those who enjoy their job, and would like to do it as a hobby too, don't simply take extra working hours.

I can think of a couple of reasons for this.

Firstly, there are FOSS proponents who feel that their corporate job isn't charitable enough.

Secondly, there are those who have relatives and/or partners who value their physical presence at home, and use the hobby as an outlet to do things similar to their occupation while being available at home.

Re: Where's the joy in writing a chess engine?

Posted: Tue Sep 19, 2017 9:09 pm
by kbhearn
A few things:

1) A chess engine is a bit more algorithm-oriented than most hobby programming projects you might take on. It makes it a bit more enjoyable for people who like thinking about such things than say... a user interface for anything which is a lot of design work and some very tedious programming to tie it all together.

2) Chess engines have considerably fewer moving parts than most algorithmic tasks you'd take on - so as much debugging as you think there is in writing a chess engine, other projects would be even moreso.

3) They're also small and focused enough to be handled by a single person rather than a team. If you say wanted to develop an open source video game as your hobby project, you'd either have to have a team of friends to work on it or have the talent in all of game design, UI design, art, and programming to get it to the point that others who are better at the parts you're not so good at will take an interest and start contributing.

4) While implementing it correctly is indeed very important, a common misconception is that it has to be 'fast' to be any good. Certainly at some point speed optimisations will become the low hanging fruit but there's a lot of more important work before you get to that point.

5) As a hobby project you're probably not sitting down with an initial goal of being a top chess engine (and if you are, my sympathies). Once you discard that as your goal, you don't necessarily have to take the engineering approach of rigorously testing many small variations with tens of thousands of games.

6) If you just want a taste of above engineering approach, there's always trying patches for stockfish in fishtest unchaining you from all the work of making a good core to an engine and allowing you to just try ideas you think might help (but probably don't).

Re: Where's the joy in writing a chess engine?

Posted: Tue Sep 19, 2017 9:14 pm
by Tony P.
kbhearn wrote:4) While implementing it correctly is indeed very important, a common misconception is that it has to be 'fast' to be any good. Certainly at some point speed optimisations will become the low hanging fruit but there's a lot of more important work before you get to that point.
Yes, exactly!

I don't like it that Stockfish is popularising the idea of dumbing down the static eval to gain strength by brute force. That's not how humans improve at chess.

Re: Where's the joy in writing a chess engine?

Posted: Tue Sep 19, 2017 9:27 pm
by Stan Arts
It's an intellectual challenge.
The game of chess is just complex enough so that you can approach the problem in endless different ways yet seemingly logical enough to have an irresistible attraction to some programmers minds.
Every chess programming layman must start out at some point thinking they can write something much better than what is currently around.

It's a trap.

I started some 15 years ago after having picked up playing chess again. Didn't take long to find some chess programs, get fascinated by them and think..I can do that.

I enjoy the early stages. Thinking out data structures, writing a search tree algorithm, move generation etc. And then have it play it's first moves. It's a brainchild.

Now on it's 4th incarnation I am "done". Nemeton and it's data structures was the final thing I had to get out of my system. But..I still can't completely keep my hands off of it.

Re: Where's the joy in writing a chess engine?

Posted: Tue Sep 19, 2017 9:28 pm
by duncan
hgm wrote:
Building an engine is not especially difficult, once you know how to debug it. Sometimes you have to be a bit tenacious.
for you it may not be especially difficult and probably with all the information out there it is not as hard now as twenty five years ago.

but for for most people I suspect it would be extremely difficult.

Re: Where's the joy in writing a chess engine?

Posted: Tue Sep 19, 2017 9:38 pm
by Rebel
Tony P. wrote:Even then, it puzzles me that some people like to have a hobby that reminds them of their jobs. I'd rather have a hobby that's orthogonal to the job, to forget about the job at least for a while.
I can't imagine a programming job that is more creative than chess prgramming.