00:00
1590
More
I have a larger talk on how Clojure has affected my Ruby programming. This talk has some overlap with that, but it contains material I threw out of the larger talk.

Because I'm not going to be presenting this talk For Reals, I didn't polish it before recording. This is, in fact, the first time I've narrated these slides aloud. You have been warned.

Credits

Likes

See all likes
  • Aaron Lee 1 month ago
    Good presentation! Have you read about DCI(infoq.com/presentations/The-DCI-Architecture)? They seem to be headed in a similar direction(objects are not bad, but not as rigid as we think).
  •  
  • Brian Marick 1 month ago
    I was just reading on DCI today. Have been thinking about how it would look for what I'm doing.

    I'm not sure that Roles/Traits get away from the Noun problem, in that all the traits (in what I read earlier) seem to be named with nouns (like Waitor). So roles seem to be used to figure out which methods to inject into objects (in a context). Verbs (functions/methods) still only exist to be clumped onto objects. Whereas I want to think of verbs as being the, um, things that the system revolves around.
  •  
  • James Martin 1 month ago
    I like the direction this is heading and the reasoning behind it.

    The nod to Steve Yegge's, 'Kingdom of the Nouns' narrative made me smile but also, importantly, ties up a couple of loose ends from that post; like practical advice for mixing Object and Functional languages for great good.

    I've been fiddling with similar concepts in my own Ruby code for a while but without any real direction or rationale beyond, "it just feels better".

    Looking forward to seeing how this pans out for you.

    Thanks for sharing. :-)
  •  
  • Michael Xavier 1 week ago
    Thanks for sharing. I'm onboard for preferring composition to inheritance by way of modules. I've heard enough OO practitioners recommend that that I'm starting to believe its actually a design principle of modern OO.

    I have to say though that when I heard you say that all of your classes inherit from Hash I said out loud "I hope you trust your collaborators and like nilErrors". I honestly think this is a big mistake. If I am using a class with embodies a well defined concept (because if it wasn't, then it could very well be a hash), I want to know for certain what attributes can be relied upon. I'd like to be able to see those as methods to document that. It should not be my job as the user of the class to "ask" it for properties and then either do loads of nil checking or just hope I got the hash key correct.

    For this I direct you to a talk by Avdi Grimm called Confident Code avdi.org/talks/confident-code-railsconf-2011/ Writing code that must query, poke and prod domain objects for properties at run-time which most of the time can be guaranteed at "compile time" so to speak leads to timid code. Code that must spend all its time dealing with edge cases rather than expressing the business logic. There's also another article recently mentioned on ruby5 that outlines the woes of writing classes that wrap a hash but leave access to write/mutate keys available to collaborators, but I lost track of it.

    My FP experience is with Haskell. I find that typeclasses and a very present type system means you can concisely write functions that deal with data types that are guaranteed to have the interface you require of them.

    Just my 2 cents. I'd be interested to see how this pans out on projects with > 1 developer. I'd be kind of ticked off if I was given a library where I was expected to integrate by way of hash access.
  •  
This conversation is missing your voice. Take five seconds to join Vimeo or log in.

Advertisement

About this video

MP4
00:26:30
  • 640x480, 36.85MB
  • Uploaded Tue January 03, 2012
  • Please join or log in to download

Statistics

Date Plays Comments
Totals 2,744 15 4
Feb 23rd 1 0 0
Feb 22nd 2 0 0
Feb 21st 11 0 0
Feb 20th 8 0 0
Feb 19th 7 0 0
Feb 18th 17 0 0
Feb 17th 2 0 0