6 ms·
The Bastards Book of Ruby
- knowtheory 14y agoFor those interested, the Bastard's Book of Ruby is written by Dan Nguyen, a journalist and developer who works at ProPublica (http://www.propublica.org/site/author/dan_nguyen http://www.propublica.org/site/author/dan_nguyen ), and the dude responsible for SOPA Opera (http://projects.propublica.org/sopa/ http://projects.propublica.org/sopa/ ). I'm not sure how many other programming books have come up out of the news apps/NICAR world (the National Institute for Computer Assisted Reporting), but one of the reasons i like the Bastard's Book so much is that it's a really practical bent on learning to program.
- saltcod 14y agoA really, really good book. My only wish is that there was a Bastards book of PHP. There is no such practical, useful equivalent in the PHP world that I've found—and I've looked. Maybe I'll ask Dan to write that one next =)
- danso 14y agoI had said awhile back that I would shoot for a Python version since the code tries to be as Ruby-idiom-free as possible...but I think I need to first focus on moving it to a more painless deploying process, such as github+jekyll...and hopefully make it easy for anyone to port over the lessons/examples in other (high-level) languages
- rapind 14y agoWould this help? https://github.com/schacon/git-scribe https://github.com/schacon/git-scribe Edit: Actually the project looks dead, so I'm not sure you'd want to use it.
- apsurd 14y agoI'd honestly want to help you enable this using http://ruhoh.com http://ruhoh.com. it's jekyll inspired but made to be a lot more streamlined. The stack is markdown and mustache. This would be a great way for me to see how I need to evolve the ruhoh platform. Can't honestly say this is the best platform for your book but I am willing to dedicate time to your project to get this done for everyone's benefit. Please contact me and/or point me to the public repo if available. thanks!
- anthonyb 14y agoI wouldn't wish PHP on anyone - even a bastard ;)
- FuzzyDunlop 14y agoI've been planning something along these lines for PHP, but PHP in and of itself has plenty of learning resources. That's not to say they're any good, per se. The focus thus shifts on to correcting the many mistakes these other learning resources make. That might be poor security (SQL injection, XSS, etc.), use of deprecated functions (mysql_* functions), and maintaining your website as an unholy tangle of intermingled HTML, CSS, JS and PHP. This is what I'm more interested in doing. I don't personally see much value in writing about much else (like, idiomatic PHP), because the language itself lacks an opinion on what good code and bad code is, or whether it should be procedural or OOP (see DateTime and mysqli for examples where there is an interface for both styles). Trying to establish a 'norm' for these things would be nothing less than Sisyphean in nature. Compare this to Python and Ruby, where these books flourish because the language itself makes it easier to write about.
- saltcod 14y agoLet us know when its done! There's so much junk and old tutorials out there on PHP, it's very hard to know what's right and what's wrong. It's impossible to know where to start. Starting from practical, useful exercises would be an amazing way to (finally) truly learn PHP.
- xyzzyb 14y agoBack when I was a PHP programmer the "PHP Cookbook" published by O'Reilly was a terrific resource. Unfortunately it looks like that isn't being maintained. Still might be worth picking out of the bargin bin though.
- danso 14y agoThanks for who posted this, I'm ashamed to say that it is in need of an update/typo-fixing that hasn't been done yet (as you can tell by the winter seasonal photo). The main complaint I've heard from people who go through Codecademy/Khan any of the other "easy-to-interactively-learn" options out there is that they don't know what to do with their knowledge of loops/conditionals/variables beyond passing the tests. I wanted something focused on applied tasks, whether it be web scraping/API-fetching or even something as simple as batch concatenating/editing text files. That's how I myself learned, anyway, so just wanted to point out to other authors the value of simple real-world-data projects as a way to keep readers interested.
- why-el 14y agoThis is an excellent initiative. Believe me I know exactly what you are talking about. I have gone over countless numbers of exercises In the past where I put my name and then do some selection statements but beyond that I don't know where to go. Working with APIs can provide a needed sense of practicality. I had few ideas just reading some lines of your first chapter. Keep up the good work.
- saltcod 14y agoYour's is a fantastic book. Downloading Wikipedia pages, counting the images on the NYT homepage, reading xml files, all within a few hours represented some extremely good learning. It's a very refreshing approach to loops and if statements as you say.
- phaus 14y agoI'm a CIS major about to enter my junior year, I still have the same problem that many of codeacademy's students do. I've done a couple of programming classes (which I aced) and dozens of tutorials but I don't have a clue where to begin when it comes to actually designing a useful program.
- envex 14y agoYou just dive in head first and have to realize that a handful of your early projects will be garbage/useless. If you've built a program/app in another language, try and rebuild it in the language you're learning or one you've never used before.
- jmmcd 14y agoThanks, this is the best answer to all the "don't learn to program" arguments.
- wh-uws 14y agoLove this quote from the book from the about/why section Programming languages are more human-friendly. Early computer languages were optimized for early computers. With today's processors, languages can have far more built-in features that drastically reduce the physical tedium and memorized minutiae needed to write powerful programs. Because programming languages don't need to be as efficient for machines to process, they've become much more efficient for humans to work with.
- lukethomas 14y agoAs someone who is currently trying to learn Ruby, this book is EXACTLY what I need. Oftentimes I burn out reading books where I can't see the direct application of the code I'm learning. THANK YOU!
- danso 14y agoGreat to hear. I definitely need to clean up/supplement the various exercises and chapters but hopefully it gives you some of the basic framework to adapt to other web/data sources that you're interested in. Once you've figured out how to loop through a database/data table/API and save yourself dozens/hundreds of mouse-click-copy-paste operations, you won't need much more incentive to keep coding.
- MikeCampo 14y agoExcellent work! Maybe I overlooked it, but is there a PDF version of this?
- damncabbage 14y agoThis is amazing. Thanks for posting this. I await the Bastards Book of Haskell with great interest. ;)
- mcmire 14y agoNice! I haven't read a whole lot of it yet, just the why and FAQ sections, but already it feels unlike your everyday programming book, which I think is refreshing. Also I like the stats next to each of the chapters in the TOC... you seem to be a detailed person.
- cocoflunchy 14y agoJust something that caught my eye, being french... This sentence is not correct: "Je n'ai pas aller au bibliotheque pour manger le fromage." You should write: "Je ne suis pas allé à la bibliothèque pour manger le fromage." Which, in case you wonder, means: "I didn't go to the library to eat cheese."
- maybird 14y agoNon-French here, but trying to learn. What's the difference between "manger le fromage" and "manger du fromage"?
- berberous 14y agonon-french speaker here, but i think it's "eat the cheese" vs. "eat cheese / eat some cheese"
- cocoflunchy 14y agoYup, that's it.
- graeme 14y agoWow, perfect timing, thank you. I just decided to start Michael Hartl's Rails Tutorial, and was looking for something on Ruby because I don't know the language. I love the practical focus; it's exactly why I want to learn programming. I have a very narrow field, and no one has applied programming + domain knowledge to it. edit: forgot to add, the design is beautiful. A pleasure to read.