Hacker News new | past | comments | ask | show | jobs | submit login
Fundamentals of Python Programming [pdf] (southern.edu)
302 points by lainon on Oct 4, 2019 | hide | past | favorite | 37 comments

Love this book. I decided to make a career change about six months ago, found this book, and started learning Python. Over the past six months I've built four apps (after learning JS and a couple different frameworks), and have multiple interviews lined up for back-end roles.

For anyone interested in possibly writing an intro book (or some such material) in the future, here are a beginners thoughts on what makes this a good read:

(1) Heavy use of code examples, with accompanying explanations. For myself, at least, I learn a lot through examples, and seeing so many examples of functioning code was very beneficial. The explanations are easy to grasp, without dumbing the material down. Moroever, the examples are integrated with the flow of the material presented (so never arbitrary) and many build on each other as the chapters progress.

(2) Functions are presented before lists.

(3) He takes time to provide clear, precise, and deep definitions and explanations of the concepts. There is a near-philosophical exactness (like the exactness of analytical philosophy) in the descriptions.

(4) Formatting and organization. There was never a time where I felt lost as to where I was, where I was going, or where prior material was. Skim the book yourself to see the myriad ways it formats and presents the material to make study easy on the reader.

(5) The number of exercises/problems at the end of each chapter.

> I learn a lot through examples, and seeing so many examples of functioning code was very beneficial.

Quick sidebar: if you're looking for an intermediate/advanced-level book with a similar style of pedagogy, I can't recommend highly enough The Python Cookbook by David Beazley. There are recipes in that book that I'm quite honestly unsure how I would function without. And to the credit of the author, every code example functions as a complete, minimal, working example: paste it into a live python3.8 REPL session and it "just works" (which is contrary to what you might expect of a book published in 2013). Also, it's one of a few books that has a puckish, hackery-sort of mentality and doesn't shy away from hot-button topics like metaprogramming, tampering with the GIL, mining program runtime data from previous stackframes, etc.

>(2) Functions are presented before lists.

While it might not make the most sense for a beginner still learning the fundamentals to be taught lists before functions it's generally advantageous for introductory language books to focus on what the language excels at. But of course this is a fundamentals book and not every book needs to be general purpose!

Some examples of where this holds true: The Rust Programming Language introduces ownership concepts, a difficult topic even outside of Rust, immediately after the chapter on fundamental concepts like the data types, functions, and control flow. It could be argued that such a concept needs to be introduced early to understand the language more, although you see similar things with OOP being emphasised very early on in Java on the tutorials on the Sun/Oracle website. Any introduction to Perl will be very string processing heavy, and Ruby introductions, like Python, will introduce lists/splicing very early on. It's easier to appreciate as you pick up more languages.

Makes sense. Thanks for the insight!

Writing this up in a blog post would benefit many people thinking about a career change. What lead to it, how you went about it, etc.

If I get an offer, then I'll definitely consider doing this.

I'm a researcher interested in language acquisition so this is very interesting to me. Thank you for sharing! I have a couple questions:

1. Was Python your first programming language? / Was this book your first attempt at learning programming?

2. Why do you feel that presenting functions before lists was beneficial for you?

(1) If you count HTML as a programming language, then I had about 3 hours of HTML under my belt when I first started reading this book. Which is to say I understood nothing nothing about programming when I picked this up. I have a method for learning new domains, and a part of that method includes skimming intro books to find ones that seem well put together. So, I had also blitz skimmed a number of books before finding this one. One thing I noticed right away from this book was that it felt more like a normal textbook than most of the books I was skimming.

(2) This is not an easy question to answer, because it includes a lot of speculation, but I'll try. For me, at least, it was important to understand - in some rough sense - the nature of the concepts. Obviously, there is plenty more to the nature of the following basic concepts than what I provide, but here's the way I was perceiving the concepts:

Variables - being able to name and rename data (or code) and use different things you've named

Conditionals - run code under certain conditions

Loops - run the same code multiple times under certain conditions

Functions - reuse the same code at different points in time

Lists/Arrays - save code (or data) to later be used and/or manipulated

Looking back on this textbook, as well as the other material I read where lists/arrays were presented very early, I just think it was more natural to think about code reuse before thinking about storing stuff for use and manipulation.

Just my two cents.

I would naturally pair loops with iterables, such as lists, particularly in python. I wondered if it was more to do with learning to structure code before structuring data.

Personally, I'd be inclined to teach basic types and control flow, e.g. loops and conditions, before teaching how to structure code so that you can start with something long and repetitive and understand the benefit of utilising functions. Having said that, both are fairly basic concepts so I don't think you'd lose much either way.

> (2) Functions are presented before lists.

You're not kidding! Lists aren't until page 339 (of 654).

What books did you find that helped you the most in learning JavaScript and web development in general?

How did you learn JS?

I wish the author had written a Fundamentals of JavaScript Programming as well.

I read bits and pieces from a lot of different JS books, and studied the first half of Eloquent JavaScript. I spent most of my time reading stuff online (especially the MDN docs).

Consider using a site like CodeWars where you're tasked with solving actual challenges.

For years, I've read books and blogs as well as watched videos and learned some things, but, working through challenges is more motivating and forces me to produce. I rely on the same resources (books, blogs, videos), but through the lens of, "how can I accomplish X ?"

Not sure you will have a similar experience, but it works for me.

Definitely. I find that making solid progress on sites like codewars has been one of the best ways to improve my coding. Makes me better at planning as well as coming up with better solutions and is inherently motivating because you can hit well-defined goals in rapid succession.

I apologize for going off topic, but if the author is reading this (perhaps I should email him instead), please be informed that your work has been plagiarized on Amazon, by a book called "Python Programming: A Step By Step Guide From Beginner To Expert" [1]. Read the first few pages of the print book's "Look inside" and you'll see a word for word copy of the book.

Not only did they plagiarize your work, but they did a really poor job of it too. The print is full of formatting issues. The code blocks are not properly indented, which is not only poor style but also broken given that python is white-space sensitive. And bizarrely enough the letter "q" is continuously in bold throughout the whole book. You can easily verify this from the pictures by the reviewers. I don't actually own a copy of the book myself.

To make matters worse (or better?), they only decided to include the first four chapters, ending at "Conditional Execution". Yes, the plagiarized book claims to be a guide "from beginner to expert", yet it didn't reach the chapters on loops and functions!

If you read the reviews, you'll quickly notice that it's full of fake five-star reviews with very vague sentences, some of which don't even make sense. You'll also (now) see a lot of real one-star review, which means that quite a number of people have fallen for this scam.

Surprisingly, one of the fake reviewers even got in Amazon's top 100 reviewer list. Check the profile of "Kip Krenz" [2], who is currently at rank #53. Somehow he managed to review two to four books on a near daily basis for maybe a year or more, mostly five-stars (the rest are four-stars) and full of generic sentences. The books reviewed are most likely "fake" as well. They often fall under one of the following: a beginner book, a self-help book, a cookbook, a trading book, or a book on one of the latest fads.

This book is unfortunately just one of the many fake books (not the jazzy kind) that have proliferated on Amazon. If you look at the other recommendations, you'll probably find another one of these books (Python seems to be one of those profitable topics).

A common technique used by these books is to put themselves under some niche category in order to get a high rank. For example, this book categorized itself under "Microsoft C & C++ Windows Programming" [3], and is currently at #9 there (it used to be #1, but thankfully the real reviews probably dragged it down). For a more peculiar example of this, take a look at what's #1 under "Windows XP Guides" [4].

Sorry for going on a tangent with such a long wall of text. I spent a night "investigating" this whole thing a few weeks ago, and after seeing this post, thought that it would be best to spread awareness of the issue here.

[1] https://www.amazon.com/Python-Programming-Beginner-Intermedi...

[2] https://www.amazon.com/gp/profile/amzn1.account.AGXMOOP4UKWV...

[3] https://www.amazon.com/gp/bestsellers/books/3967

[4] https://www.amazon.com/gp/bestsellers/books/6134002011

Original author here. Someone else discovered this and notified me about three weeks ago. Amazon has a site for reporting infringement, so I submitted my claim of ownership. I received an immediate automated response promising a follow up, but I have yet to hear anything more.

In the book's front matter I grant permission for anyone to use the book freely and to make as many copies as they like as long as the original copyright notice remains intact. It started out as my small way of helping my students who are facing escalating higher education costs. Over the years, I've received feedback from other instructors at both the university and high school level who appreciate having this option available for their students.

Thanks for writing this book. As a someone who has had some starts and stops with Python I look forward to giving this oen a shot.

It might be worth calling up Amazon customer service. They are usually very helpful and might be able to route you to the correct person.

I appreciate your research here. I've clicked the "report abuse" option for a few of the sketchy reviews on Amazon, and submitted my own review pointing to your post here, and the original PDF. Perhaps that will prompt Amazon review, or at least save a few potential buyers.

Don't apologise for this; your dissection, even if only a comment, was a tremendously enjoyable read. Well done for putting in the effort to research this!

Apparently someone thought it valuable enough to "pirate", so you can see it yourself here, unfortunately minus the bolded 'q' and bad paper quality:


It's perplexing why someone would copy only the first 4 chapters --- and do it poorly --- but I suppose it's enough to sell; maybe they're not as rational as me, since if I were to plagiarize and sell books, a search/replace of the author's name would've been sufficient. No doubt whoever is doing this is expending more effort for an inferior product.

This is an intro beginning programming book that uses Python, not a Python book for programmers. That's fine, but there's a distinction, which should be clear in the title.

Aw hell yeah. Programming books that teach you how to actually think like a programmer are THE best ones. Thanks for the resource.

Then, you might also like: Think Python [1] and related interactive course [2]

[1] https://greenteapress.com/wp/think-python-2e/

[2] https://runestone.academy/runestone/static/thinkcspy/index.h...

I am using [2], love it, tons of examples with common errors you make, am teaching myself Python and did a few courses out there, this combines everything, one of the best I've seen so far


Perhaps I went through the wrong door, but runestone heaving me straight into probability mathematics and other seemingly saturated problems seemed an unwelcoming intro. I perceived it as a pretty juicy carrot on a long, heavy stick and bailed out.

Looks like a very comprehensive coverage of basic Python (from skimming the TOC). I will pass this as an option alongside "The Quick Python book" to my wife who wants to use Python to replace her STATA anaylses.

I wish there was an abridged version of this book for experienced devs. I guess I can just skip past the parts I feel confident about. I know Python pretty well, but I want to get a back-end job doing it. Like, I wanna develop services in Python for other devs. Sorry that is off-topic. Thank you!

Skimming the book, it does not use type annotations in its functions. I would talk about type annotations and encourage their use soon after presenting the concept of functions. Agree?

No. Type annotations are pointless because they are not enforced in any way – if you're coming from another language it might be really misleading. It's good the author omitted this information. Also most code in the wild doesn't use it anyway.

I think in general you're right, but I think it's wrong to say type annotations are "useless" without some qualification of that statement. I use PyCharm as my Python IDE, which does some static analysis on type annotations to ensure consistency and to give better autocompletion hints, which I find very useful.

They are not pointless if you run code through mypy, an optional static type checker for Python. Most Python code does not use annotations, but that's because annotations are a relatively new feature and because Python programmers are not used to using annotations. Maybe beginners should get in the habit of using annotations when a function only makes sense specific argument types.

Type annotations are fairly new and advanced material. The vast majority of code you'll encounter in the wild doesn't use them. They can and probably should be omitted in a beginner intro.

No, types are distracting at first.

Cool idea. I'd want to see how it goes in a course.

type annotation is actually a fairly niche functionality. It is bad that most people cannot judge by themselves and just follow the hype.

I see a book, I click! I'm a simple man. Thanks for sharing!!!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact