Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

How heavily is this tied to Python?

Can a ruby/JS hacker with no python experience jump into this book?



Come on young rubyist. embrace the dark side. You will like it. /jk

I went through the fist couple of chapters and all the python code I've seen so far is quite close to "pseudo-code" than deeply-idiomatic Python.

Considering the fact that the Prof. also wrote "How To Think Like a Computer Scientist: Learning with {Python/Java/C++}", you can be rest assured that he knows how not to trip up students with clever syntax.


Come on young rubyist. embrace the dark side. You will like it. /jk

I adopted Python because I was told Ruby is the dark side. oO


Probably.

  % gem install rubypython
  % wget http://thinkstats.com/Pmf.py
  % irb
  >> require 'rubypython'
  => true
  >> RubyPython.start
  => true 
  >> sys = RubyPython.import 'sys'
  => <module 'sys' (built-in)> 
  >> sys.path.append '.'
  => None 
  >> Pmf = RubyPython.import 'Pmf'
  => <module 'Pmf' from './Pmf.py'> 
  >> hist = Pmf.MakeHistFromList([1, 2, 2, 3, 5])
  => <Pmf.Hist object at 0x7f6681a4f490> 
  >> hist.Freq(2)
  => 2 
  >> hist.Freq(4)
  => 0 
  >> hist.Values()
  => [1, 2, 3, 5] 
  >> RubyPython.stop
  => true
The above adapted from part of section 2.4 (http://www.greenteapress.com/thinkstats/html/book003.html#to...).


Python examples are embedded in the text, explaining what is being done. If you're familiar with Ruby, you should be able to do an on-the-fly mapping. But, it's easy to see for yourself: http://www.greenteapress.com/thinkstats/thinkstats.pdf


I tried to keep the code simple -- no Python esoterica, only a few objects. So it should be easy to pick up the Python as you go along.

But let me know whether that turns out to be true.


Just wanted say thanks for all you contribute. Your textbook manifesto is inspirational. Also, I wanted to offer some encouragement on your Complexity book. It looks lke it's off to a great start.

Any chance we'll see a Clojure version of any of your books? It seems to be shaping up as a good choice for scientific computing.


Thanks! I am hoping to get back to the Complexity book soon. I want to finish the section on agent-based modeling (and I need to remove some of the stats material that I poached for Think Stats).

Clojure looks interesting, but I don't know much about it, so I probably won't do anything with it soon. But part of the reason I use free licenses is so that other people can adapt my books.

Nicholas Monje is working on Think OCaml (http://thinkocaml.com); that might be the best version to translate into Clojure.




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

Search: