Hacker News new | past | comments | ask | show | jobs | submit login
Giving away my Rails 3.0 book. Code examples also available on Github. (github.com)
210 points by bryanbibat on Sept 5, 2011 | hide | past | web | favorite | 34 comments



"You are free to distribute this book to anyone you want, so long as... it is not altered..."

That doesn't seem consistent w/ the intended usage patterns of git and github, e.g. github's 'Fork' button is displayed prominently on every src page, for the purpose of alteration and distribution of src.


tl;dr If you fork and don't pull-request then that's the violation.

That's the point. If you fork and don't do a pull request so I can pull it back, then you're leaving an altered copy out there. Can't do that. If however you do a pull request and I pull your changes in, then your fork is no longer an alteration.

This prevents people from butchering your work because they think they know better and then leaving half-assed junk out there to screw students over, but still lets people contribute fixes.


Noted. Any suggestions on a good license to use for this document to allow non-commercial derivative works?


You're looking for this: http://creativecommons.org/licenses/by-nc/3.0/

Although, there is one that prevents modification as well if that's what you're looking for.


No, that license allows remixing and adapting the work. That would let people butcher the book and leave broken copies that frustrate students.


Zed, that's what he wanted. As I suggested there are alternatives to prevent someone from changing even one word.


Yup. While it is true that allowing others to modify my work will probably bite me in the ass in the future, there are also some arguments for allowing this.

For one, the book is targeted to Filipino students - teachers may want to modify the names/scenarios to better suit their country. Sure, gives them a low-hanging trolling fruit (e.g. putting vulgar words in the i18n section), but I really don't have the time to review these forks.


Thanks! Will update the document tomorrow to use that in case no one makes a better suggestion.


Thanks for using cc-by-nc.


[deleted]


You're reading way too much into molecule's comment. He's merely commenting on the fact that the chosen hosting platform is explicitly designed for purposes that are counter to the chosen license. I see no judgements on the choice of the license itself. Can you explain how the comment implies that "everything needs to be on [programmers'] terms"?


To be fair, I assumed the same thing that the parent did.

The reaction came from "The guy just said he doesn't want to allow forks or changes" so what does it matter if github has a feature that allows it. The button isn't a licensing agreement like CC, GPL, etc are.


While I agree to some of your points (i.e. I'll go WTF?!? if someone would sell my crappy book), there's no need to go off the hook ;D


You might want to read: http://sethgodin.typepad.com/seths_blog/2007/02/please_dont_...

I'm sure there is a cottage industry of people who take creative commons works licensed without the non-commercial attribute and sell them. They aren't making a ton, but they do sell a few and it costs basically nothing to put it up on Amazon.


git is a great vcs, and github a great hosting platform, even if you don't intend to use features like forking and pull requests


Even though I consider myself an intermediate Rails programmer, I read through every beginner guide I can find to pick up the small nuances that differ from programmer to programmer.

Thanks!


You're in good company. Mikhail Botvinnik, many times world chess champion, was known to watch tv programmes about chess. The theory being that you can never reinforce the fundamentals enough. I concur, in any field of study.


thanks for taking the time with this.

1. Any plans to update for 3.1 ?

2. I think its strange to address the dsl rspec for testing vs the standard rails unit test and not address other dsl like haml, sass, coffeescript (3.1). I think if you're going to go by rails community conventions vs rails framework convention then haml and sass should of been introduced.


While I can't answer #1, I can give a reason for #2. When you're teaching people Ruby on Rails you would/should be teaching them what exists in the framework by default. The default templating language for views happens to be ERB-powered HTML, and so that should be taught.

Teaching haml and Rails at the same time would only confuse people as they will need to learn Rails AND haml at the same time. If anything, it would be better to introduce this as a "bonus chapter" or an appendix and let people choose for themselves rather than forcing them to learn something excessive.

Now, you may think that I would argue the same point for SCSS too. But now that SCSS is the default within Rails 3.1, it is "right" to teach it at the same time as Rails. The "leap" from CSS to SCSS is not as large as the one from HTML to haml, either.


>When you're teaching people Ruby on Rails you would/should be teaching them what exists in the framework by default.

this was exactly my point. You introduce RSpec rather than rails unit testing.


I would do the same thing, as Test::Unit's syntax is more confusing to a newbie than RSpec. For instance: assert_equal 2, @thing.method vs @thing.method.should == 2.

RSpec is also used by the majority of Rails developers (based on a random stat I pulled out of the air and due to my experience on many, many Rails projects) and it should be treated as the default, even though it is not.


> For instance: assert_equal 2, @thing.method vs @thing.method.should == 2.

...what makes you think this is less confusing? Test::Unit is blindingly simple, your assertions are plain old functions that take plain old arguments. I can build new assertions through simple function definition.

Rspec, on the other hand, adds methods to everything to let you structure your code so it reads like English. The goal here is not to be less confusing, but to be easier to read. RSpec is a lot harder to learn, and writing custom matchers is a lot more work than gluing together assertions.

Seriously, watch somebody new trying to figure out RSpec ... it's a bit of an ugly sight. Their first experience with automatic predicate matchers typically is a true wtf moment.


1. Maybe. I have no plans to teach Rails 3.1 for the rest of the year, but on the other hand writing about 3.1 will get me up to speed on the new features faster than simply writing some throwaway programs.

2. What Ryan Bigg said. :D I sometimes get a couple of extra hours at the end of a training course to teach topics like Haml, Devise, Paperclip, etc. But that's only if the students are experienced developers; I'd get in trouble if I put these topics in the course outline but couldn't cover them because the students had to take time to absorb the main topics.


<a href="http://railscasts.com/episodes/282-upgrading-to-rails-3-1?au... that app to 3.1 with this screen cast</a>


Byran why don't you sell the book to your own students? I know a lot of my professors sell their own books through the book store (with no real publisher) they just print it out and put a cover on it.


Ethics, I guess? LOL. Not really keen on selling a typo-filled book on a non-current version of a software.


Thank you. This is coming at a very opportune time for me.


THANK YOU - sorry for caps but thanks are big.


Off topic: what is the font you used in the PDF book?

UPDATE: ...and thank you much for the materials!


Inconsolata (http://www.levien.com/type/myfonts/inconsolata.html) for code and Ubuntu (http://font.ubuntu.com/) for everything else


Thank you very much.


this book is a gem! (pun intended)


how do you download the book?



Thanks!




Registration is open for Startup School 2019. Classes start July 22nd.

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

Search: