This week we welcome David Kopec (@davekopec) as our PyDev of the Week! David is the author of Classic Computer Science Problems in Python from Manning, as well as several other books. He was even interviewed about his book by Talk Python! If you would like to see what open source projects he is working on, then you should head on over to Github. Now let's take some time to get to know David!
Can you tell us a little about yourself (hobbies, education, etc)?
Before I start, I want to thank Mike for including me in this series. Itâ€™s an honor.
Iâ€™m an assistant professor in the Computer Science & Innovation program at Champlain College in beautiful Burlington, Vermont, USA. Before becoming a full time professor, I worked professionally as a software developer, and Iâ€™m still open to taking projects on a consulting basis. I have a bachelors degree in economics (minor in English) from Dartmouth College and a masters degree in computer science, also from Dartmouth.
Iâ€™m the author of three programming books: Dart for Absolute Beginners (Apress, 2014), Classic Computer Science Problems in Swift (Manning, 2018), and Classic Computer Science Problems in Python (Manning, 2019). However, I no longer recommend the Dart book because itâ€™s very outdated. Iâ€™m also an active contributor to open source.
When Iâ€™m not working, I enjoy learning about American history, entrepreneurship, and keeping up with the world of computing (although thatâ€™s kind of my job too). I also have all the same hobbies that just about everyone hasâ€”cooking, traveling, film, reading (classics, biography, history, business dramas), television (Frasier & The Curse of Oak Island!), music, video games (Zelda & AOE2!), podcasts, stock trading, etc.
Why did you start using Python?
When I started graduate school at Dartmouth about a decade ago, I realized that many of my classes were in Python, so I thought: â€œI better get good at this language!" I really liked the language from the beginning, because of its succinctness and rich standard library. I appreciate how Python often closely resembles the pseudo-code you find in a textbook or you write on the board, but itâ€™s not pseudo-code, itâ€™s real-code.
Iâ€™ve used Python on-and-off for web development projects, and we teach several of our computer science courses at Champlain in Python.
What other programming languages do you know and which is your favorite?
Itâ€™s a fairly long listâ€”I know. I guess Iâ€™m a bit of a language optimist, because the one I like best is often the one Iâ€™m really deep into using on a project. Well, if you asked me five years ago about my favorite, I would probably say Objective-C. However, today I donâ€™t really have a favorite. My go-to languages right now are Swift for building Mac & iOS apps, Python for web or scripting work, and C for some of my hobby projects.
I know what I donâ€™t like, though. And thatâ€™s C++. I begrudgingly started to learn some of the recent changes in C++ 11, 14, and 17 last week. And while they generally make the language a bit better, they also make the thing I dislike most about C++ worseâ€”its size. Itâ€™s just such a big language with so many features that itâ€™s hard to wrap your head around it when youâ€™re not using it every day. Iâ€™ve heard it said that even people who write C++ professionally usually only use a subset of the language. I hope to never have the misfortune of writing C++ professionally, so hopefully I will never have to find out. All kidding aside though, itâ€™s not my favorite language. But based on my prior history, maybe Iâ€™d start to like it more if I just wrote more of it!
One recent worry Iâ€™ve had is that perhaps Iâ€™m context switching languages too much. In my work, itâ€™s not unusual for me to be answering student questions in Go, Swift, and Python during the day and then coming home and doing some of my own projects in C. The worry is that Iâ€™m no longer spending enough time in a single language to be fully realizing the benefits of mastery. Instead Iâ€™m trying to remember how to do something differently in one language than in another.
What projects are you working on now?
In my professional work, I have at least two projects over the summer. One is to translate the Android Development course Iâ€™ve been teaching the last three years from Java to Kotlin. Another is to revamp bits of a course I teach called Intro to Mobile & Web Development so that it has unit tests for many of the assignments. So, Iâ€™ll be learning yet another languageâ€”Kotlin.
In my open source work, me and my collaborator, Ferran, recently updated our graph data structure library, SwiftGraph, to version 3.0 with new features and support for Swift 5.
In my writing work. Iâ€™m spending some time promoting Classic Computer Science Problems in Python, which came out just a couple months ago. Iâ€™m also considering whether/when to start writing the next book in the Classic Computer Science Problems series. Weâ€™re considering either Java or Go for the next language in the series. I started writing a scifi novel, but Iâ€™m only 15 pages into it.
In my hobby development work, I should really update my Mac app for teaching young people programming in a Logo/BASIC like language, SeaTurtle, with some more tutorials and bug fixes. Iâ€™d love to publish a game too. I build prototypes sometimes, but I havenâ€™t had an idea that I feel is so strong (and that Iâ€™m capable of doing myself to the end) that Iâ€™ve pursued it.
Which Python libraries are your favorite (core or 3rd party)?
As I mentioned before, I like a lot of the standard library. functools, collections, and json are some I use particularly often. But, I also love just how much first-party miscellaneous useful stuff there is. Everything from command-line parsing (argparse), to database mangling (sqlite3), to email handling (email), and even compression (zlib) is in there. I find that super handy. As far as third-party packages go, Iâ€™m a fan of Requests, Beautiful Soup, and scikit-learn.
How did you become an author?
All three of my books came about because I wrote proposals and pitched them to publishers. The first one, Dart for Absolute Beginners, happened because I was excited about the Dart language in 2012 when it was still in beta, and I thoughtâ€”â€œgee, maybe my niche could be to write the first beginners book in this language for when it takes off." Unfortunately, the language never did take off. Perhaps it is now â€œtaking offâ€ as a result of Flutter, but now that book is woefully outdated. I really liked the language, and I think Dart for Absolute Beginners was a great book. However, while it was well received by readers and reviewers, it never had a large amount of sales due to the total Dart market being quite small.
What it did do for me is establish credibility and launch me into the computer science education space. It helped me get jobs (including my current one), and it gave me the track record to get a book deal for my next book, Classic Computer Science Problems in Swift. That book, again, was positioned to target a niche. There were plenty of Swift books in 2016/2017 when I wrote it, but they were all about iOS development. My book was going to get on the wave of this up-and-coming language but fill the hole of CS education in this language. And I think it did that pretty well.
But, frankly, what Iâ€™ve learned with the early success of Classic Computer Science Problems in Python, is that (for sales success at least) itâ€™s better to write a good niche book in a popular language, where there might be competitors, than write a good niche book in a fairly niche language. You donâ€™t want to be a niche within a niche. Thatâ€™s why choosing the language of the next book in the series is so hard. We ran a poll of Manning readers to see what language they would like next. Go and Java practically tied. Java is the Jupiter-sized language community that in many ways makes sense in the same way that Python made sense, but it seems like itâ€™s past its prime. Go is still growing rapidly. But if Go is still not really as popular as Swift (which by many metrics it doesnâ€™t appear to be)â€”then maybe Java still makes more sense right now. Originally I wanted to do Go and the publisher wanted to do Java. But now, Iâ€™m leaning towards Java too. And there is new stuff in the Java worldâ€”Java 9, 10, 11, and 12 have a few interesting new features.
What were some of the hardest things about writing your book?
One of the hardest things to deal with as an author or professor is that you are not a celebrity but you are still a public figure in the sense that people publicly review your work. Whether that be course reviews or book reviews. And many of those reviews will be accurate, and some of those reviews will be inaccurate. Itâ€™s often the people that hate or love your work most that will take the time to write a review. One weird thing is that Classic Computer Science Problems in Python has many good reviews on Twitter, on Manning.com, amongst official reviewers, but so far no Amazon reviews (at the time Iâ€™m writing this) despite being the best selling of my three books. That might be because it just came out two months ago. And I donâ€™t want to get fake reviews. So many niche technical books have positive fake reviews, usually put there by the publisher. So, hereâ€™s a call to action for people reading this blog. If you read CCSPiP from cover to cover (or nearly so), then please leave a review on Amazon. Especially if you liked it 🙂
Do you have any advice for others who would like to write about programming?
People donâ€™t write technical books for the money. Even a good technical book doesnâ€™t usually sell more than a couple thousand copies. Write a technical book because: you think youâ€™re a good writer, you think you can communicate the subject well, and/or you want the career advancement that comes with being a published author. Career advancement and glory are usually the main rewards. One other piece of advice: keep it pithy. Way too many technical (and non-technical) books are needlessly long. Publishers pressure you into writing as many pages as possible because they think that means they can charge more. Push back on that. Short and sweet is better than long and boring.
Thanks for doing the interview, David!
Copyright © 2022 Mouse Vs Python | Powered by Pythonlibrary