The C++ version of traditional "Hello, World!" program looks like this:
#include <iostream.h>
void main()
{
cout << "Hello, World!" << endl;
}
in the Python version it becomes:
print "Hello, World!"
The explanatory for each version of the program illustrates what this means to the beginning student. It requires thirteen paragraphs of explanation of "Hello, World!" for the C++ version; for the Python version, there are only two. More importantly, the missing eleven paragraphs do not deal with the "big ideas" in computer programming but with the minutia of C++ syntax.
Python eliminates the syntax that clutters programs in other languages and makes them difficult to understand.
Beautiful is better than ugly.
Explicit is better than implicit.
Simple is better than complex.
Complex is better than complicated.
Flat is better than nested.
Sparse is better than dense.
Readability counts.
Special cases aren't special enough to break the rules.
Although practicality beats purity.
Errors should never pass silently.
Unless explicitly silenced.
In the face of ambiguity, refuse the temptation to guess.
There should be one-- and preferably only one --obvious way to do it.
Although that way may not be obvious at first unless you're Dutch.
Now is better than never.
Although never is often better than *right* now.
If the implementation is hard to explain, it's a bad idea.
If the implementation is easy to explain, it may be a good idea.
Namespaces are one honking great idea -- let's do more of those!
How to Think Like a Computer Scientist: Learning with Python
This is a 258 page book, including the Appendices and Index.
If there is sufficient interest we will present an online class using this book in the fall after the Challenge Kickoff. We will cover one chapter per week. The average chapter is approximately 12 pages.