Preface to Q for Mortals Fourth Edition
It doesn't seem possible that I wrote the first set of notes on tables in q 20 years ago. The only documentation on q at that time was a set of cryptic notes from Arthur Whitney and a Primer by Dennis Shasha. The same questions were repeatedly asked by q novices on the mailing list and they were often answered by folks who preferred using k. The deal I made with Simon Garland of Kx was that I would ask all the dumb questions once and then I would record the answers for the benefit of others. We posted the first set of notes as a q tutorial on the KX Documentation website. And now here we are twenty years later with the fourth edition of Q for Mortals that is over 600 pages.
A lot has changed since then both in the language and its ecosystem. Perhaps most relevant for this tutorial is that q and kdb+ are now thoroughly documented on the KX web site. Since the publication of version 3 of Q for Mortals with the release of 3.2 ten years ago, q/kdb+ has evolved in functionality and complexity. The documentation on the KX website also expanded significantly and it has reached critical mass of coverage.
The primary consequence is that Q for Mortals no longer intends to be all-inclusive. This was nearly impossible already for the third edition and we now state categorically: Q for Mortals is not a reference for the q programming language and the kdb+ database. It remains as its subtitle indicates: a tutorial in q programming for novice to intermediate q programmers. In this edition you will see many references to the KX Documentation website for details. If your favorite advanced topic isn't covered here, we encourage you to publish your own book.
The basic approach for the fourth edition was to start with the third edition and enhance it. This involved checking every section against the current documentation on the KX Documentation website and updating as appropriate. We have added topics that were omitted from v3 and reworked many sections based on ten more years experience coding and training q, as well as suggestions made by readers. We have reviewed and updated every code snippet for accuracy by copy/paste into a q4.1 console session then copy/paste results back to the text. We added coverage of the major new features since v3.2 as prioritized by KX. Finally, diligent proof readers have reviewed the text line-by-line for technical, pedagogical and grammatical correctness as well as for typos and format errors. Any remaining mistakes are mine.
In this edition we have prioritized consistency with the presentation on the KX Documentation website but certain differences remain due to pedagogical or stylistic reasons. We point these out where applicable.
Thanks to the staff at KX for their thorough proofing. And special thanks to Roberto Salama, Rohith Pervala, Alex Cabana and Christian Cordoba Riascos who patiently listened to my endless revision and progress reports.
I trust that this fourth edition will offer cleaner and up-to-the-minute coverage of q and kdb+ 4.1 for everyone using q. Just don't expect it to be a reference manual.