16 ms·
Zed Shaw: The wonderful Rob Sobers did a great job translating LPTHW to Ruby
- mikemaccana 15y agoThere was an unapproved translation before, IIRC. I guess this is out because the adapter asked Zed's permission first and kept the copyright? If so, I'm cool with that. Zed can be a firestarter, but this shows he's cool with others contributing something provided they do it the right way.
- mestudent 15y agoThis is probably another unapproved translation as zed said his book was meant for teaching python and we need substantial changes for ruby. The other book basically translated the code from python to ruby while keeping much of the text the same I don't know if this is the case with this one.
- mikemaccana 15y agoIt's approved - check the domain (same as LPTHW)
- russtrpkovski 15y agohttp://twitter.com/#!/zedshaw/status/99153296811507712 http://twitter.com/#!/zedshaw/status/99153296811507712
- knowtheory 15y agoUh, given that Zed tweeted this out, and it's up on the learncodethehardway.org domain, this at least has Zed's tacit blessing. I don't know at that point what you mean by "unapproved"
- mattyb 15y agoThis looks like an approved translation to me: http://learncodethehardway.org/ http://learncodethehardway.org/ Also, from the linked page: The prose in this translation is nearly 100% identical to the Python version with the exception of a few paragraphs that have been modified to be relevant to Ruby. All of the code exercises and required libraries have been completely adapted for Ruby. In other words, Zed did all the really hard work.
- zedshaw 15y agoYes, exactly. Rob asked permission, and did a good job doing the translation. My problem with the other attempt was it was half-assed, done without permission, and then left to rot so I had to field frustrated students asking me when it'd be done. This isn't quite idiomatic ruby, but I think it'll be a good kick-starter for someone who knows nothing, and I'm looking to get people to help mold it to be better.
- mattyb 15y agoHow can we help? I can't find the source for this on Gitorious. Edit: nvm, it's here folks: https://gitorious.org/learnrubythehardway/learnrubythehardway https://gitorious.org/learnrubythehardway/learnrubythehardwa... Cheers!
- knowtheory 15y agoThe repo is here: https://gitorious.org/learnrubythehardway/learnrubythehardway https://gitorious.org/learnrubythehardway/learnrubythehardwa...
- zedshaw 15y agoThe main thing is, help improve the ruby code with the least number of changes. I'll have a guide written up today for folks who want to help.
- sigzero 15y agoAnyone doing a Perl version or a !GASP! Tcl version?
- ikilledkojack 15y agoA Perl version would be good, but given that Modern Perl (http://onyxneon.com/books/modern_perl/ http://onyxneon.com/books/modern_perl/) is a fairly recent release, I see many people just pointing newbies towards it since it's very much up to date.
- losvedir 15y agoWhere is the source for the quote from Zed Shaw? The link doesn't mention it at all. I know Zed Shaw railed on a previous translation to Ruby; I'd be curious to know the backstory here about why this one is different. edit: Nevermind, in a different HN thread[1] Zed talks about it. [1] http://news.ycombinator.com/item?id=2846671 http://news.ycombinator.com/item?id=2846671
- knowtheory 15y agoApologies i figured a link to the site was more useful than the link to the tweet: http://twitter.com/#!/zedshaw/status/99151723142184961 http://twitter.com/#!/zedshaw/status/99151723142184961
- zedshaw 15y agoZed here, this one is different because Rob asked permission and then did a great job actually completing the translation. It's not totally idiomatic Ruby, but it should be a good start for people.
- thoradam 15y agoI loved Learning Python the Hard Way so I think I'll do the Ruby version as well, would you recommend anything specific after it to learn idiomatic Ruby?
- zedshaw 15y agoI am not sure, but I'll ask some Ruby folks who might know and then update the book to point people in the right direction.
- zachallaun 15y agoThe title Eloquent Ruby has been getting excellent reviews by beginners and Rubyists alike. And I happened to have loved reading it. It is basically a book of best practices and ruby idioms. (For example, the use of a ruby object's each method instead of for..in.)
- mikeryan 15y ago(side note, there seems to be a page linking problem) Clicking into http://ruby.learncodethehardway.org/intro.html http://ruby.learncodethehardway.org/intro.html and hitting the title takes me here http://learncodethehardway.org/ruby/ http://learncodethehardway.org/ruby/ Clicking a link there takes me to http://learncodethehardway.org/ex00.html http://learncodethehardway.org/ex00.html It looks like that header should link back to http://ruby.learnruby http://ruby.learnruby ...
- pashields 15y agosimilar problem in exercise 26. It contains a link to http://learncodethehardway.com/ruby/exercise26.txt http://learncodethehardway.com/ruby/exercise26.txt, which doesn't exist (and is the wrong domain anyways).
- zedshaw 15y agoFixed. I had to move it to ruby.lcthw.org to keep the various languages straight, but I didn't update the jekyll _config.yml.
- tnorthcutt 15y agoIs there a particular reason pagination navigation is not used (e.g. at the bottom of each page, including previous/next links)?
- yoshyosh 15y agoI was kind of bummed before that a book with such wonderful reviews was only available in one language. This is awesome! Thank you guys so much for doing this :)!
- scrrr 15y agoIt would be nice to be able to copy and paste the code snippets without the line numbers. Otherwise great job!
- veeti 15y agoI think that the point of LPTHW/LRTHW is that you type everything yourself instead of copy-pasting the examples: "You must type each of these exercises in, manually. If you copy and paste, you might as well just not even do them. The point of these exercises is to train your hands, your brain, and your mind in how to read, write, and see code. If you copy-paste, you are cheating yourself out of the effectiveness of the lessons." http://learnpythonthehardway.org/book/intro.html http://learnpythonthehardway.org/book/intro.html
- rsobers 15y agoThe point of The Hard Way methodology is to type everything out and understand what you're doing. Having said that, you could clone the git repository, remove the "linenos" option and run the Jekyll site locally.
- reaganing 15y agoRegarding copy/pasting, I do agree. Not much of a point in reading if you're just going to do that. But, I was having a problem with exercise 4 and so copy/pasted it from the webpage (removed line numbers with TextMate's vertical selection easily enough). Received the same error when trying to run it as I did when I typed it myself: ex4.rb:10:in `+': can't convert Fixnum into String (TypeError) from ex4.rb:10:in `<main>' I'm not familiar enough with Ruby to understand why it's doing that... my googling shows similar ruby tutorials with that format, but one site I found suggested using #{variable_name} instead of the " + variable_name + " and that worked just fine for me. Is this a real error in the book or something weird going on with my computer (OS X Lion w/ Ruby 1.9.2 installed)? Great book, by the way.
- GaltMidas 15y agoCouldn't get your way to work, it blew off the rest of the string. Managed to get it to work by calling .to_s on each variable. Wondering if I did something wrong. I have your same setup and I'm a complete Ruby Noob.
- tghw 15y agoI work with Rob. I always knew he was awesome, but I didn't realize he was this awesome. Great job Rob!
- rsobers 15y agoI started off doing this to teach myself Ruby. I enjoyed the Python version so much and thought it would map pretty well since the languages are fairly similar. After about 15 exercises, I saw that it was actually coming out quite nicely and reached out to Zed. Zed was super cool about releasing it under his license as long as the end result was high quality. I wouldn't have cared if he said not to release it because I got to learn Ruby and play with Sinatra, Jekyll, etc.
- extension 15y agoI've been working on corrections and I was actually struck by how seemingly trivial differences in the languages can completely break large parts of the book. For example, the python version introduces modules fairly early because they are needed for other lessons. But I don't think there is a single library dependency in the entire Ruby version. It can't introduce require and then never use it, but there is very little entry level stuff in the Ruby standard library. There should probably be a chapter on making your own libraries, but that would have to be new material very late in the book.
- rsobers 15y agoHuh? require is used quite a bit: exercises 12, 25, 43, 47, 48, 50, 52. Some exercises depend on sinatra, some depend on test/unit, some depend on stuff you write yourself.
- extension 15y agoThe problem is it's teaching you Python's module system, which is very different from Ruby's require system. Ex. 12 introduces `require` with example code that is way over the reader's head at this point in the book, and unrelated to anything they have seen or will see until ex. 25. It also says that features are called "modules" but that's completely wrong -- Ruby modules are something else entirely. And the term "module" is used in the Python sense all over the book. All those need to be changed. Ex. 25 asks the reader to require their own file but never explains how to get the file in the load path, so I don't think the reader has much chance of completing this exercise. My point is that I don't think a direct per-exercise translation is going to work. Requires in Ruby are more complicated and used less often than modules in Python, and the book is very linear, so I think require will have to be introduced in a completely different way if it's going to make any sense. There are other topics that have this problem, like heredocs. In Python they are pretty so it's ok to throw them at the reader early on. But Ruby heredocs will melt their eyeballs out of their sockets, and they are rarely used in practice, so they probably shouldn't be in the book at all. I am working on these sorts of changes with the intention of sharing them with you to see what you think, but it's starting to snowball so I don't want to promise anything. I'll do my best.
- tomkarlo 15y agoIs there a single-page version of this available that I could put into my Kindle? Alternately, I'd be quite happy to pay for a copy if it was posted to Kindle Self-Publishing (https://kdp.amazon.com https://kdp.amazon.com)
- vnchr 15y agoI wanted one too, so I PDF-printed all the pages, combined them into one file and also made a Kindle version: http://bit.ly/o7gfMH http://bit.ly/o7gfMH It's hosted on Rapidshare. I expect Zed will have a better version soon, but this works in a pinch.
- nn000 15y agoRuby > Python
- Apocryphon 15y agoThis is a great resource. I'm in the process of learning Ruby, and will be trying out Ruby Koans and Satish Talim's Ruby Learning site as well in comparison. Does anyone know how good those tutorials are, or if there are any other good online Ruby guides?
- BadassFractal 15y agoCould someone explain the reason why the "learn x the hard way" method has been so popular around here? I keep seeing the name thrown around, but haven't had a chance to look into it yet.
- dimmuborgir 15y agoThe reason is Zed Shaw. He has a large following here on HN.
- bfe 15y agoBecause Zed Shaw's original book makes learning Python so easy for anyone without assuming any prior knowledge, plus he's hilarious.
- eavc 15y agoHe assumes you are a very bright person who happens to be utterly helpless about this domain. Considering that's exactly where I was, it was perfect for me. He shows you how to do everything...once.
- chefsurfing 15y agoGreat thanks Rob!
- nazgob 15y agoI would buy it for Kindle!
- kristofferR 15y agoYeah, I would too. But Zed, please check the Kindle version before you approve it. The Python book for Kindle is absolutely horrible - with all the code stripped out.
- blackman 15y agoI really like the idea behind these books, it reminds me of how I learnt originally, typing BASIC programs into my zx spectrum from the back of computer magazines.
- enry_straker 15y agoYou too - though i didn't have access to too many computer magazines so had to make do with odd listings gleaned from various sources including kermit. ZX Spectrum rocked my world in my childhood :-)
- innes 15y agoI typed in CBM64 programs - not sure how helpful it was in learning to code though... 2000 DATA 103, 20, 122, 58, 53, 240, 188, 86, ... [ctd for 8 pages]...
- blackman 15y agoi'm sure it was helpful. the first skill in learning how to code is little details, like making sure all the text is the same as the listing, and that you pressed enter after every line ... ;-)
- marcamillion 15y agoOut of curiosity, is Rob Sobers pretty known in the programming community? I have never heard of him before, but based on the way Zed wrote about him, seems that he just might be famous and I haven't heard about him (which is very possible). Otherwise, if he was just a 'regular' web designer that learned Python the Hard Way and translated to Ruby and Zed has given him so much credit....that would be AWESOME. In all honesty, quite uncharacteristic of Zed - as far as I know, not being a dick (just honest) - which is why I think he is 'programming famous'. I am hoping he was just a regular 'joe blow' though. Anyone know?
- rsobers 15y agoI'm definitely not "programming famous." My boss, Joel Spolsky, is though (I work for Fog Creek Software). I don't know Zed personally either. He was a bit skeptical about me doing this at first, but he was ultimately really cool about it because I respected his terms, and if at any time he told me to ditch the book, I would have.
- foobarbazoo 15y ago@zedshaw Would you be up for a Factor version done with the same spirit and quality?
- deepcode 15y agoExercise 9: 10 There's something going on here. 11 With the three double-quotes - no triple-double-quotes in ruby version, actually