My workflow in learning Python
(Originally written in Day One on November 30th, 2015)
When Apple introduced iBooks into Mac OS X a couple of releases ago, I thought it was a dumb idea. Reading eBooks was meant to be done on an e-ink reader, such as a Kindle, or worst case, an iPad or tablet with an LCD screen. Who would want to read books on their actual computer?
It turns out, me. This may be big when it comes to learning Python. Oh, and having a 27” iMac doesn’t hurt, either.
On the left, are the iBooks I have imported. (Big thanks to O’Reilly for making their ebooks purchases DRM free and available as ePub, Kindle format, PDF and another format of which I can’t remember).
On the right is Atom, the text editor from the folks who brought you Github. I’ve just installed it as it is a little more lightweight than Coda, typically my text editor / IDE of choice on a Mac.
After reviewing the three Python books I bought, I’m starting with Think Python. Originally known as “How to Think Like a Computer Scientist” and written for Java, I chose this one, because, as the author puts in in the introduction:
“In January 1999 I was preparing to teach an introductory programming class in Java. I had taught it three times and I was getting frustrated. The failure rate in the class was too high and, even for students who succeeded, the overall level of achievement was too low.
One of the problems I saw was the books. They were too big, with too much unnecessary detail about Java, and not enough high-level guidance about how to program. And they all suffered from the trap door effect: they would start out easy, proceed gradually, and then somewhere around Chapter 5 the bottom would fall out. The students would get too much new material, too fast, and I would spend the rest of the semester picking up the pieces.
Two weeks before the first day of classes, I decided to write my own book. My goals were:”
“Keep it short. It is better for students to read 10 pages than not read 50 pages.
Be careful with vocabulary. I tried to minimize jargon and define each term at first use.
Build gradually. To avoid trap doors, I took the most difficult topics and split them into a series of small steps.
Focus on programming, not the programming language. I included the minimum useful subset of Java and left out the rest.”
Excerpt From: Allen B. Downey. “Think Python.” iBooks.
What I took away is he wanted to help students learn the basics of programming and computer science, not just the language. That’s what I need as I don’t have any background in the building blocks of programming. So even though the book is geared towards Python 3.x and I’m using Python 2.7 on my Mac and my CentOS server, I’m going to start with this book.
What’s great about doing this in iBooks side by side with my text editor and a terminal, is that when it comes time to do the exercises in the book, I can make a note right in iBooks. I highlight the exercise and click “Add Note”. I then paste in from a terminal the Python code from the exercise and the results. If I get it wrong, I’ll paste both the wrong and right code and make a note of how I fixed it. This should make review a lot easier.
Today’s focus was on math operations (and not using the math module built in to Python). Lots of parentheses and learning the order of operation. I also learned the hard way the difference between integers and floating point numbers as part of the exercises.