To my grandparents, who paid for my first computer: an Amiga 1000.
front matter
preface
I began programming as a teenager, learning from fun books containing comic strips with wizards and turtles. I read magazines that showed me how to make my own simple games or cause silly effects to appear on the screen. I had fun.
But when I went to university, my books began discussing bank accounts, balances, sales departments, employees, and employers. I wondered if my life as a programmer would mean putting on a gray suit and writing code handling payroll systems. Oh, the horror!
At least half of my class hated programming with a passion. I could not blame them. Why did programming books have to be so boring, functional, and sensible?
Where was the sense of adventure and fun? Fun is underrated. Who cares if a book is silly and has stupid jokes if it makes you learn and enjoy learning?
That is one of the reasons I wrote this book. I wanted the reader to enjoy learning programmingnot through cracking jokes but by working through programming examples that are interesting and fun to do.
I promise you, there will be no examples modeling a sales department. Instead, we will do things like simulate rocket launches, pretend to be Caesar sending a secret message to his army commanders using old Roman encryption techniques, and many others.
The second important reason why I wanted to write this book is because people keep asking me, Julia? Isnt that a language only for science and scientists? Julia has had major success in this area, which is why the Julia community today is full of brainy people working on hard problems, such as developing new drugs and modeling the spread of infectious diseases, climate change, or the economy.
But no, you dont need to be a genius or a scientist to use Julia. Julia is a wonderful general purpose programming language for everyone! I am not a scientist, and I have enjoyed using it for over 9 years now. With Julia, you will find that you can solve problems more quickly and elegantly than you have done in the past. And as a cherry on top, computationally intensive code will run blisteringly fast.
acknowledgments
This book has lived through several incarnations. At one point, it was a self-published book. Later, chance brought me in touch with Manning Publications, and we agreed to work on publishing my book. Back then, I did not realize how much work I was getting myself into. In my mind, I would do minor revisions to the existing book, but from all the feedback I got, I realized I had to make many revisions.
At times I felt like giving up. However, despite the difficulties, I believe the extensive system Manning has set up to aid us authors has helped me make a significantly better book. For that, I must thank Nicole Butterfield, who got me to sign on with Manning. I have had two Manning editors: Lesley Trites, in the early phase of the book, and Marina Michaels, who with her considerable experience and steady hand has helped get me over the finish line. I would like to extend a thanks to Milan uri, my technical development editor, who helped me a lot with his feedback in determining when material was understandable (or not) to my target audience. My copyeditor Christian Berk was invaluable for me as a non-native English speaker in correcting any odd constructs or grammar I may have written.
Furthermore, Id like to thank the reviewers who took the time to read my manuscript at various stages during its development and who provided invaluable feedback: Alan Lenton, Amanda Debler, Andy Robinson, Chris Bailey, Daniel Kenney, Darrin Bishop, Eli Mayost, Emanuele Piccinelli, Ganesh Swaminathan, Geert Van Laethem, Geoff Barto, Ivo Balbaert, Jeremy Chen, John Zoetebier, Jonathan Owens, Jort Rodenburg, Katia Patkin, Kevin Cheung, Krzysztof Jdrzejewski, Louis Luangkesorn, Mark Thomas, Maura Wilder, Mike Baran, Nikos Kanakaris, Ninoslav erkez, Orlando Alejo Mndez Morales, Patrick Regan, Paul Silisteanu, Paul Verbeke, Samvid Mistry, Simone Sguazza, Steve Grey-Wilson, Timothy Wolodzko, and Thomas Heiman.
Special thanks go to Maurizio Tomasi, technical proofreader, for his careful review of the code one last time, shortly before the book went into production. Finally, thank you to the creators of Julia. You have created the programming language for the future, which I believe will transform the computer industry. That may sound like hyperbole, but I truly believe Julia is a major milestone in the evolution of programming languages.