Tuesday Afternoon Session Notes
November 18th, 2008
The Voices That Matter ruby conference is a single track conference emphasizing short 30 minute presentations that give you a taste of a variety of topics.
Had a fabulous lunchtime conversation with fellow female coder Sophie from the American Physical Society and her coworkers. Very yummy lunch sponsored by Sermo where the Boston Ruby Group currently meets.
Sophie and I discussed the dirth of women at the conference. Barbara Gavin told us that usually only 5% of programming conferences are women. Sad statistic. I know there are more women coders out there. We really need to make an effort to be visible. Me and my bringing a baby to the afternoon workshop can only accomplish so much!
At yesterday’s workshop, Lilli and I sat next to Nick Plante who (other than the sexist scantily clad super woman image in his PPT) gave a dynamic talk demystifying developing rails plugins. The trick is to write generalized code for reuse and to contribute to the Ruby OSS ecosystem. The ultimate in “community love”. Make people learn as little “new stuff” as you have to when creating a new plugin. Check out existing plugin patterns, conventions and incorporate functionality folks are already used to using. BTW, no one is going to have confidence in your plugin if you don’t include tests. Test the behavior of the system with the plugin installed rather than the eccentricities of the plugin code itself. Github is the current plugin repository of choice. Why not write a gem? They provide proper versioning and dependency management and GitHub makes it easy for you. Don’t be afraid!
Ezra Zygmuntowicz works for EngineYard and spoke about Ruby Deployment. Lighttpd + SCGI was okay, then people tried Apache + FCGID which was a little more stable, then there was Mongrel + Apache which was kickass. A lot of people still use this model. Lightspeed is a commercial web server that offers a free version but you can’t surf porn with it. WTF? Mongrel + Nginx (writen for massive Russian porn surfing) for the win! Thin or Ebb + Nginx wins sometimes too because of efficient thread schedules but the trade off is that really long requests are bad for this web server Passenger is the latest thing people are using and is an awesome solution but not ready for larger production websites just yet due to issues with Apache. It’s okay for shared hosting and small VPS but Nginx + Mongrel or Thin works best for high volume production and is the deployment enviornment of choice. Rack is the great web server equializer. Its a web server gateway extracter interface which boils down a web server into a class that takes the enviornment as an argument. It lets you use a variety of web server options without writing new code handlers. Ezra is currently working on Nanite: self assembling cluster of ruby processes built around RabbitMQ. Everyone here is excited about EYAAS (Engine Yard As A Service) cloud, load balancing with nanite and rack to be released in January. A different way of thinking about deployment. Its all about automation – State Based Configuration Management. More at http://bit.ly/bRcA
Matt Jankowski is from Thoughtbot, a consulting firm who recently created a social networking for scientists capturing relationships and publication data amongst academics and researchers to provide a forum for online communcation. The first half of Matt’s talk about Agile vs Enterprise seemed more like a rant against his parents. He compared “Agile people” who have fun and enjoy their work to “Enterprise people” who “just” want a 9-5 job and prefer to “pay their mortgage” and “get their kids to school on time” over folks who prefer to live their job 24-7. I guess Agile developers aren’t interested in having a home and kids. I think his intent was to talk about how to integrate the two but he didn’t really offer any solutions, just banal comparisons.
Shane Harvie used a network sharing example to explain Refactoring Complex Domains in Ruby and Rails. He chatted about Inheritence vs. delegation. Call extend to change behavior at runtime. Mixology allows you to take away old behaviors and add in a new behavior. What if a method involves writing to multiple models? Answer: Service objects! Also try using result objects as a refactoring alternative to arrays and hashes. Difficult topic to discuss in 30 mintues, best to refer to the PPT here!
Finally Bryan Liles, Pat Maddox, Sandi Metz and Tammer Saleh formed the panel that discussed testing methodologies. Nice to see a woman and a non-white male up there.
“Its cheaper to write tests than not to write tests!” The test driven development folks refer to a quick, exploratory, investigation that involves coding something up to see if it works, a spike. Tests shouldn’t be so granular that you need to continually change logic for every code change. Don’t test implementation, test behavior. A monkey test is a unit test that runs with no specific test in mind. Starting out? Check out Rspec.info or Shoulda. Keep it as simple as possible. Write simple tests, refactor, rinse and repeat. Take the refactoring books written in java and rewrite it in ruby to get started. Test unit is a framework for unit testing in Ruby that encourages bad behavior. Writing tests is hard because it means changing your style of development. Its hard at first, but you just have to keep doing it. Tests are there to help you because we are all human. Non-testers are called cowboy coders, they are considered disrespectful and ultimately a liability. Long sequences of method calls are derided as train wrecks. Mock at the unit level. Rails vanilla fixtures suck. Instead use Object Daddy or Factory Girl. Do it. Don’t be afraid!
Entry Filed under: Ruby on Rails

Leave a Comment
Some HTML allowed:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>
Trackback this post | Subscribe to the comments via RSS Feed