3 ms·
That this list got upvoted to the top spot must be some sign that the HN audience is still enthused about Ruby-related stories (I say that has a Ruby fan myself
by danso 12y ago
That this list got upvoted to the top spot must be some sign that the HN audience is still enthused about Ruby-related stories (I say that has a Ruby fan myself)...It's a good list and I'll bookmark all of its items, but it is pretty brief, both in items (5) and in the summarization (and the use of the overexcited cliché "killer" in the original title makes me extra curmudgeonly about it).
Or are people really enthused about talks as a way to learn things? I haven't been to a talk in awhile and I just can't get into video learning. So FWIW, I'll throw in the Ruby-related-infothing that I was most excited about this year: the publishing of "Metaprogramming Ruby 2:" (https://pragprog.com/book/ppmetr2/metaprogramming-ruby-2 https://pragprog.com/book/ppmetr2/metaprogramming-ruby-2)...The original version was one of the most helpful books to me as a Ruby beginner in 2010, both in learning the language and learning new ways to think about programming.
- deleted 12y ago[deleted]
- ndesaulniers 12y agoWoah! The first one was one of the coolest books I've ever read!
- tcopeland 12y agoI think it's a combination of people liking Ruby, as you said, and also just slow work day for folks in US. I agree with the 2nd ed of Metaprogramming being a great addition to the shelf. I feel like it's been a solid year for Ruby, especially with 2.2 coming out with inc GC and symbol GC. Good times!
- Dirlewanger 12y agoTalks are a ridiculously awesome way to learn new things. They're low effort. They have someone else summarizing/breaking down concepts for you in digestible pieces which allow you to form your own (and hopefully not your only) base of understanding about the concept. From start to finish, the viewer is undergoing their own personal synthesis of some thing. Granted, one needs to further apply them for the concept to really solidify, but I think talks are as good as any other resource for taking that first step in learning about something.
- MichaelGG 12y agoWhat do you find so fantastic? I'm starting to think I'm broken, because I just don't understand what's so amazing. I read Metaprogramming Ruby. It seems very excited to show you how you can do "myrow.columnname" instead of something like "myrow[" columnname"]. Likewise, I see people absolutely tickled that they can do "find_by_id(123)" without codegen vs "find_by("id", 123)". OK that saves a bit of syntax, but it's hardly breakthrough. And it's more elegantly solved with a specific dynamic lookup operator. It doesn't seem like it's worth the performance overhead or the pitfalls of a dynamic environment (thinking of the fun Rails had in the simple task of serializing HTTP bodies). The only benefit I've found in Ruby that's not easily accessible in say, F#, is having reflection easily accessible. The .Net reflection libraries are clunkily designed. When you need it, being able to eval and such is handy. All the pieces are there, but they don't just expose an " eval" call or whatnot. But that's mainly a stdlib shortcoming, and wouldn't require giving up static analysis. Do you have any pointers to examples where metaprogramming is really useful, to the point of paying the cost of Ruby?
- resca79 12y agoIf you are talking about ActiveRecord methods, `find_by_id(123)` or `find_by("id", 123)` are a little bit wrong both, you should use a simple `find(123)`
- venus 12y agofind_by_id/find_by aren't "wrong", they're just different. Sometimes you want to fall back to nil instead of raising an exception.
- asattarmd 12y agoclass Blog < ActiveRecord::Base end Ever wonder how that works? Metaprogramming. enum status: [ :active, :archived ]. validates :status, presence: true Ever wonder how that works? Metaprogramming. Used the awesome debugger, pry? Ever wonder how that works? Metaprogramming. `find_by_id` isn't the only thing that's implemented using Metaprogramming. Practically, everything within ActiveModel is achieved through Metaprogramming. It is one very important reason that allows Ruby to be so expressive.