I was asked in a comp.lang.lisp thread to elaborate on my choice of Lisp for writing poker room software, whether I had to convince my backers, etc. Poker room software, if you are wondering, is the client that you download at Pokeroom and the server that the client connects to.
The short answer is in
this article and no, because I have no backers. The longer answer is quite long because I'm driven not only by business rationale but also by lots of emotional reasons.
I started programming at about 14 while in Cuba, using Basic. I got my first paid computer job at 17. I was living in Russia and had to break the copy protection of some medical software. At 18 I was at Z-Code software in San Rafael, working with a bunch of great hackers. Anyone remembers Z-Mail for Unix?
This last point really has something to do with Lisp as the guy responsible for the terminal version of Z-Code was Bob Glickstein who wrote a
fine book about Emacs extensions. I'm sure Bob would have written Z-Mail in Lisp if the owners of the company would have let him. I don't think they were as fond of Lisp as he was. As for me, those setq's in my .emacs were really foreign to me and I was always begging Bob to fix this or that thing for me. That was 1994.
From 19 to 24 I made a fine career on Wall St finishing as head of prime brokerage technology at Deutsche Bank with a large financial package and a brand new Land Rover. I spent most of that time, writing trade processing systems in Perl. I wonder if this has been the secret of my success?
I did internet consulting for about a year, still hacking Perl, then switched to Java and started running my own offshore development shop. We even delivered a .NET app once /I can't believe I'm saying this!/. Most of the work was for the gaming industry and at some point the client ordered poker room software and I let a Siberian programming team convince me that the only way I could fit into the client's 125K budget was if I let them write the software in Delphi.
They suggested that I would have to charge the client 200K+ if they were to use C++. Of course I did not tell them how much I was charging the client, I was just multiplying their quote by two. I learned afterwards that they were a Delphi-only shop. I would say things went downhill from there. After a bankruptcy (the bank took the Land Rover away), botched poker project, returning to Russia to minimize costs and run my own development team on-site, disbanding the dev team for lack of work and selling software for a year, I decided to resurrect the Delphi poker.
For anyone interested, the original poker source code is
still available. Going open source was a marketing move on my part, that was the niche I was gonna occupy. The Linux of Poker Room Software! That did not work out, btw. I had better success selling the 90% done source code previously /did it twice/.
If I learned one thing during my year in software sales that was that it's better to sell a product that you own than to sell your services. I want to get rich! Yes, I do. I have not had a corporate job in 6 years and I want it to continue this way. I want the freedom to work on whatever I want! I have this freedom now except that I'm quite poor. Oh, well, at least I live in Tenerife and the temperature during the day never falls below +20C.
We are getting close to Lisp, I promise...
I consider myself to be a pragmatic and logical type. Maybe too logical since my psychologist suggested was that I pay closer attention to my feelings when making my decisions.
We are even closer to Lisp now...
That Delphi poker code is crap. I cannot bear the thought of looking at it again. I earnestly spent a couple of months trying to debug it and generally fix it up. No way, this is an app that by design cannot be verified! And I don't even like playing poker. Nonetheless, I had an opportunity on my hands to gain my creative freedom and I decided to excercise that opportunity. So back last summer I dedicated myself to finishing that poker software.
I'm a Unix guy and I hate Windows. I have been lusting after the PowerBook G4 ever after it came out. Software sales paid good and I bought one a year ago and had to take this into account when choosing my poker development tools. I considered Java too slow, Python too wordy, C# was not ready for cross-platform prime-time. So I chose C++.
Game development is something that I wanted to learn for a while and so I saved myself a bunch of Gamasutra articles before going on vacation last September. This one
was a revelation. I checked out Scheme and liked it a lot, I'm still not sure why. I don't think it was Scheme in particular, I think it was just the idea of using Lisp. Still, I came back and stuck to my C++ guns.
I consider myself handy with C++. I don't shy from learning complex things if they save me time. I started using the C++ Boost libraries. I wanted elegante ways to serialize my classes and Boost seemed to provide that. I scrapped my own hairy serialization code and dived into Boost. For one reason or another things did not turn out as elegant as I expected. I found that I'm not enjoying coding and that time that I could have better spent on application functionality is going to very low-level stuff that I should have been done with a while ago.
I forgot what straw broke the camel's back but I switched with Scheme a couple of months ago. Yes, all this swinging from one language to another was delaying my plans of eventual richess but if I was gonna spend most of the day at the keyboard I thought I should enjoy the process.
I read someone's response to the "My road to Lisp" survey and how they started with Scheme and then took up Common Lisp. I looked at CL and I don't think I want to go back. I came to think of it as a purely emotional decision. I'm lazy and I much prefer
(incf foo) to
(set! foo (+ foo 1)).
As for writing poker in Lisp, my card code (including hand ranking) in C++ is 450 lines vs. 111 lines of Lisp. The unit tests are 2019 lines of C++ and just 118 lines of Lisp. And most important of all, I'm thoroughly enjoing myself. Coding in Lisp just feels deep down good so why would I code in anything else?
I think my poker software will be much easier to maintain and enhance in Lisp. Adding new card games will be a snap. Lisp is made for writing poker-playing bots. Last but not least, I can offer clients the source code when they buy a license. I doubt they will go to anyone else for enhancements.