Ruby talks of 2014
przemekmroczek.com
przemekmroczek.com
It made me nearly buy Tom's book but the only reason I didn't was because I already owned it! I hope the book is similar to the talk.
Unicorn unix magic tricks is really good at explaining some of Unicorn's advanced features. It shows how Unicorn uses Unix signals and forking in detail.
I would like to thank the original poster for posting this talk and all the other HNers for posting the follow-up info (including a link to his book).
This info came to me at the perfect time.
I figured I would make my first post on HN for the year, be a positive and thankful one.
Thanks again :)
http://thomasleecopeland.com/2014/10/18/good-technical-video...
Andrew Turley's "What we can learn from COBOL" talk is probably my favorite.
http://confreaks.com/videos/4659-nickelcityruby2014-how-to-b...
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)...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.
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!
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?
class 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.
I'm pretty good with "small methods" but her refactor from that to "small objects", while more flexible, seems like its more complicated in the end. I mean if you're going to have a lot of those it makes sense, but I feel like it could equally be called premature; but I respect that it is more tolerant to future unknown changes. "small methods" is also easier for a junior developer to support, and i think that should be taken into consideration.
A point she made earlier in the talk is the piece that I have become more and more in agreement with over time. Paraphrasing: 'bad abstractions are worse than code duplication'. I would go farther and say that in the modern coding world, premature optimization isn't the root of all evil, premature abstraction is.
The part that I find contradictory is that breaking larger classes into tons of little classes is, to me, a form of abstraction and carries implicit complexicty. She does hit on this point a bit, but it's easier to dodge the issue with simple examples than it is in the wild. Certainly there is a 'cutoff' where a class is too big, but I find that trying to make every method 1 line long and every class completely contained creates huge nested layers of abstractions that are often difficult to follow and hard to reason about for anyone other than the author or someone who has been working on the codebase for a long time.
I agree a lot with this, and have worked on such codebases. It becomes very difficult to tell whats actually going on, or how. or why! I think like everything else, it's subject to abuse and misuse.