Think like a computer scientist: free, interactive textbook


#1

Originally published at: http://boingboing.net/2016/10/05/think-like-a-computer-scientis.html


#2

No thanks, I’ve known too many computer scientists.


#3

And I’ve seen the code they write :weary:


#4

Me too, and I am one.
I did, however, once write a paper about what’s wrong with how computer scientists think:


#5

Are you trying to sneak in a lesson on recursion?


#6

As an Electrical Engineer, I’d rather not.


#7

A computer scientist’s wife sends him to the grocery store and asks him to get a gallon of milk, and if they have eggs, to get a dozen. He returns staggering under the weight of 12 gallons of milk.


#8

This is actually an incredible book. An older version is what I used to teach myself Python. If you want to learn to code, or to learn Python if you already code, this free book is far better than any of the courses you always see them flogging on the boingboing store.

I didn’t check it, but if this has been updated for Python 3, that is great, because one of the issues I’ve had recommending this to people these last two or three years is that all the examples and all the code you need to run them, was Python 2 only.


#9

Thirteen gallons, surely? :wink:

A computer scientist calls his friend. “My wife just gave birth!” he says.

“Congratulations! Is it a boy or a girl?”

“Yes!”


#10

Twelve. She said get a dozen, not get a dozen more.


#11

get_milk(1.gallon) and (get_milk(12.gallons) if eggs.any?)

No? I guess maybe it could be:

milk = 1.gallon && (eggs.any? && 12.gallons)

But then if there are no eggs your husband may return false milk :open_mouth:

That night, the computer scientist attempted to explain if/then/else constructs while his wife threw milk at him.


#12

This topic was automatically closed after 5 days. New replies are no longer allowed.