I've organized a large collection of free and non-free books on a new part of this site: The Invent with Python Bookshelf.
Feel free to send any suggested titles I should add to it.
This blog post is those still new to programming and have probably heard about "object-oriented programming", "OOP", "classes", "inheritance/encapsulation/polymorphism", and other computer science terms but still don't get what exactly OOP is used for. In this post I'll explain why OOP is used and how it makes coding easier. This post uses Python 3 code, but the concepts apply to any programming language.
There are two key non-OOP concepts to understand right off the bat:
I've started a wiki for an IDLE redesign project: https://github.com/asweigart/idle-reimagined/wiki
If you would like to help, please join the mailing list: https://groups.google.com/forum/#!forum/idle-reimagined/
From the wiki:
IDLE Reimagined is the code name for a redesign for Python's default IDLE editor with focus as an educational tool. IDLE's chief utility is that it comes installed with Python, making it simple for newbies to start programming. But professional software developers don't use IDLE as their IDE. Instead of turning IDLE into a sophisticated IDE for professional software developers, it can be tooled with features specifically to make it friendly to those learning to program.
Prime Directives for the new design:
These are the features that will distinguish IR and make it a good candidate to replace IDLE:
Work on the 3rd Edition of "Invent Your Own Computer Games with Python" has begun, along with translations of the book to
Spanish, French, Chinese, and Swedish all foreign languages (these were just the languages that have been started, but I appreciate translators of any language). The 2nd edition came out in 2010. Since then, I've written three more books and gained experience from teaching programming to kids and adults. The 3rd edition will not have new content, but has two major aims:
I'm currently looking for volunteer translators of all experience levels to commit any amount of effort. Please contact me at [email protected].
The translation efforts will be coordinated on the GitHub repo for the 3rd edition. Even if you do not have experience using git, I can work with you to get your translations checked into the repository.
All proceeds from sales of translated books of "Invent Your Own Computer Games with Python, 3rd Edition" will be donated to the Python Software Foundation.
These proceeds will be published on GitHub.
I make similar donations to the EFF, Tor Project, and Creative Commons nonprofits from sales of my other book, "Hacking Secret Ciphers with Python". I publicly post an accounting of these donations.
All translators will get attribution credit on the book cover, in the PDF, and on the website.
I appreciate the efforts of the translators to bring programming knowledge outside of the English-speaking world. I want them to know that I do not plan to personally profit off of their labor.
The geeks have inherited the earth. A couple decades ago if you talked with friends in a chat room, you were cast as a socially-awkward nerd. Doing the same today just means you're a typical Facebook user. Broadband Internet connections and smartphones have taken the Information Age that technically started in the 1970s with PCs and pushed it into daily mainstream life.
Along with this culture change is a social anxiety: Should I learn to code? Is coding the new literacy? Will I program or be programmed? This is not a new anxiety. Here's a New York Times article, Personal Computers; Does Everyone Need to Learn Programming? It was written in 1984.
Like with all panics, entrepreneurs and pundits (including myself) come out of the woodwork to offer their opinions or push their products. Software developer Jeff Atwood gives a plea to not learn how to code (a position I sharply disagree with). There are many websites and bootcamps (ranging from free to overpriced) to teach beginners programming. Most of them (in my opinion) are terrible.
Don't get me wrong: You should learn to program. But lost in this hype is a plainspoken reason: NO, SERIOUSLY, WHY SHOULD I LEARN TO CODE?
Here are bogus reason you should learn to code that you'll find in most everyone-should-learn-to-code rhetoric:
Before I go into the real reasons you, your friends, your neighbors, your cat, and everyone should indeed learn to code, consider this anecdote:
A math teacher is giving a lesson on logarithms or the quadratic equation or whatever and is asked by a student, "When will I ever need to know this?"
"Most likely never," replied the teacher without hesitation. "Most jobs and even a lot of professions won't require you to know any math beyond basic arithmetic or a little algebra."
"But," the teacher continued, "let me ask you this. Why do people go to the gym and lift weights? Do they all plan on becoming Olympic weight lifters, or professional body builders? Do they think they'll one day find an old lady trapped under a 200 pound bar bell and say, 'This is what I've been training for.'"
"No, they lift weights because it makes them stronger. Learning math is important because because it makes you smarter. It forces your brain to think in a way that normally it wouldn't think: a way that requires precision, discipline, and abstract thought. It's more than rote memorization, or making beautiful things, or figuring out someone's expectations and how to appease them. Doing your math homework is practice for the kind of disciplined thinking where there are objective right and wrong answers. And math is ubiquitous: it comes up in a lot of other subjects and is universal across cultures. And all this is practice for thinking in a new way. And being able to think in new ways, more than anything, is what will prepare you for an unpredictable, even dangerous, future."
Learning to program a computer, even if you don't plan on becoming a software engineer, has three similar reasons to pursue it:
Cory Doctorow wrote an article that even before learning to code, we should be teaching kids how to use regular expressions. "Regexes" are ways to specify a pattern of text. Your word processing software most likely lets you use regular expressions for its find-and-replace feature. Regular expressions can be used for an app's search feature. This is a skill that magnifies your power as a user. And once a populace is literate in regular expressions, software developers will increasing make use of them in more capable and powerful apps.
The same can be true with programming. Imagine what software could be like if the populace were literate in basic programming. Instead of apps, we could have APIs. Users could tie together the different services and programs they use. It would tear down the walled-gardens that Facebook, Apple, Twitter, and Google have erected to maintain their monopolies. It would pave the roads for improving the Information Age the same way the printing press improved literacy.
There are plenty of skills people can learn to become well-rounded human beings: Playing an instrument, public speaking, budgeting, first aid, growing plants, persuasive writing, babysitting, identifying scams, et cetera, et cetera.
But programming is unique among these skills. Programming is a practical skill on a tool you already use every day. Learning it provides abundant, but not pointless, intellectual hurdles to train your brain. It can save you time on computer-based tasks while opening your eyes to accomplishments that were previously unfeasible. That is why you should seriously learn to program.